I can’t remember the first time I used Vi or Vim.
What I do remember is an old colleague espousing its virtues and after being wowed by the power of Vim macros I knew it was time to switch (I was briefly a Emacs user but never got on with the infamous kitchen-sinkiness of it, or the Lisp dialect config files).
That was over 20 years ago and Vim has remained my editor of choice ever since (I’ve had dalliances with TextMate, Sublime Text and Atom but an editor has to work in a terminal for me).
(Annoyingly I somehow managed to avoid Vim on the Amiga when it was released in 1991, although it would have taken a lot to sway me from the great CygnusED text editor of the time).
You would think over the years my ~/.vimrc configuration file would grow to be pretty unwieldy but it’s still a fairly lean 200 lines or so, a third of which are comments.
As I’m frequently flitting between servers getting to be used to a fairly basic Vim config can be advantageous, but on my main development machine I do afford myself the luxury of a few plugins.
As Ruby on Rails development is my main bread and butter, most of the extensions I use are focused on helping me write better code, quicker.
Here are some of my current favourites :
Vundle – I still use Vundle as a package manager for the majority of my plugins, although vim-plug (https://github.com/junegunn/vim-plug) might take its place soon.
ctrlpÂ – lovely, fuzzy fast file searching.
vim-railsÂ – naturally. Shortcuts like :Econtroller and :Emodel and fast switching/jumping between Rails MVC files make this a winner.
dash – to prove I actually do something outside of a console, this plugin integrates with the macOS Dash app for programmer documentation and means I can just hit a shortcut on any keyword or declaration and open up the Dash app with the docs for it freshly loaded.
vim-gitgutterÂ – does one job well, effectively doing a real-time git diff of the file being viewed, highlighting any differences with a +/- in the left-most column. Couldn’t live without it.
rubocop – I love being able to launch Rubocop from inside Vim to see where my code doesn’t follow best practises. Highly recommended.
ack – ‘grep on steroids’ is an accurate description of the Ack search tool (https://beyondgrep.com) and the integration with Vim using this plugin is awesome, opening a quick list window for any files matching the search term.
I also have RipGrep installed which is somewhat faster, but my muscle memory is so used to using Ack it’s hard to switch (and my projects have ~/.ackrc files defining what files/folders which I’m too lazy to update).
There’s also a nostalgic part of my that loves that I’m still using a part of the Perl ecosystem on a daily basis in 2020 (yep – ex-Perl hacker here).
I’m pretty much reconciled to the fact that I’ll be using Vim for the rest of my days (the final :q!) – and I’m fine with that.
That said, I have been casting a few envious glances to the VS Code recently and I may give that a spin soon to see if there’s something I’m missing out on, before inevitably returning to the greatest IDE of them all – Vim and a command-line.