TransWikia.com

Turn syntax off only for current buffer/window?

Vi and Vim Asked by First User on January 30, 2021

Is there a way to turn off syntax for only the current buffer/split windows? like for example, you can set map <buffer> or setlocal. Is there something similar for the syntax option ?

I use the :diffsplit command in vim quite a bit, for which I prefer to disable syntax and but this turns off highlighting for all buffers. I am using the following settings :

" turn off syntax when started from terminal
if &diff 
    syntax off
endif 
" turn off syntax when started from inside vim 
au OptionSet diff syntax off

One Answer

Buffers and windows are different things.

To clear syntax for a particular buffer you can set the syntax option to empty string (or even simply do :syntax clear which should be the same for most purposes).

To clear syntax in a particular window you could use :ownsyntax off.

Answered by Matt on January 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP