I'm trying to get Ctrl-S to save, but vim doesn't seem to be picking up any mappings with the control character. None of these work:
inoremap <C-S> <Esc>:update<Enter>
map <C-S> <Esc>:update<Enter>
nnoremap <C-S> <Esc>:update<Enter>
What's going on with the control key? How can I fix it?
Edit: The answers here don't work for me.
I tried stty stop ^-
and stty -ixon
, which finally let the signal come through to vim, but the mapping still won't get picked up in insert mode. So now it seems like it's only insert mode that's causing problems.
Other mappings with Ctrl in insert mode also don't work:
inoremap <C-g> <C-O>:update<CR>
Solution: The issue arose because I had set paste
in my vimrc. Removing that line solved the problem. Still not sure why.