I am trying to map Ctrl + q to quit editing the file. I added the below line to my .vimrc
nnoremap <C-q> :execute "q"<CR>
On pressing the above key combination, nothing happens, vim doesn't quit. No Error, no message.
Can you please help me figure out what is wrong with this setting?
EDIT: My vimrc file is https://gist.github.com/mdtareque/9d28c7b63b2b77d15679374a8dfbad20
I see no effect of pressing <C-q>
, probably something is conflicting with existing setup/plugins. Above is my vimrc, almost all settings are being used.
Output of verbose map <C-q>
is Last set from ~/.vimrc
FYI. I am on ubuntu 15.10, and
$ vim -version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 21 2015 12:30:04)
:verbose map <c-q>
tell you?:verbose map <C-q>
I getn <C-Q> * :q<CR>
and then on the next line it says "Last set from ~_vimrc." What does the first line say for you?n <C-Q> * :q<CR>
<C-q>
is a special mapping interpreted by the terminal meaning "continue output" (<C-s>
is "stop output"). The solution is the same as in the duplicate target.