0

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?

Greg Nisbet
  • 1,839
  • 14
  • 27
  • This question has been asked many times, and is basically a duplicate of https://vi.stackexchange.com/questions/2419/mapping-ctrls-does-not-work/2425#2425. 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 Oct 15 '17 at 21:35

1 Answers1

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 */
Mass
  • 14,080
  • 1
  • 22
  • 47