mirror of
https://github.com/hakluke/how-to-exit-vim.git
synced 2025-05-10 07:27:00 +02:00
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:
parent
d548420d77
commit
8fd36fee34
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue