Simon Ruderich wrote:
On Fri, Mar 18, 2011 at 01:12:44PM +0100, Marco wrote:
When often edit files where the filetype detection fails. The files are
detected as »conf« instead of »gnuplot« for instance. I can set ft=gnuplot,
but when I switch to another buffer and switch back, it falls back to »conf«,
including the wrong syntax highlighting.

How can I make vim remember my manually input file type?

Marco
Vim doesn't remember the file type. When you open a file it
checks if the file matches certain criteria and then sets the
file type (:h filetype for more information).

You can fix this by either writing special rules to detect
gnuplot files (by having a look at the content) or by using the
correct extension (.gpi for gnuplot) which Vim can detect.

You can use a different extension of course by adding this to
your vimrc:

     au BufNewFile,BufRead *.extension-here setf gnuplot

Regards,
Simon
As you say! Perhaps the logic that classifies a file as 'gnuplot'   in
'filetype.vim' maintained by Bram Moolenaar, last change Jul 30 2010
needs to be updated so that it more correctly classifies gnuplot files.
 The line(s) in filetype.vim which check and set ft=gnuplot
are:
  751 " Gnuplot scripts
  752 au BufNewFile,BufRead *.gpi            setf gnuplot
I'm sure that Bram will be glad to receive suggestions.

--
You received this message from the "vim_use" 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

Reply via email to