No more arrow keys

This week I have been following along with videos by Derek Wyatt. He has some great videos on his site that cover the basics up to advanced Vim topics and delivers it with a nice touch of humour. Thus far, I have managed to watch most of the Vim Novice Videos which go over basic movements and basic editing. Some of this is stuff I've already covered, but the repetition is helping it stick. As much as I am tempted to start exploring the world of plug-ins and start working on configuring the editor, I have been going over and over the basics in hopes to have it become second nature. Even after 3 weeks I still find myself using the arrow keys, so yesterday I did a quick google search on how to disable them. I remembered this being mentioned in a thoughtbot video called Improving Vim Speed I had watched on YouTube. They explain that when using Vim you want to stay on the home row as much as possible so all commands are easily accessible.

So after a bit of googling how to disable the arrow keys, I found the article Habit breaking, habit making which is about how to be effective at navigating Vim. It offers tips on how to break old habits (aka the arrow keys). For those who want to know, you can disable the arrow keys in vim by adding the following lines to your .vimrc file:

noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>

It's incredible how seconds after correcting myself, I catch myself going for the arrow keys again. It's proven to be difficult to overcome just this one habit after only 3 weeks of using Vim. So hopefully over the course of the next week the disabled arrow keys help ingrain the h j k l directional keys as I continue to play around in Vim.