In Vivo (solution)

by Michael Constant and Seth Schoen

This is a puzzle about the vi editor. It was inspired by the 2006 Mystery Hunt endgame puzzle where teams were supposed to type the text

I am diabolykal. verry h
 appy Zilllllyun

into NetHack, where, interpreted as a series of NetHack commands, it would get their character out of a sticky situation.

Here, solvers have to do roughly the reverse: given an editing problem, they need to find the fastest solution to that problem in vi (that is, the smallest number of keystrokes that will accomplish the given editing task). Note that the “task” does not consist only in making the buffer contain particular text; it also requires ending with a particular cursor position, and ending in insert mode or command mode, as indicated. To the best of our knowledge, the solutions here are the unique absolute minimum number of keystrokes required, and (although the screenshots are taken from vim) will work in any version of vi.

The solutions to these editing problems also happen to form English words, which are given in alphabetical order for confirmation. Click here to see the solutions (which are too wide for this page).

Many of the letters in the words are numbered with an acrostic-like ordering. Putting these letters in the specified order gives the apparently meaningless string

dtgerybrntuhdefolrehxdebpwctoarn

This string is also a series of vi editing commands which must be performed from the starting point given in the final editing problem. (It actually means “delete up to next ‘g’; go to end of word; replace character with ‘y’; go back to beginning of word; replace character with ‘n’; go up to next ‘u’; go left; delete to end of word; go to next ‘o’; go right; replace character with ‘e’; go left; delete character; delete to end of word; go back to beginning of word; paste back deletion buffer after current character position; go to beginning of next word; change up to next ‘o’ with text ‘arn’”.)

Click here to see the result of performing all these operations on this diabolykal text.

The Norwegian whose name, like Benedict Arnold’s, has become a byword for treason is VIDKUN QUISLING.

William S. Bergman
William S. Bergman