When IDEs change, I give up and use vim
As you may have read, Android is switching its main IDE from Eclipse (ADT Bundle) to Intellij (Android Studio). While I was at Google I/O this past week, I decided to stop by the JetBrains booth and talk to a couple of the reps about what Intellij offers, as I’ll probably be switching, at least for Android development.
Android Studio is Intellij 13
I like to play around with a lot of different languages and frameworks. I like trying new things, but I don’t necessarily want to build large projects with them. I also don’t want a dozen different IDEs to learn and to need to do big context switches between projects. Currently, for any non-java stuff, I spend most of my time in the command line, using vim, and managing workspaces with tmux. For Android and other Java projects, I do use Eclipse, and will probably switch over to Intellij. I have recently played around with IDEs for Clojure (LightTable) and Go (LiteIDE).
I’m really not sure that I want to spend $199 (likely annually) for a tool that may or may not end up helping me more than the free version. I also don’t want to have a dozen different IDEs to manage.
I decided that instead of leaning on a large IDE, I could probably get most of what I need from vim. I started googling around and found that there are plenty of plugins that will allow me to do code-completion in vim for most languages. There are a few other things that an IDE might buy me, but this is the biggest one. Since all I need is command line access, and this is already a major part of my workflow, this seems like a winner. I’m hoping that by really learning vim, that I can escape the pull of most IDEs, and be more productive in the command line.
My new setup
Here’s what I’m installing:
You might notice a comment in there above the YouCompleteMe bundle line, which says that you’re going to need to likely compile and install vim from source to get this working. So, that’s what I did.
Compiling and installing vim
This was a bit more difficult than the docs on YouCompleteMe’s github page suggest. Mainly, because you’re compiling against vim’s development repository, you might run into a broken build. Luckily, it is rather simple to update to a different commit in the repo, recompile and try again. If you run into this issue, I suggest going to the repo yourself, and picking out a version to try, as opposed to using the one that I’m supplying. There are no guarantees that the one that I picked is good for anything other than fixing the one issue that I ran into.
Now, you can get vundle, and all your other bundles installed in one go:
There’s a component of YouCompleteMe that needs to be compiled and added. Here’s how you do that:
Ctags also need to be compiled and installed:
I know that I didn’t go through all of the plugins that I chose. Maybe I’ll do that in another post. We’ll see. Getting this far on one box took me long enough, first researching, then working around the issues that I ran into with my initial attempts at a compiled vim. Already, the auto-complete provided by YouCompleteMe looks interesting, and I’m excited to try out some of the functionality offered by the other plugins.
One nice thing is that all you need to do to get rid of any of these plugins is to simply delete the directory from ~/.vim/bundle/ and remove the bundle entry from your ~/.vimrc.