Why use Vim? That is OLD and uncool!!!
One thing that never changes in this industry is that change is ever constant. While things continue to change, there are some things that will never change. Now, you ask any younger developer what do you use to write code? You will get probably a few standard answers like VSCode, Atom, Sublime, etc. Mostly GUI based code editors. Now I am not here to bash those, I have used all kinds of them over the years. BUT, as a DevOps engineer, and a long time system administrator on *nix systems, those GUI tools are not available on a BSD or Linux machine after a fresh install of a server. There is no GUI at all on a Unix server. VI was created in the 70s at Bell Labs. It was included in the original Unix codebase, and is installed by default on every *nix based or like system I have ever touched. So knowing vim enough to survive the command line is almost a necessity. So lets dive into the history and why vi is a *nix staple.
History of vi
The vi editor was written by Bill Joy (future founder of Sun Microsystems) around 1976 while he was a graduate student at UC Berkley. "ed" was the original Unix text editor, a line oriented, designed for dumb terminals, and a real pain to use. "vi" stands for Visual Interface, and that is what Bill named it when he released it. It was designed with all the short commands in order to work the editor over a 1200 baud modem. Now for you children in the audience, this would be like getting a 2gig dsl line, inviting 10 friends over and ALL of you playing DayZ across that same dsl line. We are talking the days that openeing a simple 400x600 picture would take minutes. So all of this happened in the 70s. A lot of distros will put the original vi on the system by default and NOT any of the newer versions of vi
Improved versions of vi
The "improved" version of vi, or Vim, was released on November 2, 1991. It was written as a vi clone for the Amiga computer. It was pretty rapidly ported to all other operating systems. There have been tons of other clones of vi, some of the more noted ones Elvis, NeoVim, and Stevie. A modernized verion of vim is NeoVim, which is available on most *nix based systems. I have to be honest, I have never even tried NeoVim, not because of any reason other than I learned Vim and just use it. I have coded this entire website using Vim. I know some programmers that write ALL their code with Vim. Once you get use to it, there is no mouse needed, you do absolutely everything with the keyboard, so you do not move your hands away from the keyboard. Remember, vi was written 20 or so years before mice became a thing.
Emacs VS vi
One of the *nix holy wars is the vi VERSES emacs battle. Emacs was another really early editor that has a ton of features. Emacs to me, reminds me much more of a work processor. Now, the command structure of emacs is just as archaic and as steep a learning curve as vi is. Neither are just obvious to anyone the first time they fire them up and try to learn them. Emacs are not installed on any system by default that I have ever used, at least not to my memory. People who are into emacs are almost like a cult in their fervor for emacs. To each his own. Vim is keystroke compatible with MOST of the original vi keystrokes. Which is better? For me personally I am a vi and its decendents user. On every system, at least the original vi is there. I have never had a need nor honestly, a desire to learn emacs. Which is better? probably neither one. You look at them and decide what works for you.
Ok, you sold me on vi, how the hell do I learn it????
If you have access to Udemy, there are several really good classes on vim. I have been using vim since 1998 or
so, and I did the class a couple of months ago and learned a ton in it. I knew I was probably using 10% of the features
in my daily use of it. I probably overestimated my use. The class I did was "Mastering Vim" and was top notch. I
really suggest you look around and there are tons of courses on vim out there. Find one of the free ones and go through
it. I really do not suggest unless you have some type of photographic memory you try to go from never using vim
to knowing how to use it just from docs. The commands make much more sense with them telling you the words that
were behind the commands. Even if you never ever use vi(m) as a daily driver, having a basic knowledge of it will
be an excellent tool in your toolbox if you need to work on *nix based/like servers. As I find them I will make a list
below at the end of this post and I will add all the classes I can find that look good. I will especially hunt for
some decent ones that are free. I also have a copy of the vim pocket reference from O'reilly Publishing that I keep around.
The above link is a download to a vi(m) cheatsheet that I found on the internet. I
looked at it just now and I do not have the reference of where I got it. If this is your work and came from your website
please let me know the details so I can give you credit for your work. I never want someone to thing I am taking
credit for something someone else put a ton of work into. I am sure there are a 1000 cheatsheets for vim out there.
This is just one that I liked the way the data is presented.
so what are the reasons to never touch vim????
- I do not work on any Linux or BSD or even Unix ever.
- I will never do sysadmin work .
- I will never need to ever configure a service or server
Ok, short list for no, but why would I need it????
- I at least occasionally use Linux/BSD
- one of job functions I have involves server configuration.
- I am a nerd who wants to become a grey beard!!!!
- I want an editor that is available on every OS platform including windows
- I want to become proficient at configuring BSD/Linux servers on command line
- Because Barry told me to.
To be honest not everyone out there should go spend time learning vim in real detail. Knowing how to open a file, edit a file and save and close a file is enough. But, if your journey is down a System Admin/Infrastrure/DevOps engineering role, this it probably behooves you to look at vi(m) seriously. Happy command line hacking with Vim!!!