On 23 Feb 06 08:56AM, kamaraju kusumanchi wrote:
> I think (in both the above cases) the necessary indentation files are
> not sourced properly. Let's try another method.
>
> open the file by using -u NONE option
>
> $gvim -u NONE temp/test2.m
>
> Then paste your unindented code
>
> Then source the appropriate matlab indentation files ...
>
> :so /usr/share/vim/vim64/indent/matlab.vim
>
> Then select all the lines with V or v or mouse etc., and then press =
>
> Let me know if this works.
Consider:
go = 1;
while
for j = 1 : 10
for i = 1 : 10
a = i;
b = j;
end
end
end
On my system [Kubuntu 5.10 (breezy); VIM - Vi IMproved 6.3,
Included patches: 1-78], using .../indent/matlab.vim, along with
set expandtab
set tabstop=2
set shiftwidth=2
results in:
go = 1;
while
for j = 1 : 10
for i = 1 : 10
a = i;
b = j;
end
end
end
For some reason, the ends don't get properly indented. The
octave.vim script
(
http://www.vim.org/scripts/script.php?script_id=1241) seems to
only provide syntax support for endif, endwhile, and so forth.
But, from my testing, it doesn't help with indenting.
Steve
PS:
> Why are you asking this question here?
One sticking point for Matlab users is abandoning Matlab's text
editor. Currently, Octave doesn't exactly have a GUI equivalent.
Personally, I get by fine (I think better) running Octave in
terminals, using Vim as my primary text editor. But this doesn't
appeal to everyone.
Starting the thread here, I think, is appropriate since it falls
in the category of helping Matlab users become GNU Octave users.
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web:
http://www.octave.orgHow to fund new projects:
http://www.octave.org/funding.htmlSubscription information:
http://www.octave.org/archive.html-------------------------------------------------------------