A story of me becoming not-totally-noob VIM user
This article is a followup to the initial story of editors, this time focusing on VIM. It will also be a multi-part series because there’s just too much ground to cover
As almost every cool kid trying to be a hacker in high school, I learned VIM basics when toying with Linux on my desktop machine. Working isn’t the correct word, because I wasn’t really doing anything serious. I felt totally badass for being able to compile a kernel from source and actually make the machine boot up after that.
Anyway, thanks to this little experience, I was able to do the most basic things in VIM, mostly navigating with wbhjkl^$ deleting stuff with d and c and replacing a single character with r (this one was the coolest obviously).
Until recently I’ve been using VIM just for some sysadmin things, and those few keys I learned were more than enough. But then something changed, and I just had to learn how to use VIM.
First thing I can recommend is disabling your arrow keys. This is the simplest way to just force yourself to get used to the VIM-ish movement.
Put this in your ~/.vimrc
inoremap <Up> <NOP>
inoremap <Down> <NOP>
inoremap <Left> <NOP>
inoremap <Right> <NOP>
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
You don’t ever want to reach for an arrow key. If you do, you did something wrong, hit escape, undo and figure out a better way. For example if you find yourself always landing one character too far when doing search with f (jump to letter), you might find that there is actually a key t which does exactly the same thing as f, only lands one character to the left.
It will take some time before you get fully productive in VIM, especially if you’re completely new. That’s why I recommend only using it for a limited amount of time, or for a pet project. Going into hardcore VIM usage at your day job might result in big drop in your productivity until you get used to it, and not everbody can afford to just toy around with a new editor for 2 weeks while doing zero work.
The important thing to note here is that your brain needs some resting time to get used to the new information. It takes time to build up muscle memory. Working 8 hours in VIM over the course of 4 days might give you more than using it for 8 hours straight.
You might wake up one day and realize that suddenly you’re able to navigate much smoother than yesterday and everything just seems much smoother.