5 ms·
Try: inoremap jj <Esc> In insert mode you just press j twice and you get out of insert mode. This is my favorite key remap in vim. You can put that in your .
by weaksauce 14y ago
Try:
inoremap jj <Esc>
In insert mode you just press j twice and you get out of insert mode. This is my favorite key remap in vim.
You can put that in your .vimrc file or just try it out from the command bar.
- scott_s 14y agoIt's not the act of doing the remapping. It's accepting that I'll have to retrain my brain.
- ImprovedSilence 14y agoI started using inoremap jk <Esc> I'm not sure why, but I found it to be more fluid for me?
- rawland 14y agoinoremap jj <Esc> Same solution here. This favors people who tend to move from top to bottom during skimming a piece of code utilizing the j-key to move further down, which then let's you automagically exit EDIT-mode. Happens to me every fourth/fifth time. Earlier it was more often. However, as skills develop I increasingly rarely use the hjkl-keys. These days vim is placed at the end of a git/grep toolchain and most likely I tend to "/\v" for something or move more like "45j" directly to the place in focus (relativenumbers are your friend). Being in a row the natural tendency now is to jump with "f" or "F" and repeating with ";" if necessary. If you passed this milestone already, your opinion is highly welcome!
- weaksauce 14y agoI like to use hjkl for very short moves, wb for most moves in a sentence, "IA" for insert moves to the start or end of a line. I don't find f to be that useful because I don't like the thought required to figure out what letter I want. I guess it's just a personal preference though. larger moves are a mix of the {}() and /\v if I know what I am looking for by name. c-f c-b is nice if I am just browsing the code.