Worried you’ll miss us?
Subscribe to get our articles and updates in your inbox.
It seems hard to believe that Vim has been polarizing the developer community for three decades and is still going strong. Sure, many programmers only use Vim because they can’t actually exit the application and are therefore trapped beyond its event horizon … but that’s neither here nor there!
We know talking about text editors can be more taboo than discussing politics or religion at the programmer Thanksgiving table. Like any other dev team, ours is replete with Vim zealots and heretics. Our Vim faithful are always looking for new ways to extend their editor’s utility. Love it or hate it, Vim still reigns as one of the most beloved editors to this day and has the ultimate scoreboard taunt:
Is the text editor you use entering its fourth decade?
In technology, nothing sticks around for long. Vim has been a useful tool for a literal human generation. Simply put, Vim isn’t a dinosaur, it’s a shark. So how has Vim done it?
In this birthday e-card, we’ll outline why even after 30 years, Vim is as relevant as it was in 1991.
First, let’s get some disclaimers out of the way.
Hipsters beware! If using Vim has appeal because it is some ironic punchline, then on your own head be it. Vim’s infinite configurability can be an experienced developer’s best friend. Yet many devs have fallen off the cliff of Vim’s steep learning curve. Dialing in the settings of a tool like Vim is no cheap investment but can pay off in the long run with proper commitment.
Configuration over convention. There are far better out-of-the-box tools than Vim. Conventions work well for those who could benefit from a more forgiving and flexible tool. Conventions also have increased ergonomics for those who aren’t editing code all day every day. What Vim offers is a raw ability to dial-in configurations far beyond other tools. As such, for new programmers straight out of bootcamp, a product like Vim could be a brutal starting point.
All set? OK, let’s dive in.
Look Ma, No Mouse!
So much of the work of a developer is entering and manipulating text. Anything that interrupts that process, like the use of a mouse, can be a minor annoyance to a flow-breaking impediment.
Since most developers are relentless optimizers, many try to extend the idea of keeping their hands on the keyboard as far as possible. This saves time, keep them in flow-states, and ultimately helps them deliver better software. Over the decades the Vim team understood that core benefit for users and have shaped their product to that competitive advantage. Here’s some examples of how Vim does this:
Modal Editing — Editing a typical “modeless” editor like Notepad allows one mode: inputting text. Vim allows for multiple modes. Insert mode allows for text editing (like Notepad) while normal mode inputs arguments to perform a variety of functions. Modal arguments might move the cursor, perform a search, or operate a manipulation (cut, copy, paste, etc.) of text. Modal editing is like shortcut keys on steroids in that commands or arguments can be combined in a variety of ways (selecting a character, word, line THEN cutting it or searching from it, etc.). This powerful feature keeps hands on the keyboard and minds in synch with the code on the screen.
. — Another benefit of modal editing is that you can re-run a series of commands across multiple lines. While it seems like a simple macro, this can be powerful during complex text manipulations.
Vim-Easy Motion — Since you aren’t using your mouse, how do you jump around without taking your hand off the keyboard?Easy Motion helps you to jump to different line/column placements easily and quickly.
Text Is a First Class Citizen
Vim was built in a time when navigating by mouses or trackpads was only just becoming the rule as opposed to the exception. So everything, even the configuration settings, are stored as text. Search is not an abstraction through a GUI, searched text is directly available for immediate use or manipulation.
Keeping text as a first class citizen can also take the guesswork out of navigating through a GUI to find the right place to adjust any settings or styles. With settings as text, Vim provides commented out notes in the settings … something a GUI could never do. Noting why things are set in a certain way can be important metadata.
Vim takes a lot of its prompts from Unix, where everything is displayed and interacted via text. Since vi is part of the Unix standard you will be at home on any Unix environment.
Trunks and Treats
Vim’s undo powers are one of the most underrated feature sets of this product. While it is great to undo in a straight line, what about previous diversions off the main undo trunk? Are those lost?
Vim provides version history that will get you as close to a Rick and Morty style multiverse of code as possible by logging every keystroke. This is a powerful way to walk back changes and divert onto new branches of code. Why does this matter? Maybe a path you previously started down will lead you to that passing unit test.
A best security practice we would recommend flushing this history overnight. Beyond the security concerns, once you walk away at the end of the day this granular level of branching might not be as valuable after a good night’s sleep.
The ability to integrate shell commands inside the editor can make life much easier. Rather than running commands in a second window or separate terminal of some kind, Vim’s ability to natively run shell commands to add/remove/change permissions on files makes life much easier on programmers and prevents them from breaking their pattern
Buffers versus File Tabs
Which files have I edited recently?
Where’s that darn global file?
Where is that API call I was editing an hour ago?
Rather than try to remember which file is open in which file tab of your text editor, wouldn’t it be easier to simply make a search from the keyboard for whatever file or text you are looking to review? While trying to remember where that file is represented on your screen at the current moment seems like a trivial item to remember, this can get burdensome when reviewing and editing many files at once.
Rather than weighing down your brain with that, buffers allow for hundreds of files to be open at once and accessible through simple searching.
Why is Vim still relevant? Because while many things have changed, the paradigm of how coders actually manipulate and input code isn’t all that dissimilar today than it was thirty years ago.
Vim was a visionary product at that time and remains highly relevant today because it remains true to what its users need most: a simple but powerful way to input and manipulate text.
Vim listened to and understood what programmers needed and what key benefits were required to get the job done. Since then, the core team has remained vigilant in austerely delivering what their users need more than eye-catching interfaces: unequivocal productivity.
Happy 30th birthday Vim! We can’t wait to see where you go in the next 30!
Loved the article? Hated it? Didn’t even read it?
We’d love to hear from you.