Hacker News new | past | comments | ask | show | jobs | submit login

You really shouldn't be moving in insert mode. The only thing you should be doing in insert mode is typing new text (or erasing a few characters immediately before the cursor that you mistyped while still in insert mode).

Once you're outside of insert mode, you have a ton of options for moving around very quickly and efficiently. You are crippling yourself by using the arrow keys to move character by character or line by line instead of going out of insert mode, not to mention the time you waste moving your entire hand to the arrow keys and back.

That said, if you really feel you absolutely must move in insert mode, may I suggest mapping:

  control-h
  control-j
  control-k
  control-l
to move while in insert mode, instead of using the arrow keys. That way your hands can remain on the home row, and you'll continue to use the familiar keys to move around. (As for hitting the control key itself, I like to do that with the part of my palm that's right below my little finger, so I don't have to move my fingers from the home row -- it also makes for virtually no finger strain, compared to using your fingers to hit it).

But you should really try to wean yourself off the bad habit of moving in insert mode.




I find this needlessly strict. Personally I map arrow keys to more useful things in normal mode (tab switching for left/right), but I leave them in insert mode not because I have a bad habit of using them, but because on the occasions that I instinctively use them (eg. I often type pairs of braces and then back-arrow) they are not a crutch preventing me from using some more efficient normal mode ops. I am extremely fluent in hjklwWeEbBfFtT, and I correctly use the atomicity of insert mode, so it would just be dogma if I remapped arrow keys in insert mode.

Also btw, Control-h,j,k,l I have mapped to switch windows.


"But you should really try to wean yourself off the bad habit of moving in insert mode."

That's just dogmatism for the sake of it. There are certainly cases where it takes less finger movement to use arrow key movement (either by character or by word) in insert mode than it would take with switching to normal mode and doing hjkl movement.


I have seven years of professional avg personal daily use of vim and never bothered to leave the arrows. I don't move so often in insert mode, I just prefer my hands the be far from each other. Ijkl maniacs should stop repeating the same refrain over and over...

My favorite tricks: o in select mode, ctrl-y in insert mode.

Still looking for a good commenter for python (NERD commenter don't work for me)


"I have seven years of professional avg personal daily use of vim and never bothered to leave the arrows."

There are also two-finger, hunt-and-peck typists who've been typing for 30 years.

Just because you've been doing something one way for a long time doesn't mean it's a good idea.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: