/images/logo.png

Normal Mode

Rainbow Trails 1.0.0

I am DELIGHTED to announce the release of version 1.0.0 of Rainbow Trails. It contains a small but meaningful number of bug fixes and filed off edge cases, and includes a completely reworked and highly configurable new timing system allowing precise control over the speed the rainbows traverse the buffer. It also features some improvements to highlighting.

If you already use Rainbow Trails, it’s a substantial improvement. If you don’t already use Rainbow Trails, now is a great time to start!

Macro Conditional

The Question

After seeing the macro Game of Life, Benoit de Chezelles asked on Mastodon:

I replied:

But just because something isn’t practical, doesn’t mean it’s not possible, and so I decided to write this post to explain how you can write a macro that acts differently depending on whether anf,motion succeeds or fails.

The Challenge

Benoit politely declined to give me a real-life scenario where he needed this, so I whipped up the following CONTRIVED editing task.

Solving Advent of Code With Vim – Day 1, Part 2

I’ve never done Advent of Code before, and I wasn’t planning to do it this year1, but for some reason I decided to try my hand at solving the 2023 event’s Day 1’s challenges in Vim, using only its editing commands. (So ex commands are allowed, but Vimscript’s more programmerly constructs — functions, loops, conditionals, etc. — aren’t.)

It was fun!

So much fun, in fact, that I ended up carrying on and completing a bunch more of the challenges.2

A Novel Sorting Technique

I have devised an entirely new method of sorting numbers. Quicker1 than quicksort, more EFFERVESCENT than bubblesort, I present to you:

Vim Macro Sort

Vim Macro Sort uses NO Vimscript, NO chicanery with control characters, and it NEVER leaves normal mode. It’s just a plain old ASCII text file with a bunch of editing commands in it.

Bram Moolenaar 1961–2023

When I found out that Bram had died I posted a short thread on Mastodon, but I haven’t written anything here yet because I haven’t quite been able to work out why it hit me as hard as it did and what I wanted to say about it.

Two months on, I still haven’t really figured it out, so I’ll just say that, by all accounts, Bram was an exceptionally generous person, and note that in the handful of extremely limited interactions I had with him I always came away feeling positive, which hasn’t always been my experience with other open source projects.

Enabling Dictionary Completion Everywhere

Vim’s insert mode completion has a very nice feature where you can start typing a natural language word and then press Ctrl-XCtrl-K to complete it.

By default, it pulls the words used for the completions from the file specified with your 'dictionary' option, but this requires you to have such a file, which is not always1 the case for the computers I do my Vimmin’ on.

But there is a backup! If 'dictionary' is empty, and you have spell checking switched on, then Vim will use the active word list(s) from its spell checking feature for completion.

Yet Another Inappropriate Use of Macros

Tim Chase posted a clever little :substitute command on Twitter:

As always, my instinct was immediately to see if you can do it as a macro1.

You can. Here’s how:

qqqqq/\v(\\d)+\zs\\dEnterc2l{2}Esc@qq@qqq/\\d{\d}{2}EnterCtrl-All3x@qq@q