A few editors that expect to be able to use ^S and ^Q themselves (e.g. gnu emacs, jed, mg) disable flow control in the terminal when the program starts, but restore the original setting when the program is suspended or terminates normally.

Is there a way to configure vim to behave the same way?

  • This question has been asked many times, and is basically a duplicate of vi.stackexchange.com/questions/2419/mapping-ctrls-does-not-work/…. However, I have not found the vim source code modification solution mentioned, which is somewhat cleaner if you are able to use it. The solution in the linked answer causes the original shell cursor line to go to the bottom of the screen, which may be undesirable.
    – Mass
    Commented Oct 15, 2017 at 21:35

1 Answer 1


Most likely, the easiest way is to build vim from source with a small modification:

@@ -3416,7 +3416,7 @@ mch_settmode(int tmode)
         * ~ICRNL enables typing ^V^M
-       tnew.c_iflag &= ~ICRNL;
+       tnew.c_iflag &= ~(ICRNL | IXON);
        tnew.c_lflag &= ~(ICANON | ECHO | ISIG | ECHOE
 # if defined(IEXTEN) && !defined(__MINT__)
                    | IEXTEN        /* IEXTEN enables typing ^V on SOLARIS */

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.