Sean Lerner wrote:
Hello,

Syntax highlighting with Vim 7 is working for some of my files, but for
others it's not.  They're all for lighttpd config files, but it only works
for one of those files. Why is this?

My situation:
-rw-r--r--  1 root root 2920 Nov 15 19:33 lighttpd.conf
-rw-r--r--  1 root root 2920 Nov 15 22:47 lighttpd.conf.b.old
-rw-r--r--  1 root root 2940 Nov 15 17:40 lighttpd.conf.mem
-rw-r--r--  1 root root 5606 Nov 15 14:52 lighttpd.conf.old     <-- syntax
highlighting works -rw-r--r-- 1 root root 5606 Nov 15 22:53 lighttpd.conf.old.b <-- syntax
highlighting works (copy of light.conf.old)
-rw-r--r--  1 root root 2600 Nov 15 15:06 lighttpd.conf.special
-rw-r--r--  1 root root 2606 Nov 15 16:52 lighttpd.conf.working
-rw-r--r--  1 root root 2933 Nov 15 19:28 lighttpd.conf~

But for the rest of the files, syntax highlighting doesn't work.

Any pointers / tips appreciated.

Sean

Create (if it doesn't yet exist) or add to ~/.vim/filetype.vim (on Unix) or ~/vimfiles/filetype.vim (on Windows) the uncommented lines below:

augroup filetypedetect
" the line above must be first
"
" etc.
"
autocmd BufRead,BufNewFile *.conf* setf conf
"
" etc
"
" the line below must be last
augroup END

Create the directory if it doesn't yet exist; replace conf (after setf) by whatever filetype (such as apache) you want it to be.


Best regards,
Tony.

Reply via email to