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

The escape key will be especially welcome by me, as I found the touchbar exceptionally hard to deal with, and I would often have to hit it three or four times to get vim to exit insert mode. I actually didn't have much trouble with the arrow keys, despite all the negative feedback I saw for them online.

Hopefully this trend continues and they can iterate on this model even further.



I remapped caps lock to escape and it's been wonderful. The oversized caps lock key on keyboards is an inexplicably bad UI choice anyway.


This argument as THE SOLUTION really needs to stop. As an example I mapped caps to ctrl a long time ago so this won't work without compromises.


Right? The solution is 'make the fuckin keyboard work'. These are workarounds.

I have twenty... seven, Jesus. Twenty seven years of muscle memory with VI. The only keyboard I can't 'vote with my feet' on is the built-in one on my laptop. As a result I'm hardly ever using my laptop untethered now. I don't think I've ever owned a keyboard I've typed less on than the touchbar macbook. Which means I'm barely using them as laptops, which is a little depressing.


You can use Karbiner to have a short press of caps lock map to escape and a long press to control. Works pretty good.


I almost never use caps lock so I just mapped caps to esc and hold shift for all caps. The no escape thing doesn’t bother me anymore.


Yep - I have mine set to be control if pressed with other keys, and escape if pressed alone. Works for everything except if I'm playing a videogame that uses ctrl to crouch.

