my vim setup

Lately a friend saw me working on VIM and he was really impressed. In this post I will blather a little about VIM and then I will share with you my .vimrc.

The thing about VIM is that when you learn the basics and get used to it, you can’t go back, really! I started working with VIM about 3 years ago and in that time I use it for everything: programming, mail writing, configurations… I mean, anything that is text I edit it with VIM. Sometimes I have to work on dreaded technologies (I’m looking at you visual studio) and I always find myself complaining about how hard is to edit things. Some people say that VIM is a difficult text editor, but really, you can get the basics in 30 minutes and then it is just a matter of practice. Here’s a picture about the dreaded VIM learning curve, I don’t know the guy who did this but he was up to something.

vim learning curve

Now, once you get the basics you will know that there is no substitute for VIM as an editor, I mean, being all day trying to reach CTRL, ALT or META is just crazy and you will thank VIM that you don’t have to leave the home row for most editing, but about VIM and editing there are a lot of posts out there that you can research for yourself, the real power of VIM, at least for me, is about not to having to switch contexts.

Let me explain, let’s face it, any developer is lucky enough to work all day on only one technology, for any interesting project you would need to write some C/C++ code, some java code, html5/css, javascript, bash scripts, xml, configurations of all sorts, and if you, like me, has a manager that don’t know anything about programming, you probably would have to write those web services on .NET, just because managment thinks that if it is written with microsoft technology then it would be enough, of course, you as a developer don’t have the time to explain to some guy that wouldn’t really understand how wrong he is, so, you just deliver and at the end of the day you have to write a lot of files in a lot of technologies. Now, if you are an IDE junky you would be firing eclipse for java, whatever you use for C++, you heard that IntelliJ has great javascript support so use that, and because you are a great developer who stays away from microsoft technology and work on linux or mac, you has to launch a virtual machine just to use visual studio for those stupid web services that managment wants.

Here VIM to the rescue, by now you know that you can write all that just with VIM, without switching contexts and, impressed as you are, you get even nice auto complete support right on the editor. So, at the end of the day you just have to learn one editor and do all work on it, because in VIM land, for everything you need there’s a plugin.

There are a lot more reasons to learn VIM and make it your editor of choice, for instance, VIM runs everwhere and it runs everywhere by default. If you have to develop an embedded system on ARM you’ll find that it comes with VIM. If you have to configure a linux server you’ll find that it comes with VIM. If you need to edit some file on a remote machine you can use VIM over ssh, and so on. VIM is everywhere and investing time learning it now will pay a lot in the future. But still for me, as a developer, the best gain is when you don’t have to be switching contexts during development.

Lately I have begun to study Android, and of course, in VIM there’s a plugin for that. Sadly I ended using Android Studio because eclim is not on the latests Android SDK (of course, once I get the basics on Android I will come back to VIM and the command line for development), but happily enough, Android Studio has IdeaVim that despite being far from the real thing, at least let me edit text the way i like. So, as you can se, VIM is truly everywhere. So, if you’re reading this, stop now, go install vim, spend those 30 minutes on vimtutor, try to get your hands dirty on Practical Vim: Edit Text at the Speed of Thought and you’ll thank yourself on the long run for that.

Here’s my .vimrc file, this file is not my own, I been working on it for the last 2 years with pieces I found on the internet. You’ll find that I use a lot of plugins and configurations, but don’t let that scares you, the nice thing about VIM is that you can make it your own.

Thank you.

jvillasantegomez@gmail.com