Hi Bram, Not exactly a superset, both languages have peculiarities. The main point is that Octave tries to maintain the best compatibility as possible with MATLAB, including the file extension (*.m) and comment symbol (%). Although Octave supports other comment symbols (# and the shebang mechanism), they are ignored by the community which prefers to write scripts that both interpreters can execute.
Discussing on IRC, i discovered other languages suffered from the same issue in the past, namely Perl and Prolog have the same file extension and VIM devs solved that by adding an additional flag so the user could switch the preference for one or another on .vimrc. It would be plausible for this case? Perhaps adding the octave.vim to the official distribution, an octave filetype keyword, and an additional flag for switch the preference for *.m files would solve the problem? I really appreciate your reply, Júlio. 2012/4/14 Bram Moolenaar <[email protected]> > > Júlio Hoffimann wrote: > > > I'm a user of the GNU Octave programming language (http://www.gnu.org/ > > software/octave/). It's known as a free alternative to MATLAB. In > > fact, almost all the syntax of the later is supported by Octave, > > except the classdef syntax. > > > > Actually, VIM hasn't a filetype for Octave and we have to use the > > matlab filetype which not recognizes many Octave keywords. There is a > > syntax and OMNIFUNC file for Octave, maintained by an Octave > > developer: http://www.vim.org/scripts/script.php?script_id=3600. It's > > pretty complete. > > > > How could we solve this? It would be straightforward to just create a > > new filetype for octave and make both filetypes (octave,matlab) use > > the same syntax file (octave.vim)? Maybe experienced VIM developers > > could gather the best of the two to make a great syntax file? Sadly, i > > have no enough experience with VIM plugins and filetype detection to > > help solve this by myself. > > Is Octave a superset of Matlab? Then the best is to make Octave syntax > and plugin files, and have them load the matlab files where that makes > sense. > > How can you recognize an Octave files? > > > -- > ARTHUR: I am your king! > WOMAN: Well, I didn't vote for you. > ARTHUR: You don't vote for kings. > WOMAN: Well, 'ow did you become king then? > The Quest for the Holy Grail (Monty > Python) > > /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net > \\\ > /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/\\\ > \\\ an exciting new programming language -- http://www.Zimbu.org > /// > \\\ help me help AIDS victims -- http://ICCF-Holland.org > /// > -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
