Why I Still Use Vim

And no, it’s not because I can’t figure out how to close it.

Casper Beyer
Aug 4, 2017 · 3 min read
Image for post
Image for post

I often get asked about why I use Vim as my primary editor, there is no particular reason for this, except that I ended up learning it when I moved over to Linux full time many years ago. I ended up liking it because I could edit my small source files on my quad-core machine without needing to wait forever for the file to open.

Sure Vim isn’t a bad editor, it’s highly extensible, it’s easy to shell out to the, err well shell, its everywhere so when you ssh into some obscure server you can just type vim (or vi) and you’re good to go.

But this isn’t a pitch about Vim being a great editor, that’s a matter of subjective taste. I’ve primarily stuck with it because it’s an extensible editor that doesn’t hog all the resources and kill my machines. Using Atom or Code I experience frequent freezes for several minutes when just typing a single character.

How much memory would you expect an editor needs to open the following C file?

#include <stdio.h>int main() {
printf("Hello, world!\n");

Memory Usage

The answer is… crazy.

Image for post
Image for post

Code requires a whopping 349 megabytes in order to open a 60 byte file. Atom comes in at 256 megabytes. Where Vim “only” needs 5 megabytes, which is still kind of high, but representative of an average configuration.

I’ve also included Nano to have another text mode editor to compare Vim with, which came out at less than a megabyte.

What about larger files? Opening a 6 megabyte XML file in Vim consumes around 12 megabytes. Nano is pretty much neck-and-neck with Vim. Code needs 392 megabytes, and Atom needs a whopping 845 megabytes.

Image for post
Image for post

Startup Time

What about the amount of time necessary to open that same XML file, then move your cursor to the end of it? This tells a similar story. Atom and Code take nearly 20 seconds. Vim takes around 4 seconds. Sublime is surprisingly fast here taking only a mere second.

Image for post
Image for post

Doing a search and replace for 100,000 instances of a word in that same XML file yields somewhat surprising results. Nano and Atom failed, taking nearly 10 minutes on average to complete. Atom crashed quite a few times trying to get a result. Code took around 80 seconds. Sublime finished in 6 seconds. And Vim only took 4 seconds.

Image for post
Image for post


Learn Vim. It’s worth checking out http://vimcasts.org, which is basically Vim golfing, tips, and tricks made by Drew Neil, who also wrote this awesome book

Image for post
Image for post

If not Vim, then maybe Emacs. Or, well, just anything that is not a web browser masquerading as a text editor.

It’s just flat out ridiculous to have an editor consume all the processing power and memory available on a “modern” expensive laptop, when it doesn’t need to do so at all.

The test files used in these benchmarks were taken from this repository, results were averaged between that dataset and my own.

Commit Log

Contains Commits, Duh!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store