There are many reasons to know Vim, but one of the more obscure ones is that it actually prepares you for the dreaded day when you have to use ed.
Today, I needed to see what went wrong when a buildpack was running on Heroku. For whatever reason, I couldn't for the life of me replicate the error on my local copy of the project, but when I tried to run it on Heroku, all it said was,
That is extremely unhelpful.
To get more information to go by, I needed to drop into a debugger when calling into the broken library. This required me to inject some code into one of the library files which Heroku downloads automatically every time someone deploys code.
You're not meant to do this, obviously. The libraries Heroku downloads are intended to be kinda-sorta read only. You install them and then you use them. You don't change them. This is made clear when you discover that
vi and friends are not recognised commands.
To my relief, though,
ed was. Had I not been so comfortable with the ed command set (which Vim also uses, to a degree) I would not have been as relieved.
While ed is a very crude tool in this day and age, it allowed me to do exactly what I wanted – it allowed me to open one of the library files, inject a few lines of code to enter the debugger without disturbing the flow of control, and then save the file. What more can you ask for when you desperately need just that?
People like to say that vi is installed on pretty much every Unix box in existence. Well, it's not. But ed, if anything, is. And it's similar enough to Vim that it still counts as a reason to learn Vim.