3 ms·
I am impressed that :imap jk <Esc> :imap kj <Esc> works great. However it seems like outer and inner text objects aren't working at all. E.g. daw, ci)
by positr0n 8y ago
I am impressed that
:imap jk <Esc>
:imap kj <Esc>
works great. However it seems like outer and inner text objects aren't working at all. E.g. daw, ci)
- Rainymood 8y agoAnytime I end up in someone else's Vim editor the first thing I do is :imap kj <Esc> Worked fine here, felt super snappy too.
- fxfan 8y agois this a common key binding? I've seen it before and it makes a lot of sense but I'm wondering if I will run into issues. I don't want to disrupt my flow and muscle memory and later regret it.
- govg 8y agoUnless you type a lot of graph algorithms notes (and have to write "Dijkstra"), you rarely encounter the key sequence jk. It makes it easier to work with vim and never move to hit the Esc key.
- irishsultan 8y agoThat or you're writing in Dutch. Neither of ij, jk or even kj work in Dutch, because they are very common.
- govg 8y agoThat's a very fair point! I hadn't considered this at all, I mostly write in English, and subconsciously assumed this would be true of most Vim users.
- mkl 8y agoI guess it depends whether you want to write about playing blackjack with Dijkstra in Reykjavik! I might need to try it out for a bit. It has the nice feature that if you press it in normal mode there's usually no effect.
- positr0n 8y agoI use it and love it, even after binding Caps Lock to Esc. The only issue I have is when I type something that ends with j or k and immediately want to exit insert mode. e.g. if I type "ack" and then mash jk to leave insert mode. Sometimes the j will hit first and only "ac" is left in the buffer. That happens rarely though, and sometimes now I'll know it's going to happen and consciously type "ackkj" or just pause a beat to ensure the right thing happens.