I want to disable syntax highlighting but only for a specific buffer. I tried using modeline at the end of the buffer:
#vim:syntax off:
and
#vim:set syntax=off:
But it is not working.
You need a space (minimally) between the comment symbols and vim for mode lines to be parsed. The first one is also missing an equals sign.
# vim:syntax=off:
Or
# vim:set syntax=off:
If you look at :h modeline
you will see that there can be any leading text before vim: but there needs to be whitespace after that text.
The two forms fix the patterns
[text]{white}{vi:|vim:|ex:}[white]{options}
[text] any text or empty
{white} at least one blank character (<Space> or <Tab>)
{vi:|vim:|ex:} the string "vi:", "vim:" or "ex:"
[white] optional white space
{options} a list of option settings, separated with white space
or ':', where each part between ':' is the argument
for a ":set" command (can be empty)
Or
[text]{white}{vi:|vim:|Vim:|ex:}[white]se[t] {options}:[text]
[text] any text or empty
{white} at least one blank character (<Space> or <Tab>)
{vi:|vim:|Vim:|ex:} the string "vi:", "vim:", "Vim:" or "ex:"
[white] optional white space
se[t] the string "set " or "se " (note the space); When
"Vim" is used it must be "set".
{options} a list of options, separated with white space, which
is the argument for a ":set" command
: a colon
[text] any text or empty
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With