Skip to content

/errors/vim/e37-no-write-since-last-change

Vim: E37: No write since last change (add ! to override)

verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash) · VIM - Vi IMproved 9.2 (2026 Feb 14updated 2026-10-20
tool
Vim / Neovim
exit code
1
versions
Vim 8, Vim 9, Neovim
os
any

Vim refuses to abandon a buffer with unsaved changes. Commands that would leave it, such as :q, :e other.txt or :bnext, stop with E37: No write since last change (add ! to override). Nothing is lost: decide whether to save the changes or throw them away.

Reproduce it

Vim in batch mode (-es), without any configuration (-Nu NONE): add text, then try to open another file.

bash
printf 'one\n' > a.txt
vim -Nu NONE -i NONE -es \
  -c 'normal! Atwo' \
  -c 'silent! edit b.txt' \
  -c 'call writefile([v:errmsg], "error.txt")' \
  -c 'qa!' a.txt
cat error.txt
cat a.txt     # unchanged on disk: qa! discarded the edit

Output

E37: No write since last change (add ! to override)
one

What to type

GoalCommand
save and quit:wq or :x, or ZZ in normal mode
quit without saving:q! or ZQ
save everything and quit:wqa
quit everything, discard all changes:qa!
open another file, discard current changes:e! other.txt
reload this file from disk:e!
see which buffers are modified:ls (marked with +)

Switch files without saving first

vim
set hidden

With hidden (on by default in Neovim), :e, :bnext and friends keep the modified buffer open in the background instead of complaining. Vim still warns with E37 or E162 when you try to quit with modified buffers.

Sources