Buffers & Attachment
Why Vim refuses to be simplistic.
Buffers (practical)
A buffer is Vim's in-memory version of your text.
The file on disk is the "official record." The buffer is what you currently see on screen.
Buffers
The classic problem is thinking you're doing "a tiny edit":
- one quick fix
- one small rename
- one harmless search-and-replace
Then Vim asks if you want to save, and you're negotiating with your past and future self.
Two exits
:wq — keep the changes
:q! — throw the changes away