vim | ctrl-s mapping does not work

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

vim | ctrl-s mapping does not work

Prasad Chandrasekaran

Hi,

I am using vim (ubuntu/gnome) for some time. I tried to make a mapping for using CTRL-S to save a file

nmap <c-s> :w<CR>
imap <c-s> <Esc>:w<CR>a

But this mapping does not seem to work. I have searched for answers but they usually involve windows related stuff. None of the other mappngs(in .vimrc) seem to interfere with this. The above mapping works for CTRL-A. I see this problem in gnome-terminal (both with & without screen)

Does anybody have a clue or idea as to whar could possibly be making the CTRL-S not work.

Thanks.

vox



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: vim | ctrl-s mapping does not work

Tim Chase

> I am using vim (ubuntu/gnome) for some time. I tried to make a mapping for
> using CTRL-S to save a file
>
> nmap <c-s> :w<CR>
> imap <c-s> <Esc>:w<CR>a
>
> But this mapping does not seem to work.

Control+S and Control+Q are flow-control characters.  You'll have
to disable them in your terminal settings.  I believe you can use

   bash$ stty -ixon -ixoff

which will allow Vim to see them without being intercepted by
your console/terminal program.

-tim



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

RE: vim | ctrl-s mapping does not work

JohnBeckett
In reply to this post by Prasad Chandrasekaran

Prasad Chandrasekaran wrote:
> I am using vim (ubuntu/gnome) for some time. I tried to make
> a mapping for using CTRL-S to save a file
>
> nmap <c-s> :w<CR>
> imap <c-s> <Esc>:w<CR>a

Google something like: xon xoff linux

Ctrl-s and Ctrl-q have an historical usage still seen in many
terminals/consoles. Someone might give more precise info on how
to disable it, but above is probably the problem.

John


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---