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.
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.
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.
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".
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.
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.
>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.
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:
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.
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.
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
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).
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.
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.
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.
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.
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.
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)
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.
Hopefully this trend continues and they can iterate on this model even further.