Re: clearing search buffer in vim
On Sun, May 25, 2003 at 12:25:04AM -0400, Nori Heikkinen wrote:
> on Mon, 12 May 2003 12:35:18AM -0400, Nori Heikkinen insinuated:
> > on Mon, 12 May 2003 03:00:22AM +0200, Michael Naumann insinuated:
> > > Besides, :noh doesn't mess up your search-history. And ... you
> > > can map it to a single key-stroke.
> >
> > oo, even better! :)
>
> recapping: i wanted to map the :noh command in vim to a single
> keystroke. so i mapped it to 'H'. i just remembered today that
> that's the "go to the top of the screen" letter. how can i map it to
> ctrl+h intsead? i can't find out how to do it in the manpages /
> /usr/share/doc pages ...
':h :map', page up and you'll see a link describing "<> notation".
Follow that (or type ':h <>') and you'll see how to type lots of special
characters into key mappings. In this case:
:map <C-h> :noh<CR>
... should work, although I haven't tested it.
The vim help system is *fantastic*, possibly one of the most
comprehensive documentation systems for any piece of free software (or
indeed software) I've used. It seems to be available in
/usr/share/doc/vim/html now as well, although I prefer having it right
there in the editor.
Cheers,
--
Colin Watson [cjwatson@flatline.org.uk]
Reply to: