Learn more about Russian war crimes in Ukraine.

Learning vim (a short adventure)

I’m grudgingly learning to use vim.

It’s modal. There are two modes: insert and normal. The process begins in normal mode.

To switch from normal to insert, hit i. To switch from insert to normal, hit Esc.

To navigate, use hjkl, which correspond to left, down, up, right. It also seems to respond to the arrow keys in the same way.

One advantage of the arrow keys is that they work in insert mode.

You can move forwards and backwards in words by using w (forward one word) and b (back one word).

These skip to the starts of words.

You can use e to skip to the end of the word.

As is traditional, the cursor sits between characters and the visual block highlights the character after the cursor.

It’s pretty annoying when you don’t remember which mode you’re in. The display is not obvious enough. I assume in the worst case you accidentally issue commands which do arbitrary things.

You can do something n times by preceding the command with the number, e.g. 10b will skip back 10 words.

The escape key is annoyingly far away.

You can do (1 0 i f o o Esc) to insert “foo” ten times at the cursor.

It’s not clear how this works. The i here acts rather differently than if you just hit i.

When you start typing the number, there’s no visual output! It’s pretty easy to get lost in what you’ve just typed.

The skipping commands to go to end of word don’t actually put the cursor at the end of the word! They put it one character before that

The characters f and F find things. Actually, they just find characters, not substrings, which is kinda useless.

When a paren (or analogous) is highlighted, use % to jump to the matching other one. This is useful.

0 jumps to beginning of line. To jump to the end, use $, like regex.

The cursor seems incapable of sitting at the end of a line in normal mode! This is INFURIATING!

I’ve had enough

This is the stupidest flaw ever

bye vim:wq

What can computers do? What are the limits of mathematics? And just how busy can a busy beaver be? This year, I’m writing Busy Beavers, a unique interactive book on computability theory. You and I will take a practical and modern approach to answering these questions — or at least learning why some questions are unanswerable!

It’s only $19, and you can get 50% off if you find the discount code ... Not quite. Hackers use the console!

After months of secret toil, I and Andrew Carr released Everyday Data Science, a unique interactive online course! You’ll make the perfect glass of lemonade using Thompson sampling. You’ll lose weight with differential equations. And you might just qualify for the Olympics with a bit of statistics!

It’s $29, but you can get 50% off if you find the discount code ... Not quite. Hackers use the console!

More by Jim

Tagged . All content copyright James Fisher 2016. This post is not associated with my employer. Found an error? Edit this page.