Add the consonant cluster way

I came up with this a few years ago. It's my favorite esoteric way to
exit Vim simply because of its cryptic aesthetic.

Explanation: `qqq` clears register `q` (by recording an empty macro into
it), then `qq` starts recording a macro into register `q`. `ZZ` saves
and closes the current file. `@q` executes the macro in `q`, which is
currently empty thanks to our initial `qqq`. `q` stops recording the
macro. Then, `@q` executes the macro in `q`. When it gets to `@q`, it
recursively executes itself, so in effect it repeatedly executes `ZZ`
until Vim quits.

This of course doesn't work if some buffers can't be saved (e.g., they
have no names), but that's just part of the fun!

wchargin-branch: consonant-cluster
This commit is contained in:
William Chargin 2020-01-07 23:44:43 -08:00
parent d548420d77
commit 8fd36fee34

View file

@ -378,3 +378,12 @@ Credit: @axelf4
```vim
:echom test_null_list()
```
## The consonant cluster way
Credit: @wchargin
To exit, saving all files, simply incant (in normal mode):
```vim
qqqqqZZ@qq@q
```