Learning Vim

Is it worth it?

Definitely seems to be. I’ve looked at VIM in the past, tried it out too a couple of times or more, failed miserably(mostly within a day or two) and then wondered Why nutheads use VI. This would usually be followed with going back to the comfort of Emacs. I think over the years, I’ve spent more time customizing Emacs than actually getting any work done with it. And somewherethat felt wrong. In light of that, the minimalistic VIM looked attractive and worth another try.

So what about this time?

So this time things worked out a bit better. Rather than firing up VIM, spent some time reading through other’s experiences on picking up VIM. And the first thing I did right was to disable the arrow keys in normal mode (I still have them in insert mode)

    " disable arrow keys
    noremap   <Up>     <NOP>
    noremap   <Down>   <NOP>
    noremap   <Left>   <NOP>
    noremap   <Right>  <NOP>

Once you have that bit, you’re forced to use h/j/k/l. And while h/j/k/l muscle memory is built up within a week, the nice thingthat really happens is that you dont use h/j/k/l much – instead you move to using more efficient movement commands. There’re aton of resources/cheatsheets on the web – but the approach I followed was to figure out some small keystroke when I needed it.What that mean’t was that I could get work done – but at the same time get more efficient gradually.

customizations

VIM out of the box is pretty badly configured – and that’s part of the reason that people seem to shy away from it. In fact, all the times that I tried out VIM before, I didnt even come close to cusotimizing my .vim. There are folks who have curated vim dotfiles on github etc – but my advice is to stay away from them. You should know what goes in your .vim and be in control of thatrather than getting a bunch of things in your .vim that you dont understand. Just so you know, looking at the github history for my vimfiles repo – the initial commit was 3 months ago – but after that, all the commits have come in only in the last 4 weeks.What that means is that while I put in a vim file initially, I didnt do much with it initially since I was just getting a hang of the basics. Once one becomes comfortable with the basics, one moves to customizing the vim environment more and more.

Parting words

To summarize, VIM definitely seems nice once you invest into it. It’s easy to drop off in the initial stage and not go any further – and I believe this is what happens to the vast majority of folks who try it out. However, once you build that initial comfort level,it feels light, fast and easy.Start easy, persist, and customize bit by bit – you’ll feel yourself going from struggling with Vim to feeling comfortableand then to customizing your environment for an even better experience with VIM.I’ve definitely been more productive with VIM than I ever felt I was with Emacs – and these posts to my blog from Vim part of that.Besides that, I’ve used VIM effectively with a decent sized js code, html markup etc and felt the speed of editing inspite of still beinga noob in Vim terms.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s