I was fine with Vim. I really was. I had been working with Elixir (coming from Java) and loving it in Vim, until Chris McCord decided to switch to Emacs. Of course I knew what Emacs was, and had played with it before, but had settled on Vim. Knowing that Chris like so many rubyists used Vim heavily I decided to take his que and see what Emacs had to offer. There are many reasons specific to Elixir for his switch, however, I use Java, Go, Python, and lately Ruby in addition to Elixir, so I wanted to evaluate how it would work with my workflow.
Vim 2 with a vengeance
I know I could have just used
emacs -nw and been done with it or even used evil-mode in emacs (I did for a long time), however I missed using tmux and vim. Perhaps it is the nerd in me who enjoys writing quick scripts to aid in my work or building from the terminal, but I was pulled back to Vim, however, this time I wanted to translate some things I used in Emacs for vim and to my surprise I found…they already existed!
When I started using Vim all those years ago, I was told to use NerdTREE and that’s that. It was great coming from a standard text editor, however I am quickly learning how disruptive it is to my workflow. I had used FZF for fuzzy search but what about when you do know your project structure yet?
:Explore built in is great and now I find using it really great, however, I found a better solution Ranger. Ranger is a file browser for the terminal, and there is a vim plugin for it! press
f in normal mode and it drops you into ranger to explore your project structure and open files.
How about the lovely
Ctrl-x b in emacs to list buffers. It’s strange to say before Emacs I didn’t use buffers as I should. I split windows opened other windows and when I wanted to back to the other file I opened it again. How stupid!
:b ls lists your buffers and
:b x where x is the number assigned to that buffer or a unique identifier to switch. What an improvement in my workflow. I had also installed the tagbar plugin and barely used it in vim, but as I was going down the list of my vimrc and trying to find a natural way to replace my plugins, I found generating ctags and using
Ctrl-] so vital to my workflow I don’t know how I made do without it.
The last big cut in the plugs list was neocomplete. I had installed it thinking it would add something to my workflow, but had to write a function to close the popups and every now and then found myself unnecessarily hitting enter to get rid of it. I have commented it out now and have been using
Ctrl-x Ctrl-o for autocompletion when I need it. I rarely need it outside of Java and I use JavaComplete2 for the most part. Speaking of Java, I had been using meghanada in Emacs which I found the most compelling for my workflow, but seeing as I use work with Spring Boot which uses parent poms, it does not work for gradle and was forced to use intellij (which is great, just not my cup of tea). But in vim with JavaComplete2 I find it is more than adequate when combined with maven/gradle/springboot CLI to develop applications that I haven’t been using Intellij at all (mind you I am working on freelance projects with it right now, not sure how this would translate for a large enterprise application, as always YMMV).
What Do I miss?
The big elephant in the room is, without a doubt, VimL vs. Elisp. Elisp is great, it is really wonderful to use and found myself wanting to learn closure just because of it. And I do miss it. I have been scared off by many people on forums declaring their utter hatred for VimL, but I have decided to try and dive in, learn it and see just how awful it really is. One thing I can say is that with Vim, there is a few variable to set, a couple plugins to add and you have a very powerful text editor; for instance my vimrc is 140 lines (with comments and commented out neocomplete settings) whereas in Emacs my configuration after only a few months is 390. So while it is great to hack in Elisp, you will be doing it quite often.