I have tried several things to set the keybinding Ctrl+Q to exit Vim without saving any changes (i.e., what is normally bound to :qa!
). I have tried adding:
inoremap <C-q> <esc>:qa!<cr> " quit discarding changes
nnoremap <C-q> :qa!<cr>
to my ~/.vimrc
based on this answer on Unix & Linux StackExchange. This failed as when I pressed Ctrl+Q nothing happened. I have also tried:
map <C-Q> :qa!
and:
map <C-Q> ":qa!
neither worked. Any ideas what I need to do to set this keybinding? If it is at all relevant my platform is Fedora 25 and I installed the latest Vim from my own Open Build Service repository — https://build.opensuse.org/package/show/home:fusion809/vim-redhat.
i<C-v><C-q>
? If nothing shows up, it's something with your terminal.i
starts insert mode in Vim, so I must admit I'm confused what you're expecting <C-v><C-q> will do afterwards. <C-v> is bound in my~/.vimrc
to paste.<C-v>
allows you to insert a literal character with no side effects. It's just a nice way to test whether or not the keystroke ever gets to vim in the first place<C-q>
in gvim too with those edits to my Vimrc and it still doesn't quit Vim so it's not due to my terminal that this keybinding doesn't work.