vim “modifiable” is off

后端 未结 7 1035
悲&欢浪女
悲&欢浪女 2021-01-29 23:08

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

7条回答
  •  南方客
    南方客 (楼主)
    2021-01-29 23:56

    Ok, this may not be the most informed answer as I barely have a working knowledge of vim or linux, But I have found to solution to my problem and it may work for you to. To be specific, My problem was twofold:

    1) whenever i tried to edit something in this new file i created, i got the Cannot make changes, 'Modifiable' is off error and...

    2) after running :set modifiable and trying to save, i would get an e382 error of 'cannot write, buftype is set. so i couldn't save.

    After pouring throuch scads of useless cryptic documentation i figured out this:

    1) find the .vimviews directory, for me it was at the root of my git repository, do an

    ls 
    

    inside it. i got something like this:

    ~=+www-halo=+test=+lib=+Halo=+Return2=+HeaderTest.php=
    ~=+www-halo=+test=+lib=+Halo=+Service=+LandmarkTest.php=
    ~=+www-halo=+test=+lib=+Halo=+Transaction=+AuthnetTest.php=
    

    Which is totally useless to you since you have a different file structure. but look for the file that is giving you the problem. (oh btw, these are in fact file names, which is completely not obvious by looking at them). find the one that has the file in question and delete that sucker: example:

    rm ~=+www-halo=+test=+lib=+Halo=+Return2=+HeaderTest.php=
    

    Problem solved.

提交回复
热议问题