Save if buffer changed and close window
ZZ
Example
Normal 0 / 1Exited 1 / 1changed alpha
alpha two
alpha threeCursor on line 3, column 1Vim is closed
Save if buffer changed and close window.
Windows
- Window 1 · alpha.txt Active
80 columns × 23 lines
Buffers
- 2 · alpha.txt Active
loaded · listed · modified · changed alpha ↩ alpha two
Example files
- alpha.txt
alpha one ↩ alpha two ↩ alpha three- beta.txt
beta one ↩ beta two ↩ beta three- delta.txt
delta one ↩ delta two- gamma.txt
gamma one ↩ gamma two ↩ gamma three
Vim exited
Example files
- alpha.txt
changed alpha ↩ alpha two ↩ alpha three- beta.txt
beta one ↩ beta two ↩ beta three- delta.txt
delta one ↩ delta two- gamma.txt
gamma one ↩ gamma two ↩ gamma three
Before & after
changed alpha
alpha two
alpha threeCursor on line 3, column 1Windows
- Window 1 · alpha.txt Active
80 columns × 23 lines
Buffers
- 2 · alpha.txt Active
loaded · listed · modified · changed alpha ↩ alpha two
Example files
- alpha.txt
alpha one ↩ alpha two ↩ alpha three- beta.txt
beta one ↩ beta two ↩ beta three- delta.txt
delta one ↩ delta two- gamma.txt
gamma one ↩ gamma two ↩ gamma three
Vim is closed
Example files
- alpha.txt
changed alpha ↩ alpha two ↩ alpha three- beta.txt
beta one ↩ beta two ↩ beta three- delta.txt
delta one ↩ delta two- gamma.txt
gamma one ↩ gamma two ↩ gamma three
Start in Normal mode. alpha.txt has unsaved changes. This key actually closes the isolated Vim process; the final Files panel proves whether those changes were saved.
Details & Vim help
Example replayed in Vim
Save if buffer changed and close window. Use in Normal mode. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.