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