Tuesday, April 1, 2014

RE: "local hlsearch"

meino wrote:
> I often use a search'n'replace on an area, which is limited by
> a previously selected visual block.
> Additional hlsearch is on by default.
> After the searech'n'replace has ended, the found places are
> marked all over the whole text.
> This is often irritating to me.
> Is there a way to limit the highlights set by hlsearch to
> those place of the visual block area?

As the other reply said, map a key to turn highlights off. See:
http://vim.wikia.com/wiki/Highlight_all_search_pattern_matches

However, while not really helpful for what you asked, it is
possible to limit highlights to the last visually selected
block. See:
http://vim.wikia.com/wiki/Search_and_replace_in_a_visual_selection

For example, consider these two searches:
/[abc]
/\%V[abc]

The first finds all a or b or c, everywhere.

The second finds the same, but only in the last visual
selection (what would be highlighted if gv were used).

John


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