Re: Searching limited to syntax groups

2017-07-18 Thread Tim Chase
On 2017-07-18 15:47, David Fishburn wrote:
> http://www.vim.org/scripts/script.php?script_id=848

Excellent...I look forward to experimenting with it.  Thanks!

-tim


-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Searching limited to syntax groups

2017-07-18 Thread David Fishburn
On Tue, Jul 18, 2017 at 1:01 PM, 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.
>
> Anything obvious I overlooked, or does this require deeper scripting
> with search() and then sniffing the resulting SynID value?
>
>
>
I wrote this plugin to address this feature:

SrchRplcHiGrp.vim : Search and/or replace based on a syntax highlight group
http://www.vim.org/scripts/script.php?script_id=848


It supports the 3 types of visual modes (linewise, block and character).

You can either search for something in the correct highlight group, or you
can do search and replaces on those same searches.

The web page has examples of usage.

If you run into something it can't do, I am always open to suggestions.

Enjoy.
David

-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Searching limited to syntax groups

2017-07-18 Thread Christian Brabandt

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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.