vim7

seven, +/- two

Hello, world! :wq

This is coming to you live from a Vim terminal! Or is it a buffer? An insert mode thingie? Well, whatever it is, I am writing this in Vim.

Long have I sought to vanquish the infamous learning curve. Many a time have I tumbled back to the bottom, into the warm embrace of PyCharm, Sublime, Atom, literally anything else (except Emacs). Well, this year is the year. I am now halfway up (maybe?) the learning curve and enjoying it. I hereby proclaim I am not going back. No! Never! I have dotfiles to prove it!

What Vim?

I assume most people have a similarly horrible first impression with Vim. You get dropped into Vim sometimes, on servers and iirc on unconfigured git diffs, and then you flail around there, not understanding how to exit or scroll or where you even are ("Is this an editor? What is this?"). In other words, it is an unfriendly text editor (built into your shell? I think?).

Why Vim?

But, beyond supreme nerd cred (always a worthy goal in and of itself), why Vim? Here were my reasons:

  • Lightweight. Until now, I was using PyCharm for most of my development. It has pros and cons. Several pros: multiple cursors, jumping to definitions and usages of any function or variable, lots of gentle UX nudges of how bad your code is (e.g. grayed-out unused objects, auto-linting), and so on. It had three notable cons: it's not free, it takes forever to load, and - most importantly - configuring it was not only a dotfile away.
  • Dotfile-able. Readers will remember I love dotfiles, and, indeed, most of them withstood the ultimate test: getting a new machine set up. My Macbook was basically dead (btw Macbooks die so early these days wtf), and I needed to quickly spin up a new one. And I did! It didn't take long! Except, oddly and ominously, on PyCharm, which suddenly had a super weird keymap - rendering all my typing so painful, like trying to write with my non-dominant hand. No, no nooo.
  • Programmatical. I have been quite swayed by the promises of Vim letting you type "as fast as you think". Thought and words/code! As one! United! Very exciting. Also, this blog post by thoughtbot really convinced me to take the plunge - tldr: they claim it'll only be a week before you're "as fast as before", and that, thus, everything after the first week is just gains.

A few of my favorite Vim things, so far

Well, it's been less than a week, but I do feel like I'm now about as productive as I was before (!!!). Which is already amazing. Also, Vim has been impressing me with lots of little wing-dings and doo-dads. Yes, I am still annoyed I can't just mouse and scroll IN THE USUAL FASHION, as I have for lo these many many computing years, but maybe the programmaticalness will win me over completely?

Here are some nice things I've enjoyed so far:

  • I love being able to run any shell command from Vim, e.g., I could run !make html && make serve right now and I would see my blog on a local server, and I wouldn't have to leave Vim. There. I just did it.
  • To make up for the lack of mouse, there are a great many ways to search and find things, with (seemingly) any and all levels of precison. If you know the line number, it's just :[line number]. If you know the word, it's just /[word]. If you know it's somewhere down there in the code, you can try shift+} or ctrl+F or shift+G. Many options!
  • yank and put. I have been yanking (copying) and putting multiple lines, and it's so easy: :[starting line number],[ending line number]y and :[line to move it to]pu.
  • CtrlP: aka, fuzzy search through files (like in Atom).
  • <leader> + d goto the definition (thanks to jedi-vim).

Resources