4 ms·
What do you use to get out of insert mode? Like, you've just finished typing some text and want to save and quit, what do you press? EDIT: Thanks for the repli
by geofft 10y ago
What do you use to get out of insert mode? Like, you've just finished typing some text and want to save and quit, what do you press?
EDIT: Thanks for the replies, other people. I personally use ^C, I was curious what 'mozumder specifically used. :)
- mozumder 10y agoAh, I see. I didn't even consider that a function command. I was expecting more commands to use the ESC key?
- geofft 10y agoYeah, I'm not sure I'd even call it a command - but it is pretty fundamental to vi usage, unless you're using some alternative like ^C or the "remap typing 'jk' to Esc" trick. When you're saying you've never used the Esc key, you mean you only use the Esc key to take you out of insert mode, I guess?
- mozumder 10y agoYes. I do use ESC that to exit insert mode. Sorry for any confusion. I was expecting commands to be anything you did after the typing in colon.
- falcolas 10y agoThe usual answer is 'C-[' or 'kj' (having added the appropriate line to your .vimrc).
- eeeeeeeeeeeee 10y agoWhich is fine if you do everything locally (because you control that configuration), but not having escape really sucks when you are on servers a lot and you can't necessarily go changing vim settings around.
- palunon 10y agoCTRL-[ (of course if you're not using a QWERTY keyboard, it may be hard to hit)
- biot 10y agoI don't know why that would be anyone's preference given that if you used telnet to connect to a remote shell, ^] is the default escape character. So using ^[ to exit input mode is dangerously close to popping you out of your telnet session. Someone who claims to have used vi for 25+ years (get off my lawn, ssh didn't exist back then) would have likely used telnet and been bitten by that more than once.
- mst 10y agoI didn't switch to Ctrl-[ until sufficiently recently that anything I'm running vi-ish things on is over ssh. I will, however, never forgive Excel for Esc being "abandon edit".
- messe 10y agoI have `jk` mapped to that in my vimrc. It's far nicer than ESC.
- greendragon 10y agoI love jk, been using that one for at least 8 years. I even got in the habit of tapping it a few times while thinking, sort of like how you might sometimes shake your leg or whatever. I trained myself off of that though when I had to use Eclipse more and more -- edits or undoes to a file can bring Eclipse to its knees....
- pjonesdotca 10y agoI have 'jj' mapped to ESC.