Monday, September 24, 2012

Re: Split windows and syntax highlighting

On Tue, September 25, 2012 03:51, Tony Mechelynck wrote:
> On 24/09/12 19:56, Christian Brabandt wrote:
>> On Mo, 24 Sep 2012, Matthias Pitzl wrote:
>>> Is it somehow possible to do a :syn off only for one specific window?
>> Yes, if you use :setl syntax=off
>
> or just :setl syntax= (with nothing after the = sign)
>
> If by any chance you had downloaded a syntax/off.vim in one of the
> directory trees part of 'runtimepath', ":setl syntax=off" would apply it
> to the current editfile.

Considering, that the advised method of disabling syntax highlighting
in the help is using :set syntax=OFF we should probably prevent loading a
syntax file with the name OFF and handle this in synload.vim (as it is
already done for the value 'ON')

Here is a patch, that does that (and additionally makes the check for
the syntax item ignore case):
--- syntax\synload.vim Tue Sep 25 08:09:53 2012
+++ syntax\synload.vim.new Tue Sep 25 08:09:43 2012
@@ -38,7 +38,7 @@
endif

let s = expand("<amatch>")
- if s == "ON"
+ if s ==? "ON"
" :set syntax=ON
if &filetype == ""
echohl ErrorMsg
@@ -46,6 +46,8 @@
echohl None
endif
let s = &filetype
+ elseif s ==? "OFF"
+ let s = ''
endif

if s != ""


regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment