Vim: Difference between revisions

Jump to navigation Jump to search
473 bytes added ,  13 April 2012
A better GNU Octave syntax file
(VIM as the default editor)
(A better GNU Octave syntax file)
Line 2: Line 2:


If you aren't familiar with VIM script language, you can also use [http://brainacle.com/how-to-write-vim-plugins-with-python.html Python to write VIM plugins]. If you do some for GNU Octave, please let us now.
If you aren't familiar with VIM script language, you can also use [http://brainacle.com/how-to-write-vim-plugins-with-python.html Python to write VIM plugins]. If you do some for GNU Octave, please let us now.
== Accessing GNU Octave info ==
GNU Octave info package can be found in almost all Linux distributions. For installing it under Ubuntu, you can type:
$ sudo apt-get install octave<version>-info
where {{Codeline|<version>}} must be substituted by the appropriate string. Add the following line to your {{Path|~/.vimrc}} file:
autocmd FileType matlab setlocal keywordprg=info\ octave\ --vi-keys\ --index-search
Now, when editing a {{Path|*.m}} file, you can type {{Key|K}} in normal mode and the word under the cursor will be searched for in the GNU Octave documentation index. Pressing {{Key|,}} yields the next occurrence.


== VIM as the default editor ==
== VIM as the default editor ==
Line 26: Line 15:


where {{Codeline|<terminal>}} can be [http://directory.fsf.org/wiki/Gnome-terminal gnome-terminal], [http://directory.fsf.org/wiki/Xterm xterm], or any other terminal of your preference. Please note the {{Codeline|-e}} option is common to the mentioned terminals, change it if necessary.
where {{Codeline|<terminal>}} can be [http://directory.fsf.org/wiki/Gnome-terminal gnome-terminal], [http://directory.fsf.org/wiki/Xterm xterm], or any other terminal of your preference. Please note the {{Codeline|-e}} option is common to the mentioned terminals, change it if necessary.
== A better GNU Octave syntax file ==
As for now, VIM hasn't a dedicated, officially distributed filetype for GNU Octave. The community agreed the best solution is to use [http://www.vim.org/scripts/script.php?script_id=3600 octave.vim] by Rik. All the instructions for installing it can be found on the hyperlink.
== Accessing GNU Octave info ==
GNU Octave info package can be found in almost all Linux distributions. For installing it under Ubuntu, you can type:
$ sudo apt-get install octave<version>-info
where {{Codeline|<version>}} must be substituted by the appropriate string. Add the following line to your {{Path|~/.vimrc}} file:
autocmd FileType matlab setlocal keywordprg=info\ octave\ --vi-keys\ --index-search
Now, when editing a {{Path|*.m}} file, you can type {{Key|K}} in normal mode and the word under the cursor will be searched for in the GNU Octave documentation index. Pressing {{Key|,}} yields the next occurrence.
'''OBS:''' If using the Rik's [http://www.vim.org/scripts/script.php?script_id=3600 octave.vim] syntax, replace {{Codeline|matlab}} by {{Codeline|octave}}.
27

edits

Navigation menu