Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Gah. I never used ZZ, despite using zz all the time, so I went to my editor and started hammering the Z key and ended up closing most of my files.

Well played. This is a nice way to check whether you read the article first or last.

What's up with thirty different ways to exit vim? ZZ, :q, :wq, :x, good lord! Vim must be the most effective editor as long as you want to not use it. :)



I think you'd enjoy this then: https://github.com/hakluke/how-to-exit-vim.


This is far funnier, and informative, than I expected. Love the time out approach when aliased to 'vim'.


Hahaha. The emacs way is awesome.


Just use as little or much as you like. You don’t have to use every variant of a type of command.

Shift-zz is great as it uses only one hand and can be done in a rolling sort of movement.


In fairness, now that I know about ZZ I'm unlikely to use anything else.

Makes me wonder what'll happen if I type QQ, WW, EE, until getting through the whole keyboard. It'll probably summon Moloch.


Now you know how the pandemic happened.


It really should use two hands since z is a left pinky key (on qwerty, colemak, workman, qgmlwb) and left shift as well (so you should use right shift with it), but I'm aware many people don't use their right shift key. I only learned to a few years ago when relearning to type anyway.


:wq is still :q, just saving before exiting. The flavors are just different ways to deal with changes, with ZZ (:x) and ZQ (:q!) being aliases to the most useful ones.

This is not unique to vim, other editors handle it with prompts and buttons.


Then there's also :wqa and :xa, which are like :wq and :x except they apply to all open buffers instead of just the current one.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: