Back when I started programming, around 15 years ago, things were simple. You’d use Notepad to write HTML/JS, and Visual Studio to build things in C++/Visual Basic. A few years later I got connected to the internet and discovered a whole culture around programming, and along with that came the endless editor wars. The glorious editor wars
Discovering the one true editor
Imagine a kid, who just got started with programming, being exposed to the idea that some editors were better than others. Not just that, but the subtle hints that good programmers only use Vim/Emacs. You use Notepad? Hmmpph. You must be new to this
Well, there I was, about 15 years old, being told that real programmers used Vim/Emacs; because it makes them faster and better. Of course I jumped at that! I could be a better programmer just by learning a new editor? Why not!
It started out innocently enough. I tried out Vim, then I tried out Emacs. Didn’t really like either of these, so I tried out Netbeans/KDevelop/Notepad++/Komodo Edit and a few other contenders. I think I settled with Notepad++ for a year or two.
But there was always that nagging thought in the back of my mind, real programmers use Vim/Emacs.
A few years later I was a student in university, and I had a lot of free time on my hands (weirdly I didn’t do that well in university, never found out why though!). I think I must have read more than 500 articles on the pros/cons of using Vim vs. Emacs.
Most of what I read made it seem like this was the choice of a lifetime. You were either a Vimer or an Emacsian. You would never use both. So understandably I took a long while to make this decision, reading all the article I could to better understand what I was signing my soul over to.
I eventually settled on Vim, probably because I couldn’t remember all the different
C-n, C-p, C-x C-s key chords for Emacs. Vim just seemed easier with it’s modal editing mode. So I focused all my energies on Vim, and for the next few years, I would come to both love and hate that gem of an editor.
The pains of growing
I used Vim as my main editor for around 8 years. Even though learning to use Vim enough to be productive in it was a painful and difficult process, it brought a great ROI. Once you grok Vim, using it is a pleasure! You see patterns in your text, and you intuitively become aware of the series of key-strokes needed to accomplish the edit you want.
Want to change a dictionary key lookup in Python to an attribute accessor? From
dct.key, just use
ds" and insert a
.. That first two series of commands use the surround.vim plugin by the awesome Tim Pope. He has a lot of other great plugins as well that make Vim an even more awesome editor that it already is.
Like most Vim/Emacs enthusiasts, I have probably spent at-least a month of my time on customising and improving my Vim setup. Up until 2013, Vim was the best editor I had ever used. I was still learning a lot of new languages, and only programmed in my free time and for fun. I didn’t care that I had to lookup documentation for Django class based views every 5 minutes because I was learning and having fun.
It also didn’t matter that after using Komodo Edit and seeing how useful the autocomplete was for a new programmer like me, I still went back to Vim. Why? Well, because that’s what real programmers use.
I was young, naive, and didn’t really have the ability to think for myself and go against the culture I saw on the internet. I wanted to fit in. I wanted to brag that I used Vim, the editor of the gods. I could write a macro to convert that HTML table into a Python list in 1 minute, a task mere-mortals would take 15 minutes to do. In my programming career of 15 years, I’ve done that maybe three times.
That was fine and well for someone who only programmed on side project, and small freelance gigs that were never more than a few hours or at max days of works. But in 2013, I started my first job as a professional programmer at Dubizzle, the largest classifieds site in the Middle East region. It is a Django project.
Loosing my innocence
Dubizzle was a huge codebase, with a lot of legacy stuff and a lot of files. Until now I had only worked on small projects, composed of between 1 and 10 files. Code navigation was never an issue.
But Dubizzle was a different beast! With more than a 1000 files, it was impossible to navigate between them by memory alone. And given how legacy the code was, it was immediately clear to me that my Vim setup wouldn’t be of any use here.
My team lead at the time used PyCharms, and he was a fan. He was like a really annoying fan that tried to pushed PyCharms on everyone! I was that way with Vim as well. Can’t really blame him, we programmers tend to make emotional attachments to a serires of 0s and 1s for some reason.
Anyways, after trying to use Vim for the first 2 weeks and failing miserably, I started using PyCharms. But I didn’t move to it. This was just a temporary solution. I had found a small group of people at Dubizzle that used Vim successfully, and I fully intended to replicate their success. Of course I’d move to Vim, that’s what real programmers use.
It took me about a year to finally get around to setting up Vim. I had almost 20 different plugins installed, and after a month or so of effort, I had my ideal setup! I could use Vim on the Dubizzle codebase. Life was a bliss, and I was finally using what grown up programmers use to code.
Of course, even after the month of effort, the setup wasn’t nearly as good as PyCharms for project navigation, or code completion. Or any kind of help with writing the code either. Jedi worked, but failed sometimes. Virtual environments were weird to figure out, and PyCharms figured out stuff about the code that Jedi just couldn’t get, like the return types of functions. It also had other great features like jump to a class, rename variable, find usages, and a whole lot more. PyCharms (and to my knowledge all IDEs by JetBrains) are a pleasure to use, and seriously great software.
Looking back, it’s feels weird that I spent a month of work trying to replicate something that already existed. But man did it feel good to work out of a terminal again, with only 256 colours and weird key combinations, no real popups (for code completion). But I could work without taking my hands of the home row.
A new hope
After 1.5 years at Dubizzle, I moved on to JRD Group, a kickass startup. I joined the team that was going to build a new version of JustProperty in Django. The older version was in PHP *creepy music*.
Given the time I had spent on making my Vim setup solid enough to work on the Dubizzle codebase, I had no problems with using Vim as my only editor for the entirety of my time at JRD Group, which was around 2.5 years. Since I was part of the team that started the project from scratch, I remembered where almost every class was, where a particular feature was coming from. I could (and still can) navigate the entire project by memory alone. For this, Vim was perfect. I still remember this time as the best Vim experience I have ever had.
Everything was working perfectly. But there was this guy with me at the team that used Sublime. He could navigate to a class in the code with a beautiful interface. He could run a project wide search without needing to install an extra plugin (I used Silver Searcher). And my God did the colours look gorgeous. Plus the multiple cursors!
I tried out Sublime for a bit, and to this day I still use it for small one-off scripts and quick text editing. It’s solid and good at what it does.
But I wasn’t ready to give up on Vim. I had heard of this new thing called NeoVim. It was a mythical creature, one that had background threads for plugins, could be programmed with a sane scripting language (which VimScript is not!), could run a terminal inside itself, and supported somewhat beautiful colours (after some weird terminal config). Of course I moved. I guess I must have spend a week of effort on configuring NeoVim. Deoplete is an awesome completion framework. I had true colour support in Vim. It was an exciting time.
And then, I moved to Emacs.
The Emacs days
I somehow stumbled on to this video about Evil Mode. I was interested, so I though I’d give it a try. I installed Spacemacs, didn’t like the fact everything was pre-configured. Next I installed vanilla Emacs and installed evil mode. But that too didn’t feel right.
I decided I could stick to Vim or learn vanilla Emacs and configure it my way. By this time, my day to day work involved a lot more DevOps stuff, and only some coding. This seemed like a good time to learn a new editor, when my daily job didn’t depend so much on my typing speed.
So I installed Emacs, worked through the tutorial in 2–3 days, and started configuring it. Here was an editor that had one of the best scripting languages I had ever seen; Emacs LISP. And it was extensible as hell. I probably spent two weeks setting it up. Magit is awesome! So are the twenty other plugins I installed and configured. I was in love again.
And this time around, learning Emacs wasn’t difficult. I was extremely surprised by how easy it was for me to pick up a new editor. For some reason, I had gotten it into my mind that having been a Vimer for almost 7 years, Emacs was a no-go area for me. But I was so wrong. I picked up Emacs and got to 75% of my Vim productivity level within 3 weeks of using it. I still miss the move-to-character command from Vim though. 🙂
Then I discovered Org-Mode, and my life hasn’t been the same since! It’s by far one of the best to-do managers I have used. And there is so much more to it than being just a to-do manager!
Emacs had a built in terminal. NeoVim just got that a while back, and it’s still nowhere as great. But getting Jedi to work with virtual environments is still a pain in Emacs. Refactoring is still not as great. I didn’t have the jump-to-class-in-project figured out. While the editor was awesome, using it for Python was decidedly only as good as I had it with Vim.
A new job, a new start
I recently started a new job. It’s been two months now, and I’m working on a brand new Django project now. I have been using Emacs for the past 4 months. But I’m still not happy with it. Jedi is a good autocomplete library, but it’s not perfect.
Finally, after 15 years of fighting it, of trying to fit in, a week ago I had to give up. I can’t keep telling my self that Vim/Emacs is the only editor I should use if I want to be a serious programmer. Yes, I know my setup for Vim/Emacs could be way better than it is. But I’ve spent enough of my life trying to tweak the editor to work with my language of choice. Emacs is a great editor, but I can’t keep spending my time tweaking it to work on the same level as PyCharms.
I’m done making excuses for why I use Emacs/Vim over PyCharms. I might be able to edit that line 5 times faster in Vim that I can in PyCharms, but if my experience with Emacs taught me anything, it’s that the editor doesn’t matter as much as we’d like to believe.
As programmers, we’re told to use the right tool for the job. I have finally realised that Vim/Emacs aren’t the right tools for Python/Django. For me at least. For Golang, I haven’t found anything better than Vim. For general notes and to-dos, Emacs with Org Mode is the best. Magit is the best Git frontend I’ve seen. I prefer using it over the Git CLI. For editing files that are GBs in size, Vim blows everything else out of the water. For Clojure (which I got interested in because of Emacs LISP) Emacs is straight down the only thing I’ll consider using. And I’m sure that for other statically typed languages like Rust, C, C++, Emacs and Vim are crazy awesome, and I’ll probably use them over anything else. But for Python, PyCharms is the best I’ve seen. And I’m going to give it a try now.
Yes, true mastery of an editor will give you maybe a 50% boost in editing speed over how I today use PyCharms. But I bet that gap will close over time.
If I can learn that
C-c pf opens up Projectile file navigation, I guess I can also learn that
Shift-Cmd-O opens up the file navigation in PyCharms.
And even if, at the end of 6 months, I’m still not able to edit files in PyCharms as quickly as I was able to in Vim/Emacs, I’m OK with that. My experience tells me over and over again that typing speed doesn’t matter. That’s what a lot of other smart people say as well. I guess it’s time I listened to them.
I guess this is just a rant, something I had to get off my chest for a long while. I’ve had arguments with many people over why Vim beats their editor of choice. This is my way of accepting that they were probably smarted than me in their choices.
This is my way of accepting that I don’t need to use Vim/Emacs to be good at my job. That it’s OK to not follow the culture when you can’t seem to fit in. And this is my effort to help the next 15 year old who searches for “Vim vs Emacs”. Don’t worry about it. Use whatever feels natural, and works best for the environment you’re working in.
I will keep using Vim on the remote machines I manage and for Golang. I will keep using Emacs for Org Mode. And from now on, I’ll use PyCharms for Python.
One of the surprising discoveries during this journey for me was just how limited I believed my abilities to adapt were. I had convinced myself that I could never move to another editor. But after using Vim for more than 7 years, moving to Emacs successfully over a period of less than 2 months opened up my eyes.
I hope I have the same luck with PyCharms.
P.S: You can find my dotfiles, which hold all the Emacs and Vim config I use, on the Github repo.