Tuesday, August 25, 2015

Re: vim - how to enable searching in vim editor and finding/highlighting pattern that is only in non-commented block/line



On Sun, Aug 23, 2015 at 7:02 PM, 'Annis Monadjem' via vim_use <vim_use@googlegroups.com> wrote:
Hi,

I am looking for a way to search in vim editor and to find text highlighted only for pattern found in non-commented blocks/lines.

...
 
Is there a more productive way of searching/highlighting patterns of text that appear in a file only in non-commented blocks/lines.


Annis,

It depends on what level of functionality you are looking for.

My plugin, 

SrchRplcHiGrp.vim  - Search and Replace based on a highlight group

SR = Search and/or Replace

This plugin defines some commands to allow you to: 
1.  Search for characters with a particular syntax highlight group 
2.  Search and replace characters with a particular syntax highlight group 


Allows you to choose the syntax group for comments and then perform searches that are either contained within that syntax group or outside of that syntax group.

Have a quick look at that plugin page, there is an example at the bottom, where I specifically look for things that are NOT comments.

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

No comments:

Post a Comment