Question

I'm almost certain that someone else has also had this question, and this may be a repeat, but I'm not sure what to call a command like <C-L> and so I haven't had any luck finding an existing question. If this is a duplicate, please redirect me.

The question arises from a vimrc section that reads like this:

" Map <C-L> (redraw screen) to also turn off search highlighting until the
" next search
nnoremap <C-L> :nohl<CR><C-L>

So what combination of keys do I press (in which mode) to input a <C-L> mapping?

Was it helpful?

Solution

in this line:

nnoremap <C-L> :nohl<CR><C-L>

nnoremap means normal no-recursive map <C-L>... which means, if you press ctrl + l in NORMAL mode, the mapped key-strokes would be applied.

<C-L> means ctrl + l

if you type

:h control

you can see the keycodes:

<C-...>     control-key         *control* *ctrl* *<C-*

OTHER TIPS

The capital "C" character in <C-L> represents the control key while the capital "L" character represents a "L" character. So pressing Ctrl+L in normal mode should invoke the mapping.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top