[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Identification string for Octave script detection in VIM
From: |
Luke M |
Subject: |
Re: Identification string for Octave script detection in VIM |
Date: |
Mon, 16 Apr 2012 12:11:16 -0700 (PDT) |
Júlio Hoffimann wrote
>
> Updating...
>
> The flag idea is being discussed again, some VIM devs think Octave/MATLAB
> should be handled such as LaTeX/ConTeXt, that is, an additional flag for
> setting the preference. For enable Octave keywords the user would have to
> add "let b:matlab_flavor='octave'" to his .vimrc.
>
> Good night,
> Júlio.
>
Since I'm a vim and Octave user I suppose I'll chime in so you have some
more responses.
Firstly, I'm perfectly fine with this manual solution. I tend to write
Matlab-compatible code, and anytime I use Octave I'm usually on a machine
that doesn't have Matlab (so my vimrc sets the filetype to Octave for all
*.m files) and vice versa. If a vim user has to work with both at the same
time and switch back and forth, I expect he would map a key combination to
switch between them as Mike said.
But about auto-detect, does vim detect the comment symbol in a file? If so
it seems like a basic attempt at auto-detecting Octave files (if extension
is '*.m' and comment symbol is '#') might be nice to have. And maybe check
for #!*octave* on the first line.
Other than that I don't think it's worth the effort to develop something
fancier. I seriously doubt anyone will adopt the convention to begin or end
all files with a special comment just for vim users. I agree with Gary's
comment on the vim mailing list:
> Or, if you're having to put a special string in the file just for
> Vim, why not make it "vim: ft=octave"?
--
View this message in context:
http://octave.1599824.n4.nabble.com/Identification-string-for-Octave-script-detection-in-VIM-tp4559375p4562432.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.
Re: Identification string for Octave script detection in VIM, Jordi Gutiérrez Hermoso, 2012/04/17