Exiting after pressing Ctrl-X Ctrl-S

27,576 views
Skip to first unread message

TheLonelyStar

unread,
Jun 4, 2009, 4:30:11 AM6/4/09
to vim...@googlegroups.com

Hi,

I come from emacs.
When I want to save my file, I am used to press Ctrl-X Ctrl-S

When in vim, in insert mode, pressing Ctrl-X goes into a special mode from
which I can exit using any keystroke.
But not if I pressed Ctrl-S aftwerwards.
When I press Ctrl-X Ctrl-S, my vim is stuck and I have no Idea how to get
out of that mode ...

Any help?
Thanks!
Nathan
--
View this message in context: http://www.nabble.com/Exiting-after-pressing-Ctrl-X-Ctrl-S-tp23865824p23865824.html
Sent from the Vim - General mailing list archive at Nabble.com.

pansz

unread,
Jun 4, 2009, 4:46:52 AM6/4/09
to vim...@googlegroups.com
TheLonelyStar 写道:

> I come from emacs.
> When I want to save my file, I am used to press Ctrl-X Ctrl-S
>
> When in vim, in insert mode, pressing Ctrl-X goes into a special mode from
> which I can exit using any keystroke.
> But not if I pressed Ctrl-S aftwerwards.
> When I press Ctrl-X Ctrl-S, my vim is stuck and I have no Idea how to get
> out of that mode ...
>

If you use gvim there won't be any problem for Ctrl-S.

If you use console vim it does not use Ctrl-S at all, since Ctrl-S are
reserved for terminal flow control. For compatibility reasons, you
should not use Ctrl-S as shortcut for any console application.

Raúl Núñez de Arenas Coronado

unread,
Jun 4, 2009, 4:48:23 AM6/4/09
to vim...@googlegroups.com
Saluton TheLonelyStar :)

On Thu 4 Jun 2009 10:30 +0200, TheLonelyStar <n...@lonely-star.org> dixit:


> When in vim, in insert mode, pressing Ctrl-X goes into a special mode from
> which I can exit using any keystroke.

You enter "completion mode" (":help ins-completion"). You should see
"^X mode (<a lot of keys here>)" in the bottom of your screen. For
exiting that mode you have to press any invalid key in that context. Any
character should work, because completion commands are all preceded by
"Ctrl". See the help for details, but as you have discovered, it is not
a "mode", but a command, so you can keep on typing.

> But not if I pressed Ctrl-S aftwerwards. When I press Ctrl-X Ctrl-S,
> my vim is stuck and I have no Idea how to get out of that mode ...

In that case you are not entering another mode, but you are requesting
"stop flow control" to the terminal. This is not a Vim thing, it's a
terminal thing. To resume flow control use "Ctrl-Q".

I don't know if you are using console or GUI Vim, and I don't know what
terminal or emulator do you use, or what platform are you using Vim on,
so the above may be wrong... I was assuming console Vim on UNIX terminal
or terminal emulator, although some terminal emulators no longer use
flow control.

--
Raúl "DervishD" Núñez de Arenas Coronado
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!

TheLonelyStar

unread,
Jun 4, 2009, 4:50:00 AM6/4/09
to vim...@googlegroups.com

I do not want to use it, I sometimes press it by accident (Ctrl-X Ctrl-S).
And it hangs my vim :(
--
View this message in context: http://www.nabble.com/Exiting-after-pressing-Ctrl-X-Ctrl-S-tp23865824p23866099.html

bill lam

unread,
Jun 4, 2009, 4:51:06 AM6/4/09
to vim...@googlegroups.com
On Thu, 04 Jun 2009, TheLonelyStar wrote:
> When I press Ctrl-X Ctrl-S, my vim is stuck and I have no Idea how to get
> out of that mode ...

try ctrl-q

--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
唐詩220 溫庭筠 蘇武廟
蘇武魂銷漢使前 古祠高樹兩茫然 雲邊雁斷胡天月 隴上羊歸塞草煙
迴日樓臺非甲帳 去時冠劍是丁年 茂陵不見封侯印 空向秋波哭逝川

Christian Brabandt

unread,
Jun 4, 2009, 11:58:03 AM6/4/09
to vim...@googlegroups.com
Hi TheLonelyStar!

On Do, 04 Jun 2009, TheLonelyStar wrote:

>
>
> I do not want to use it, I sometimes press it by accident (Ctrl-X Ctrl-S).
> And it hangs my vim :(
>

you can disable sending Flow Controll using stty (at least on linux).

e.g. stty stop undef

regards,
Christian
--
:wq!

Matt Wozniski

unread,
Jun 4, 2009, 9:28:57 PM6/4/09
to vim...@googlegroups.com

Instead of undefining stop, it's a little cleaner to do "stty -ixon" -
that way, it's one command to turn off flow control for ^S and ^Q, and
one command to re-enable it (if for some reason you should ever want
to).

~Matt

曲健

unread,
Jun 21, 2013, 2:29:13 AM6/21/13
to vim...@googlegroups.com, cbil...@gmail.com
thanks bill, i fixed it!
Reply all
Reply to author
Forward
0 new messages