From 8fd36fee342d085ab5ffe737e9a7d5b32a76b65f Mon Sep 17 00:00:00 2001 From: William Chargin Date: Tue, 7 Jan 2020 23:44:43 -0800 Subject: [PATCH] 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 --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 6610bd6..9dd8f98 100644 --- a/README.md +++ b/README.md @@ -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 +```