Monday, August 28, 2017

Re: Controlling the display of a syntax highlighting group

On Monday, August 28, 2017 at 8:52:16 PM UTC-5, cjsmall wrote:
> To find non-ascii characters in a file, I have defined the following:
>
>
>     syntax match nonascii "[^\x00-\x7F]"
>     highlight nonascii ctermbg=13
>
>
>
> I can disable this with the command:
>
>
>     syntax off
>
>
> I would like to create a command that toggles this highlight group on/off and
> hopefully do so without affecting the current state of the remainder of the
> syntax highlight groups. 

I suggest using the matchadd()/matchdelete() functions for this purpose, unless there is a specific reason you need to use syntax matching. Those are more "temporary" and easy to toggle.

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: