Monday, July 4, 2011

Re: How can I disable search highlighting after I use search for delete {motion}?

Thanks for everybody's response!

Yes, I can use combination of other motion such as d<n>(t|f), ... but
in some situations, I think searching is the most intuitive way to
tell vim what I want to do.

The remapping of 'Ctrl-L' sounds the best solution to me. I will
follow this. An 'Ctrl-L' after search is a bit of extra work, but the
situations where only searching works do not occur much, so it is fine
to me.

On Jul 3, 9:24 pm, hsitz <hes...@gmail.com> wrote:
> On Jul 2, 10:46 pm, Xiaopan Zhang <zhangxiao...@gmail.com> wrote:
>
> > I can use the following key strokes 'd/_variable + 7<CR>', will does
> > the job precisely, However, one problem is that after the deletion,
> > '_variable + 7' will be highlighted if it occurs in other places in
> > the same file, which is undesirable.
>
> > Does anybody have solution to this annoying problem?
>
> You can just clear the search register, which will also clear out all
> the highlighting:
>
> :let @/=''
>
> You map that command to any keystrokes you want and it's a simple
> matter to clear any highlights you don't like, without having to set
> hlsearch to off for the next search.
>
> -- Herb

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

No comments:

Post a Comment