// troubleshooting guide · vim
Vim E21: Cannot Make Changes, 'modifiable' Is Off
- Status
- Workaround available
- platforms:
- Linux, macOS, Windows
- updated:
- November 23, 2026
- reports:
- 4
- Method
- how we research
RUNBOOK · vim/modifiable-is-off-e213 FIXES
// quick answer
The buffer is locked: either Vim was started with -M or a plugin window (NERDTree, help, netrw) set nomodifiable. For a normal file run :set modifiable; in plugin windows use the plugin's own commands instead.
Most likely fix: Make a normal file editable
How to fix it
// try these in order, the most common fix is first
FIX 1Make a normal file editable
- 01Run :set modifiable (short :set ma)
- 02If it was opened read-only too, run :set noreadonly
- 03Or reopen the file without -M
Did this fix it?FIX 2Use the plugin's commands in plugin windows
- 01In NERDTree press m to open the menu and a to add a file instead of typing in the tree
- 02Switch to a file window with Ctrl+W w before editing
- 03Avoid :set ma in plugin buffers; saving then fails with E382 because buftype is set
Did this fix it?FIX 3Find the script that locks the buffer
- 01Run :verbose set modifiable? to see which script last changed it
- 02Disable or fix that autocommand or plugin
Did this fix it?
SANDBOX · vim RUNS IN YOUR BROWSER
Try it: write a commit message in Vim (and get back out)
A hands-on Vim-style sandbox, including the spots where users get stuck. See where problems like this one start. 1-2 minutes, nothing is saved.
Symptoms
Typing in Insert mode or pressing x, dd or p shows E21: Cannot make changes, 'modifiable' is off.
Why it happens
- C-01Vim launched with the -M flag (or as a view-only alias)
- C-02You are in a plugin or special buffer such as NERDTree, netrw, :help or a quickfix list
- C-03An autocommand or ftplugin set nomodifiable
// this guide also covers
- vim modifiable is off
- e21 cannot make changes
- vim cannot make changes
- nerdtree modifiable is off
Still not working?
If Vim keeps failing, you're not alone. See every Vim problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to us