Trying to create a new file with nerd tree. I hit the a
key to create a new file and i get the message:
E21: Cannot make changes, \'Modifiable\' is of
:set ma
which is short for
:set modifiable
will make a buffer modifiable. And
:set noma
does the opposite.
If you want to happen a file in NERDTree, you need to hit "m" (for menu) then "a". Simply entering "a" in NERDTree buffer will be interpreted as "modify NERDTree buffer". Adding :ma will make NERDTree buffer modifiable, but this wont create new files for you, it will lead to inconsistent info between what NERDTree display and your actual file hierarchy.
In case anyone else happens to google to this, check that you're not trying to open a directory in vim like I just was (d'oh)
For me, I had stashed changes which included a directory I was then trying to create a file in that dir I had just stashed. NERDTree was still showing the pre-stashed tree with that dir. Using m
on a dir that does not exist produced the modifiable error. I should have refreshed the tree with r
to see the dir was no longer there and why it could not be modified.
This worked for me:
:set buftype=
:w
I am not familiar with NerdTree but I guess that by typing a into a nerdtree view, it is interpreted as " I want to append something in the nerdtree buffer", and that buffer is not modifiable.
You can check that answer vim and NERD Tree extension - adding a file which explains how to add a file with Nerdtree.