On gvim I can used

imap <C-s> <ESC>:w
imap <C-c> and etc...

But I cant on vim (terminal) used the imap? How can i use the some imap on the terminal?

link|improve this question
Are you having problems with all Control-key mappings, or just some? – Heptite Dec 31 '10 at 8:21
feedback

1 Answer

up vote 3 down vote accepted

The imap command works fine in a terminal. The problem is that a terminal treats some control characters specially, using them to control terminal behavior, and does not forward those characters to the application running in the terminal. Ctrl-S and Ctrl-Q are normally used for flow control. Ctrl-C normally causes an INTR (interrupt) signal to be sent to the application.

Applications can tell the terminal to not treat certain characters specially and to forward them instead. Vim handles Ctrl-C itself and you should be able to imap it. (I just tried it and it worked for me.) Vim does not tell the terminal to forward Ctrl-S and Ctrl-Q, however, so you would have to tell the terminal to do that yourself. One way is to execute this command at the shell prompt before running vim:

stty -ixon
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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