Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Same. Been using vi as my primary command-line editor for 25+ years, and have never used the ESC key, and just use the default setup.

I don't even know what commands would use the ESC key?



ESC key is the default in vim, most vim users do use it.


Thanks for some sanity.

The other anecdote is I've been using vim for about 15 years, and use esc daily. I am constantly in multiple vim environments - different servers, different clients, different OS, etc. I don't have the luxury of saying "I'm going to install all my default vim keybindings and plugins on every vim installation I ever use". Walking someone else over the phone who has to do vim - I need to count on some standard defaults being there, and 'esc' is one.

So yeah - some of you "power users" - fine - you've never touched ESC in 20 years - good for you. You're in the minority.


There are several built-in ways to get from insert mode to normal mode in vim, only one of which has now been removed.

Vim users that use escape to leave insert mode are not exactly a majority of Mac users. Also, many people have been complaining about the location of Escape for such an important command. http://stackoverflow.com/questions/4416512/why-use-esc-in-vi...

Having said that, I use Escape myself in Vim - you know what? I'll adapt.

This has nothing to do with the new MBP being unsuitable for developers. This is about power users being forced to abandon ingrained habits.


I've been using vi for over 20 years, but not a power user or anything (emacs for code, vi for quick edits), and have no idea how to use it without esc. Did vim change something? How do you switch modes?


Ctrl-[ == Esc. I had to learn Ctrl-[ three years or so back due to bluetooth keyboard paired with tablet and insufficient time to troubleshoot why Esc wasn't working, and then discovered that it's actually easier on my wrists to use Ctrl-[ and never went back.


You don't need to customize your vim keybindings if you map Caps Lock to ESC at the OS level, which is a builtin preference as of macOS 10.12.1.


I'd have to say that your use case is in the minority too.


just matching anecdote for anecdote...


Isn't ctrl-[ default on vim too ?


No, it's just a property of ASCII that (ctrl [) = (0x9f & 0x5b) = 0x1b = esc.


I use vim, I just assumed that when you open Terminal, a virtual escape key would appear in the touch bar. It'd still be in the corner, so fitts law would still apply, and it'd be easy to find.


Yes, this is what I assumed too. Is there any proof that this isn't the case? I'm not sure what the worry is about.


For what commands? I'm trying to look up vim commands that would use the ESC key, and I only see one: https://www.fprintf.net/vimCheatSheet.html#select http://tnerual.eriogerg.free.fr/vimqrc.html

I'm not even a power user, & after 25 years, I just know the basic few commands that you need to do anything - insert, delete, search/replace, save, & quit.

I feel like I'm taking crazy pills!


ESC is the key that (roughly) takes you back to normal mode from insert mode, visual mode, etc. If you aren't using it, then you're either using one of the other ways to get back to normal mode (like CTRL-[), or you are using Vi in a very non-standard way.

See, for example: https://en.wikipedia.org/wiki/Vi#Interface


To switch modes from insert back to normal mode. I assumed ESC was the second key any Vim user used, just after `i`.


From the docs: http://vimdoc.sourceforge.net/htmldoc/insert.html#i_%3CEsc%3...

End insert or Replace mode, go back to Normal mode. Finish abbreviation.

Note: If your <Esc> key is hard to hit on your keyboard, train yourself to use CTRL-[.


Are you talking about the same editor? From a 1996 vi man page [0]:

  There are commands that switch you into input mode.
  There is only one key that takes you out of input mode,
  and that is the <escape> key. (Key names are written
  using less-than and greater-than signs, e.g. <escape>
  means the ``escape'' key, usually labeled ``esc'' on
  your terminal's keyboard.)  If you're	ever confused 
  as to which mode you're in, keep entering the <escape>
  key until vi beeps at you.
[0] http://www.sbras.ru/cgi-bin/www/unix_help/unix-man?vi


Ctrl-[ == Esc.

I'm a happy user of http://ex-vi.sf.net/ and can confirm that, since it's the exact same key code, it works -fine-.


That alternative doesn't work in many programs that use vim keybindings. Ctrl-c doesn't usually work as an alternative outside of vim either.


That's only true for a terminal. Programs built on electron don't behave the same way with vim emulation plugins.


Map Caps-Lock to Esc?


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. :)


The usual answer is 'C-[' or 'kj' (having added the appropriate line to your .vimrc).


Which 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.


It's also difficult when using programs that emulate Vim's keybindings, because they tend to only use ESC by default.


C-[ is available by default; it's the actual control sequence sent by escape in many terminals.


CTRL-[ (of course if you're not using a QWERTY keyboard, it may be hard to hit)


I 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.


I 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".


I have `jk` mapped to that in my vimrc. It's far nicer than ESC.


I 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....


I have 'jj' mapped to ESC.


Ah, I see. I didn't even consider that a function command.

I was expecting more commands to use the ESC key?


Yeah, 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?


Yes. 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: