My _vimrc contains the following lines:

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

nmap <c-l> :w<CR>

nmap <c-m> :w<CR>

I try to map control+l to :w, and control+m is the control group.

I open a new file, press ctrl-m, the file saves. I press ctrl-l, the command line shows :update. I press ctrl-shift-l, the file saves.

enter image description here The figure shows the UI after I press ctrl-l. The cursor was on the previous line.

enter image description here I run :map , <C-L> is registered, but I can only trigger it with ctrl-shift-l.

Why does the mapping of ctrl-l fail?

  • 1
    Unless you have a good reason to do otherwise use nnoremap not nmap. What do you see in Insert mode when you type ctrl-q followed by ctrl-l? – B Layer Jan 13 '18 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.