Monday, August 28, 2017

Controlling the display of a syntax highlighting group

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 have not found a way to test the state of this
group, and once activated, I cannot seem to clear or edit the highlight
definition non-destructively.

Any pointers?

[P.S.:  I originally sent this to <vim@vim.org> which is the address listed
on the official Vim mailing list page, but it never showed up.  Is that still
valid, or must vim_use@googlegroups.com now be used?]

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

Post a Comment