How can I prevent VIM to set modifiable to off?
I have many files opened in VIM and when I want to navigate to a directory I use :E
. Sometimes (I cannot reproduce when) VIM sets modifiable
to off. When I go back to my file, I cannot make changes until I run :set modifiable
.
I want modifiable to be on always. How can I do this?
Seems that this question doesn't solve my problem...
The problem lies in the sometimes (I cannot reproduce when). Vim doesn't set this on its own, it's probably a plugin or other part of your configuration that runs amiss. Next time this happens, find out where this got set via
:verbose setlocal modifiable?
Once the root cause is known, you can do something about it.
If everything fails, and you also cannot / do not want to (temporarily, for testing) shut down plugins and configuration, the "big hammer" method would be an autocmd like this, which attempts to always turn off the option:
:autocmd BufWinEnter * setlocal modifiable
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With