> I'm running vim in a console using gnome-terminal. I put these
> mappings in my .vimrc file:
> 
> map <c-q> :mksession! ~/.vim/.session <cr>
> map <c-s> :source ~/.vim/.session <cr>
> 
> Pressing those buttons (CTRL+Q or CTRL+S) doesn't work. When I map as
> below instead:
> 
> map <F9> :mksession! ~/.vim/.session <cr>
> map <F10> :source ~/.vim/.session <cr>
> 
> the commands work.
> 
> What is causing this behavior? Is it the terminal capturing the CTRL+Q
> and CTRL+S keystrokes before they reach VIM?

Yes, the ^S and ^Q keystrokes are flow-control characters.  I
don't have Gnome-term on hand, but it works much the same in
other terminal emulators (xterm, rxvt, etc).  Control+S is the
"hey, stop sending stuff to this terminal until I have a chance
to catch up" character, and Control+Q is the "okay, I've caught
up, you can start sending stuff to my terminal again" character.

The terminal software may catch these before Vim gets a chance to
see them.  You might poke around in your GT settings for a
setting like "flow control" or "XON/XOFF" and try to disable
that.  It's not like your terminal runs on an 8-bit processor
with 16 bytes of buffer for your serial-I/O terminal any more
where a speedy 2400-baud modem might overwhelm your terminal's
ability to draw on the screen. ;)

-tim



Reply via email to