If you happen to use emacs and vim, your muscle memory might from time to time use the shortcuts from one application in the other. At least that's what happens to me.
Personally, I use evil to give emacs modal editing capabilities. Its user interface is modeled after vi(m). So everything is fine on the emacs front.
I do prefer vi's interface to the default emacs interface, so naturally I don't
miss much when using vim. However, there is one short-cut, that I keep hitting
while I'm in vim. And that's emacs' "\
So. The shell to rescue: Let's create a wrapper function ‘vim’, that takes care of disabling flow control for us (handling flow control is a non-issue in gvim):
vim () {
# ‘local’ is not a POSIX sh feature, but if you don't use something
# like zsh, mksh, bash or ksh93 as your interactive shell, I can't
# help you anyway. ;)
local terminal="$(stty -g)"
command stty -ixon
command vim "$@"
command stty "$terminal"
}
Now that that's out of the way, to get the emacs short-cut working in both insert and normal mode, use this:
inoremap <c-x><c-s> <c-o>:w<cr>
noremap <c-x><c-s> :w<cr>
And that's it.
[Update]
This obviously only works if you start vim from your shell. If an application starts the editor, it doesn't care much about the shell function that you defined. To cover these cases as well, you can create a wrapper script, that does what the function does. But the real question is, why vim doesn't disable flow control itself - if not by default, then why is it not an option. (And no, I do not want to disable flow control altogether, because it might come in handy with non-full-screen terminal applications, that generate a lot of output.)