Other people argue that all real vimmers use ctrl-[ instead of escape.

Edit: This is on a 2015 macbook pro, that still has the physical function keys. I almost never use the physical escape key, just capslock instead.


Is there a guide on this?


Install Karabiner-Elements. Go to the "complex modifications" tab. Add "Change caps_lock to control if pressed with other keys, to escape if pressed alone".


Thanks mate.


Can you map ctrl to esc?


Personally I find a classic Unix layout to work best for me. I’ve mapped the caps lock key to CTRL. I use that far more than I ever use caps, it feels quite natural to me after about a week or two of adjustment.


You can use Karabiner Elements to configure your Caps Lock to act as Ctrl when held down, and escape when tapped alone. Best of both worlds.


In addition to this you can do something like mapping Shift+Caps Lock to be an actual Caps Lock toggle. Now you get 3 buttons for one and it works amazingly well.


This was a revelation when I discovered it earlier this year. I could never go back now, it’s so convenient.


>The oversized caps lock key on keyboards is an inexplicably bad UI choice anyway.

It's probably largely a relic from typewriters when it was originally something of a mechanical necessity and then made more sense than today in the context of filling out forms etc.


Sun and Apple both used to have control in that spot. It was a sad day when they surrendered to the inferior PC keyboard layout.


I used to have really strong opinions about keyboards. I even still have a Northgate keyboard which was an "improved" version of the original IBM keyboard. (Which largely mirrored the Selectric.)

But TBH, I use so many different systems these days that I pretty much just accept that keyboard layouts and keyboard feel are going to differ from machine to machine and there's no point fussing about it.


I haven't used a laptop, desktop, or other computer (windows/mac/Linux) in the last 15 years in which I didn't immediately configure Caps-Lock to be control within 5-minutes of setting up the system. So, to some degree - it's always been control for me.


FWIW, early PC keyboard layouts had the Control key next to the "A", where God intended it to be, too. (Don't have the link handy, but there was a story posted here on HN in the past week or so about the history of the PC keyboard that showed this...)


True, and as a longtime fan of the IBM Model 'M' that had that configuration and was mechanical and built to last with buckling springs, I'm glad I can get one of these:

https://www.pckeyboard.com/page/product/40PSA


I remapped jk to escape. It’s easily my favorite remap, I don’t even bother with escape on full keyboards/desktops.


That's a bit of a pain if you put that into muscle memory and use other Vi interface software that can't be remapped.

Personally I'm in the Caps to Ctrl and use Ctrl-[ for escape camp. Works in my shell, REPLs and in my database clients and anywhere else with a readline interface that isn't Vim.

Even with that I still want a physical escape key.


how do you type "e_{ijk}"?


jk is a pretty rare combo to begin with, but when you do need it, just hitting j, and pausing for a second takes that input singularly, then you can type k safely. Slightly sub optimal, yes. But the benefits outweigh the negatives for me.


For example by typing: e_{ij<c-v>k}


obligatory xkcd - https://xkcd.com/1172/


I was listening to the Upgrade podcast (from relayfm), the episode that was just released includes an interview with someone from Apple (I think she's the PM for the MBP?)

She specifically mentioned vim users as one of the reasons for bringing back the escape key


This is the link to the podcast if anyone is interested: https://www.relay.fm/upgrade/271


Do you have a timestamp for the vim thing?


~19:50


Thank you


How long ago was "just released"?

Pretty sure Apple employees are locked into heavy NDAs (like many others in tech).


The episode was recorded earlier with Apple's blessing, given the presence of an Apple employee speaking on the record.

The episode was released this morning, after the embargo lifted.


It was released today and that’s Jason Snell’s podcast. The PM was authorized to talk.


Use Ctrl-[ for ESC.

Not only is [ always in the same spot, but you don't have to move your fingers off the normal keys or stretch. I was fortunate that a friend told me about that early on, otherwise I couldn't have handled VI, the stretching is so inconvenient (especially so on those old IBM PS/2 keyboards with cubic keys).


> Not only is [ always in the same spot

Only if it's the same keyboard layout. For instance, on the US layout, [ is immediately to the right of P, while on the ABNT-2 layout, it's two keys to the right of P. Meanwhile, ESC is on the same place (top left of the keyboard) in both.


Personally an Emacs user---I use the esc key loads too. Best thing I ever did was install Karabiner to remap capslock to esc when tapped, and to ctrl when held down. (One meta key to rule them all!) Have you tried anything like that? Just curious.


I remapped `jj` to escape (shortly before the touchbar was announced), because I disliked either having to move my hand or use both hands to get out of insert mode.

map! jj <Esc>


Yeah similarly I use

inoremap jk <Esc>


jk is the way to go! It is the fastest for me to type vs jj or kk.


If you map jk and kj to <Esc> you can just mash both keys at once and it doesn't matter which one registers first!


Have to ask: for all you jj / jk mappers, don’t you end up triggering this by accident when you’re just cruising around your code?


For cruising around my code the advantage is that jk/kj doesn't do anything in normal mode (cruising mode, haha). So I can just start mashing jk in a terminal window that I don't know what mode I left vim in.

The biggest downside to jk/kj mapping is that words that end with k are somewhat common. So a few times a week I will type something like "splunk" and want to exit insert mode immediately so I mash jk/kj after the k. 50% of the time the j is first so I end up with "splun" (kj is <esc>) (k moves up since we're in normal mode now).


> The biggest downside to jk/kj mapping is that words that end with k are somewhat common. So a few times a week I will type something like "splunk" and want to exit insert mode immediately so I mash jk/kj after the k. 50% of the time the j is first so I end up with "splun" (kj is <esc>) (k moves up since we're in normal mode now).

This is why I use `jj` instead of `jk`/`kj` -- as a native English speaker in a job where everyone primarily speaks English, there are few cases where I'd be writing code with a `jj` naturally in a string.


Very rarely. The only place I notice a difference is if the last letter I type is a j, the cursor 'hesitates' for a moment because Vim is watching for a k.

The advantage I found of jk over jj is that, in normal mode, jk is a no-op, so if I hit jk as Escape when I was already in normal mode, it doesn't matter.

The only problem is that when I'm editing text out of Vim, I end up with the occasional jk at the end of my typing. That almost happened while writing this comment.


There's also vim-arpeggio, with which you can define mappings for simultanously held-down keys: https://github.com/kana/vim-arpeggio


I haven't had that happen yet with jk at least, I could see jj triggering something if you have the timeout setting too long.


ctrl-[ works out of the box


But it's pretty unergonomic.


is it? I have ctrl mapped to caps-lock. so for me it's essentially home-row. left pinkie+right pinkie going almost nowhere. reaching for esc is decidedly not home-row.


A lot less than stretching for Esc.


ii here!


The tough thing about the touch bar is how often it freezes. It's hard to get used to it when all that is noticeable is the few times a week it does it.


I started using Ctrl-C instead of Escape in Vim years ago (long before the Touchbar) as it means I don't have to move my hands from the home position.


ctrl-c is a poor substitute for several reasons

1. it cancels any modifiers on the insert command

2. it won't trigger any abbreviations

3. it doesn't work with visual-block insert

4. it bypasses InsertLeave autocommands


>ctrl-c is a poor substitute for several reasons

Counterpoint: modal editing is a poor substitute for several reasons ;)


CTRL-[ is standard Vim mapping for Esc.


It's deeper than that. Control-[ is the same keycode as escape. [ is the next character after Z in ASCII, and Control-[ is the next character after Control-Z. It's not a mapping, they are one and the same.


there are great alternatives to reaching up for ‘esc’ in vim. ctrl-[ is my favorite. the ol double-pinkie


kj


I have always used ctr-c. I didn't even really know escape was an option, so I never had to adapt.


you can map tab to esc inside vim so you dont need to type esc

    :imap <tab> <esc>


Tab is still important to programmers.

Developers with a new MBP manage by changing Caps Lock Key to Escape. Less pinky travel too.

If you need caps, you can download Karabiner and move caps to something else. I changed mine to pressing both Shift buttons.


> tab is still important for programmers

I disagree. If you are a even modestly decent programmer you know to configure autoindentation so that you never need the tab key for anything. I cannot imagine a scenario where I would need the tab key in insert mode (except a very fringe case where I need to enter a tab character in a literal string and for some reason there are no escapes like \t. But then again you can still ^V^I)


You can't autoindent python, regardless of how good a programmer you are.


of course you can!

you only need to press ENTER (to create a newline) and BACKSPACE (to exit the current block). You never need to press TAB


So presumably in a whitespace-sensitive language you would always leave insert mode to declare the whitespace?


Lots of editor use the tab key to autocomplete. It's often called "tab completion."


of course, in vim you have ^o for that


I wasn't only speaking about Vim. Even then going to Caps is less travel than Tab.

I use Caps less than I use Tab like for switching programs.

Whatever works for you.


Ah, no. autoindent is a nice feature that is never perfect.


can you point to a minimal example where vanilla vim autoindent cannot cope with python code editing? I never found any situation where I had to press the tab key


Have you ever refactored anything? Especially in Python, moving a line into a control block requires using the tab key. If you don't have to press the tab key either you're such a god programmer that you have never made a mistake or refactored anything you've ever written, or you're trolling.


there's >> and << for changing the indentation of a line.

And i'm not a good programmer, a good vim user at most




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: