I'm trying to make Ctrl+Q quit vim automatically without saving. I thought this would be a very simple task but am stumped on why it's not working...
I have the two following mappings at the end of my vimrc...
nmap q :q! <Enter>
imap <C-q> <esc>:q!<CR>
but when I press control+q vim toggles visual-block mode instead of quitting. Why? How do I get those keybindings to work?
q
and<ENTER>
for the first instead of<C-q>
and<CR>
?nnoremap
. Control-q is an alternative for visual-block, but you should still be able to override it. Note, however, that (like for C-s) you may have to disable tty pausing, which (afaik) uses those keys. (There’s a magic incantation of sttystty -ixon -ixoff
)