Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is a perfect place to post a Vim tip that I think helped me the most in starting out.

Disable arrow keys.

It's extremely painful for the first 5 days but I promise that's all it takes to get use to it. And it makes huge difference in your productivity. All that time does add up.

Add the following to your .vimrc

    map <up> <nop>
    map <down> <nop>
    map <left> <nop>
    map <right> <nop>
    imap <up> <nop>
    imap <down> <nop>
    imap <left> <nop>
    imap <right> <nop>
The reason you want arrow keys disabled in insert mode is that arrow keys breaks the modal paradigm. Again, I promise that once you get comfortable, it becomes more efficient to go into editing mode and make the change rather than navigate via the arrow keys in insert mode.


I learned vim's movement keys by playing nethack on a laptop without a number pad. This is a very fun way to learn hjkl. It also punishes you quickly if you make a mistake.


And then your arrow keys are free to bind to something else useful, like moving between split windows, buffers, etc.




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

Search: