views:

39

answers:

1

Hello.

When I useVIMthe syntax highlighting works, except after I return to a buffer using:bdthe highlighting disappears. I can enable it again using:syn on.This problem occurs only for files without an extension. I remember I had to change some settings to get files without an extension to be highlighted in the first place, but I can't remember the details. (I use files without an extension because thegfcommand just works when I do this.) Can anyone help?

Thanks.

A: 

take a look at :h modeline you should be able to set a comment in the file that tells vim what settings to use when you visit that file.

Doon
I didn't know about modeline, so thanks for that info. However, setting comments in the file isn't a good option for me, because they are shared with other people and there are thousands of files. Is there a way to achieve this without resorting to meta-data?
Fish
are you using the filetype plugin? that make help
Doon
I've never heard of it, so I guess not. I use Vim on Cygwin most of the time - if that makes a difference? I've never knowingly used plug-ins in Vim before, but I'll check out filetype when I get some time.
Fish
try adding :filetype on to your rc files (if it isn't already there). It might help (it might not, all my files have extensions..)
Doon