Vim’s Red Pill

I started this foray into Vim a few days ago. I’ve been talking with folks on
Mastodon.technology about exploring Vim and inspired by their learning and
exploration of this application that has been around publicly since 1991.

Vim is just a plain text editor, it’s ubiquitous on a lot of Linux and Unix
based operating systems, and less so on others. While I was in college the
professors in computer science were very fond of Emacs, so I sort of remember a
bit about Emacs and that I didn’t know Vim at all, nor did I really care for
it. Now that I’m older, I’m looking for new things to learn and Vim is quite a
good challenge for that.

The Learning Curve for Vim Resembles The Cliffs of Insanity

Learning this editor is a sheer climb straight up, on an imaginary learning
curve. There is very little that anyone who comes at Vim without any knowledge
of it will be able to understand. You get a little motd blurb on a blind open
with the name of the application and its version detail. You can’t really write
anything into the screen until you accidentally hit a command for getting into
the — INSERT — mode, like A, O, or I, or the lowercase equivalents. Over time
you start to accumulate more skills and you rely on the cheatsheets a lot less
than you were at the start.

Once the learning is done, then you start to move forward with the
customization part of the application. Vim is improved by plugins that enhance
or sometimes detract from the core use of the application. If you can get a
plugin to work, that is. Sometimes they just don’t, and there isn’t any clear
way to force the issue. Much of the plugins now live on GitHub, and sometimes
your mileage may vary when you are looking for help. For example, one plugin
which is for autocompletion at first seemed to be exactly what I was looking
for, but the fit wasn’t right for me. There is nothing on GitHub, for that
project, that even mentioned Q&A or anything like that. One thing that I have
learned is that sometimes when you add plugins to Vim, they can get “stuck” in
the Session system which forces you to dump your session details and start from
scratch. But once I was happy with how everything came together, it is a very
powerful editor.

Once You Pop A Red Pill, You Can’t Stop!

The first foray into Vim starts with editing. Then I started to look at some of
the other things that this editor could do. I fiddled a bit with Markdown, that
went well, and then afterwards I moved on to installing the Mutt mail
application. I have dwelled, perhaps malingered at Mac OSX Yosemite so when I
started to look into Mutt on my Macbook Pro, the Homebrew system complained a
lot about how some things would likely be broken because I was unwilling to
install the latest and greatest version of the Mac OSX operating system.
Everything worked out for the best in the end, and I got Mutt working for both
my Gmail account as well as my Office365 Hosted Exchange account at work. As a
funny side note, Mutt works well with IMAP servers however there was a bit of
skullduggery with the SMTP authenticator settings. For Mutt, this is the
general plan for a standard IMAP .muttrc file:

set ssl_starttls=yes
set ssl_force_tls=yes
set imap_user ='username@gmail.com'
set imap_pass = 'password'
set from='username@gmail.com'
set realname='First Last'
set folder = imaps://imap.gmail.com/
set spoolfile = imaps://imap.gmail.com/INBOX
set postponed="imaps://imap.gmail.com/[Gmail]/Drafts"
set header_cache ="~/.mutt/cache/headers"
set message_cachedir = "~/.mutt/cache/bodies"
set certificate_file = "~/.mutt/certificates"
set smtp_url ='smtp://username@gmail.com:password@smtp.gmail.com:587/'
set move = no
set imap_keepalive = 900
set smtp_authenticators = 'gssapi:login'
set signature ="~/.mutt/gmailsig"
unset sig_dashes

While the last bit, for smtp_authenticators simply won’t work with Office365.
To get that to work with Mutt, you’ll need this line in its place:

set smtp_authenticators = 'login'

Once I was able to get all that figured out, I then had another way to see my
email, through the Mutt email client. It wasn’t until this point, after being
able to login and logout, and receive new email and send new email that I
looked over my email to discover that almost all of it is HTML encoded. Which
makes reading it a headache in Mutt. But that wasn’t the point! The point was,
Mutt helped bring Vim closer to me. I may use it, or I might not. The HTML is a
definite headache so it’ll die a slow death because of HTML.

Distraction Free Writing

Vim’s editing powers are one part of it, the other part is the sheer speed and
usefulness of the application. There are a lot of systems that I use that seem
to have these little lags for text entry, like the system is always a few
microseconds behind registering what I want to do, which when typing in text,
is to do just that. It’s only slightly present on my Macbook, but often times
very present in apps on my iPhone. I’ll never know why user text input isn’t
the number one thing for any device to do first. Everything else can wait, be
put aside, but my typing? That should take top billing each and every time! So
with a full-screen iTerm2 screen, Vim is almost a killer app for distraction
free writing. I like line numbers on the side, and margins on either side, so
for me, this is almost a perfect arrangement. Plus the cost can’t be beat, Vim
is free. Another big draw for me is that Vim should be useful still even on
very low-powered computers, if it turns on, if it can run Linux (or Mac, or
Windows even) then it can run Vim.

Where Do We Go From Here?

We’ll see where I take Vim in the weeks to come. There is a lot of travel
coming up for me and I expect I’ll be doing a lot of blogging during it.
Writing everything out in Vim, saving it as Markdown, and then importing it
into WordPress. I suppose I could very well just email it into my blog as well,
we’ll have to work on that workflow in the future. Maybe I’ll find a WordPress
installation that works and be able to leverage Vim more directly with that
system. We shall see.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.