5 ms·
Why not use "jk" or "jj"?
by lytedev 10y ago
Why not use "jk" or "jj"?
- lunchladydoris 10y agoDiscovering this really changed Vim for me. That and remapping j and k to move over visual lines instead of logical lines.
- Rusky 10y agoPersonally that slows down normal usage of j too much for me.
- ngokevin 10y agoIt doesn't have an effect if you type a single `j`.
- jcl 10y agoThese can be convenient if you are only entering text manually. But remapping regular -- albeit rare -- text sequences can have unexpected results when pasting copied content into insert mode in a terminal window. I've been bitten by this a couple times when pasting base64-encoded data.
- nick_g 10y agoThis has caught me as well, but it can be avoided by using `:set paste!` to toggle paste mode before pasting. This isn't something I need to worry about often enough but you can map that command if pasting external content is something you do often.
- marklgr 10y agoMost terminals support bracketed paste, and vim can automatically toggle pastemode based on the special sequences. Eg. https://github.com/ConradIrwin/vim-bracketed-paste https://github.com/ConradIrwin/vim-bracketed-paste
- eqyiel 10y agoWhat if you want to write "Dijkstra"?
- tommorris 10y agoThen you need to switch to Dutch mode...
- WildUtah 10y agoThat's why i use kj. (Also: quaternions)
- farresito 10y agoThen you wait one second after pressing j (until the timeout is over) and press k.
- chillee 10y agoTo be quite honest, that sounds terrible.
- farresito 10y agoI don't think it's bad at all. I very rarely have to write 'jk', and using that combination saves me from having to either reach the escape key or having to use c-[. If the price I have to pay is waiting 0.5s (which is what I have the timeout configured to) once in a while, then I consider this a great tradeoff.
- WildUtah 10y ago:ino kj <Esc> :ino <Esc> <Nop> Try it for a week; you'll love it.
- flukus 10y agoI've been using <leader><space> lately, with space as the leader key so just <space><space> really, it's worked well so far.