6 ms·
What key do you press in Vim more often than any other? Esc! Not on the home row (although I'm sure you'll say you remap it to tab).
by Touche 12y ago
What key do you press in Vim more often than any other? Esc! Not on the home row (although I'm sure you'll say you remap it to tab).
- vitalique 12y agoIf you remap Esc to jk you don't even have to lift your fingers.
- Touche 12y agoWhat is jk?
- vitalique 12y agoJust key 'j' followed by 'k'. I have this in my vimrc for quickly jumping out of insert mode: inoremap jk <ESC>
- Touche 12y agoTo each his own. I'm very fluid with my esc key hitting. I find it to be a very satisfying motion.
- sozforex 12y agoimap jk <Esc> In insert mode. First press j, in the same second press k.
- vacri 12y agoAnother common one is Capslock.
- vutekst 12y agoMapping capslock to be esc is what made vim possible for me.
- calvins 12y agoAgreed. I don't know how anybody could use vi with escape unmapped. It's also very useful outside vi though, since esc is the default 'cancel' key in many cases. For example, most browser dialogs (and keyboard-navigable menus) can be closed with esc, and it works for many desktop dialogs too (at least on Linux).
- splawn 12y agoIm too lazy to move two fingers for that, instead mine is mapped to jj. =P
- adlpz 12y agoRemap to tab? Insanity! I remap it to Caps Lock of course.
- Touche 12y agoAh, right, I forgot what the common remap was, thought I'd get that wrong, thanks for the correction.
- Crito 12y agoThe more common remap is probably capslock->ctrl, for both vim and emacs users, I but I definitely prefer capslock->escape. During normal operation, my left pinky rides the gap between a and escape(aka capslock). Pressing either requires the slightest of deflections to the left or right. I keep escape as escape as well. Capslock is absolutely worthless to me.
- delackner 12y agoOr use PCKeyboardhack and I forget the other plugin but on a Mac, I have a brief caps lock mapped as esc, but holding it is control. it works effortlessley.
- Crito 12y agoOn my chromebook pixel, there is a super/windows key (labeled as a "search" key) where the capslock normally is on a US keyboard. Since I use super as the prefix key for all of my window manager shortcuts, I use xcape (https://github.com/alols/xcape https://github.com/alols/xcape) to allow that key to function both as super (if I hold it down) and as escape (if I tap it). These sort of systems are a great way to remap keys; I wish such remapping was exposed by operating systems in a nice stock way.
- graywh 12y agoWhere the Tab key is now is where the Escape key was on the system Bill Joy developed Vi.
- lepton 12y agoEsc is also C-[, and if you've mapped Control to the home row (eg, swapped with CapsLock) then it's not so bad either.
- dozzie 12y agoEsc? Not quite. C-c mostly. It differs sometimes from Esc, but rarely enough for me not to care.
- tomsthumb 12y agoI haven't pressed the escape button in the past few years using vim. Do something like `imap lkj <ESC>` and `vmap lkj <ESC>`. It's way nicer.