My syntax -highlighting is broken for a file which Type is conf as follows:
File where the syntax highlighting does not work
alt text http://files.getdropbox.com/u/175564/bugs/vim-bug-type.png
The syntax highlighting works for all other files with the extension .markdown. However, the only difference between these files is that the other files’ type is nothing, while that of a file, which has bug, its Conf.
File where the syntax highlighting works
alt text http://files.getdropbox.com/u/175564/bugs/vim-bug-syntax2.png
How can you change the Type to nothing from Conf in Vim?
Try:
or (equivalently):
If you want to do it automatically, you’ll need to configure the syntax detection. Create a file (if it doesn’t exist): vimfiles/after/filetype.vim or ~/.vim/after/filetype.vim. In this file, add the following line:
Alternatively, download the markdown syntax from here (I’ve not tried this) and configure with:
For more information:
For information, the problem arises because the
.markdownextension is not recognised, so Vim looks at the contents to try to determine what the file type is. Presumably there is something in your file that looks a little like a configuration file, so it does its best guess. The guess is carried out in the systemfiletype.vim, typically in c:\vim\vim72 or /usr/share/vim/vim72/filetype.vim (I think) and looks like this:This checks whether any of the first five lines start with a
#and if they do and no other filetype has been matched, it sets the filetype toconf.