3 ms·
My favourite mapping for 'Esc' usage is to map kj to Escape ... super handy noremap! kj <esc> https://github.com/patrickdavey/dotfiles/blob/058950c2f470a1d746
by patrickdavey 7y ago
My favourite mapping for 'Esc' usage is to map kj to Escape ... super handy
noremap! kj <esc>
https://github.com/patrickdavey/dotfiles/blob/058950c2f470a1d7461514c4f590ad89a58ba5d2/vim/.vimrc#L127-L128 https://github.com/patrickdavey/dotfiles/blob/058950c2f470a1...
- runald 7y agoWhat if you need to type something like blackjack?
- equalunique 7y agoThe remapping would trigger <esc> when both j and k are held down at the same time, so typing "blackjack" could be an issue if it were typed quickly and/or chorded.
- patrickdavey 7y agoIf you needed to type it, you'd have to pause after typing the k (about a second?) then type the j.
- sirsuki 7y agoI found jk to be the best. If I use it in normal mode it is a no op (cursor up and down). The english language (and most all programming languages) don’t have words with a jk sequence in them (unlike kj). It works universally across all keyboards and terminals. My fingers are already there (unlike esc which is just as bad as lifting my hands to use the mouse). Plus in the rare case I do need jk inputed (very very rare) first the default is a safe default (esc) and second the mental load to pause while typing (pressing j wait past the half second timeout then press k) is no different then the mental load to choose to accept the expansion of abbreviations or delay typing to get around the auto expansion triggers. Jk for the win!!! (Also jj works well to). I also set my mapleader to <Space> you would be surprised how useful that is. Not to mention , (comma) is a valid and useful vi movement key.
- patrickdavey 7y agoHeh, kj is a no-op too of course (down then up). I have literally never found myself needing to pause to wait for a k and then a j. What are these words with "kj" in them that you're wary of? I'm genuinely curious :)
- sirsuki 7y agoBlackjack? In english there are words that end in k while I don’t know of any that end with J. However my vim set up maps jk, kj, jj, and kk to Esc to in reality it is safe to just mash those two keys and one of the maps will work.