Sunday, July 3, 2011

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

On 07/03/2011 08:11 AM, Tim Chase wrote:
> On 07/03/2011 02:18 AM, meino.cramer@gmx.de wrote:
>
>
>> map<f5> :nohlsearch<CR>
>
> Since I don't use it often, I don't map it, but Vim does allow
> you to be lazy and just type
>
> :noh
>
> to get the same effect. However, if you regularly want to
> turn it off temporarily, Meino's mapping will do the trick.

I remap CTRL-L (which normally redraws the screen) to first turn
off highlighting and then chain to the original behavior, as
follows:

nnoremap <silent> <C-L> :nohlsearch<CR><C-L>

I like that it doesn't cost me a mappable key sequence, and it
seems to preserve the spirit of the original CTRL-L ("clean up
the screen"). It's also easy enough to get back the
highlighting by pressing "n" (for example).

Michael Henry

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