News for hackers. Stuff that matters.
Re:16-inch MacBook Pro by ascagnel_ on Wednesday November 13, 2019 @08:56AM (#21524015)
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>

Re:16-inch MacBook Pro by seanhunter on Wednesday November 13, 2019 @09:02AM (#21524108)
Yeah similarly I use

inoremap jk <Esc>

Re:16-inch MacBook Pro by roland35 on Wednesday November 13, 2019 @09:09AM (#21524182)
jk is the way to go! It is the fastest for me to type vs jj or kk.
Re:16-inch MacBook Pro by positr0n on Wednesday November 13, 2019 @09:24AM (#21524378)
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!
Re:16-inch MacBook Pro by darkteflon on Wednesday November 13, 2019 @06:06PM (#21530758)
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?
Re:16-inch MacBook Pro by positr0n on Thursday November 14, 2019 @09:46AM (#21535728)
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).

Re:16-inch MacBook Pro by ascagnel_ on Thursday November 14, 2019 @09:55AM (#21535793)
> 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.

Re:16-inch MacBook Pro by alexjm on Wednesday November 13, 2019 @06:16PM (#21530848)
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.

Re:16-inch MacBook Pro by L3viathan on Friday November 15, 2019 @05:39AM (#21543823)
There's also vim-arpeggio, with which you can define mappings for simultanously held-down keys: https://github.com/kana/vim-arpeggio
Re:16-inch MacBook Pro by roland35 on Thursday November 14, 2019 @02:13PM (#21538370)
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.
Re:16-inch MacBook Pro by vcavallo on Wednesday November 13, 2019 @08:59AM (#21524050)
ctrl-[ works out of the box
Re:16-inch MacBook Pro by jandrese on Wednesday November 13, 2019 @02:00PM (#21528005)
But it's pretty unergonomic.
Re:16-inch MacBook Pro by vcavallo on Wednesday November 13, 2019 @02:50PM (#21528667)
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.
Re:16-inch MacBook Pro by tga on Wednesday November 13, 2019 @02:40PM (#21528550)
A lot less than stretching for Esc.
Re:16-inch MacBook Pro by Unbeliever69 on Wednesday November 13, 2019 @02:30PM (#21528424)
ii here!