Tuesday, July 18, 2017

Re: Searching limited to syntax groups

On Di, 18 Jul 2017, Tim Chase wrote:

> My digging hasn't been able to turn up anything, but I was hoping for
> something that would let me easily search just code or comments to
> the exclusion of the other. Something like (imaging a sequence like
> "\%syntax{SyntaxID}" but actual flavor/implementation is negotiable)
>
> /\%syntax{Comment}customer\c
>
> to only search my comments for "customer\c", excluding all of the
> instances of "customer" in my codebase.

Not currently possible. Years ago, when I started working on Vim this
was one of my first patches. Unfortunately, I lost it.

> Anything obvious I overlooked, or does this require deeper scripting
> with search() and then sniffing the resulting SynID value?

Yes.

Best,
Christian
--
Ein gewöhnlicher Kopf wagt selten etwas Kindisches.
-- Jean Paul

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