Tuesday, 27 August 2013

How to save VIM filetype settings for a file which is being mis-detected?

How to save VIM filetype settings for a file which is being mis-detected?

The Apache config file for my website is named mywebsite.com. Apparently
the extension .com is causing vim to set the wrong file type as dcl which
makes the syntax highlighting wrong as well. All of my other host config
files are correctly identified as Apache files.
I am able to :set filetype=apache and everything looks great but when
after closing vim and coming back to edit the file type is back to dcl
again.
Other than renaming my host config file, is there a solution to this? Is
there a way to make vim remember the filetype of this one particular file?
Or better yet, is there a way to correct this wrong file type detection?

No comments:

Post a Comment