osa1
osa1

Reputation: 7078

Disable syntax highlighting, but only for one filetype

I want to disable syntax highlighting for a particular programming language. I'm currently using this

au FileType foo    syntax off

however this has the problem that it disables syntax highlighting for any new buffers that I open in the same window, even when they have different filetypes. Is it possible to disable syntax highlighting only for this filetype? (e.g. any other buffers in the same window that has different filetype should have syntax highlighting enabled)

One of the things that could solve this problem is to create a syntax/foo.vim file that doesn't highlight anything, but I'm not sure how to implement this when foo is one of the languages that vim highlights by default.

Upvotes: 2

Views: 819

Answers (1)

Jim Stewart
Jim Stewart

Reputation: 17323

au FileType foo setlocal syntax=OFF

If you want to isolate the config a bit, create a file called ~/.vim/after/ftplugin/foo.vim and put this in it:

setlocal syntax=OFF

Upvotes: 2

Related Questions