Field Guide for the Trapped
Quick fixes for when you just want to exit vim
Symptom: "Everything I type does weird stuff."
Likely cause: you're not in Insert mode.
Fix: press Esc once. Then once more because it's free.
Esc Esc
Symptom: ":q won't quit."
Likely cause: unsaved changes.
Fix options:
:wq "save and quit
:q! "quit without saving
:w "save but stay in Vim
:u "undo (repeat as needed)
Symptom: "I'm stuck in a prompt/search/help/something."
Likely cause: you're in a mini-mode inside Vim.
Fix: press Esc. If that didn't do it, press it again.
Esc Esc
Yes, I repeat that a lot. That's because it works a lot.
Symptom: "It's replaying a macro / I started something and it won't stop."
Likely cause: you're either recording a macro or playing one back.
If you're recording:
Press q again to stop recording.
q
If a macro is playing and you want it to stop right now:
Press Ctrl+C to interrupt, then press Esc to get back to Normal mode.
Ctrl+C
Esc
Bonus: if you were recording into a register like qa, the "stop" is still just q.
Symptom: "Vim is just… messed up."
Likely causes: Vim is having a day.
- Your
.vimrcor plugin config is throwing errors on startup. - The file is read‑only or the filesystem is mounted read‑only.
- A swap file exists, and Vim thinks another session is alive.
- Your terminal is in a weird state (mouse mode, paste mode, or wonky key mappings).
- You’re in a special mode (Replace, Visual Block, or Select) without realizing it.
Fix options:
- Start over clean:
vim -u NONE -U NONEto bypass config. - Force read/write:
:set noreadonlythen:w!if you really mean it. - Deal with swap:
:recoveror delete the swap file if it’s safe. - Normalize: hit Esc a few times, then
:set nopaste.
If all else fails, see the main page for the nuclear options.