Monday, May 5, 2014

Re: disable syntax highlighting for a section

On Mon, May 5, 2014 at 10:28 AM, Christian Brabandt <cblists@256bit.org> wrote:
> Am 2014-05-02 23:46, schrieb shawn wilson:
>
>> Sometimes (especially in documentation) syntax highlighting really
>> messes up. However, I don't really want to highlight documentation
>> anyway, so can I disable it per line?
>>
>> So, basically, what I want is to be able to select a block and say,
>> don't do anything from within this block (and maybe have it set a mark
>> or something so that I can insert stuff in the middle and it won't
>> mess with new text)?
>

> As for your original problem, read the help at :h :syn-sync and see if you
> can
> manually resync the syntax engine, if you notice wrong behaviour. I assume,
> you only experience this for a specific filetype

Yeah, md (markdown) and pod iirc (perl). But when it happens, I'm not
caring about handling it properly :)
I might go back for the commit bit, but not when vim is messing with me.

>
> Nevertheless, you can trick the syntax engine to stop highlighting specific
> lines. This is rather hacky approach, but it should work. You would add some
> specific syntax matches, that link to a not-defined syntax group and
> use a pattern with the \%l line matching.

Thanks for that. It seems to do what I want.

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