Understanding modifiable in Vim











up vote
3
down vote

favorite












During a OS upgrade (Linux), Vim or some part of it has been updated as well.



Now it happens that sometimes when I save a file (the file is not saved) I get this error:




E21: Cannot make changes, 'modifiable' is off




I did :help E21 and the manual says:



        {not in Vi}     *E21*
When off the buffer contents cannot be changed. The 'fileformat' and
'fileencoding' options also can't be changed.
Can be reset with the |-M| command line argument.


It's not clear to me what it means. I use and start the editor the usual way, nothing is changed. The workflow is the same, too. I open different windows with CTLR-W N, then load and edit files there and switch between windows, etc.



I'd like to know how to disable this behavior and about side effects.










share|improve this question




























    up vote
    3
    down vote

    favorite












    During a OS upgrade (Linux), Vim or some part of it has been updated as well.



    Now it happens that sometimes when I save a file (the file is not saved) I get this error:




    E21: Cannot make changes, 'modifiable' is off




    I did :help E21 and the manual says:



            {not in Vi}     *E21*
    When off the buffer contents cannot be changed. The 'fileformat' and
    'fileencoding' options also can't be changed.
    Can be reset with the |-M| command line argument.


    It's not clear to me what it means. I use and start the editor the usual way, nothing is changed. The workflow is the same, too. I open different windows with CTLR-W N, then load and edit files there and switch between windows, etc.



    I'd like to know how to disable this behavior and about side effects.










    share|improve this question


























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      During a OS upgrade (Linux), Vim or some part of it has been updated as well.



      Now it happens that sometimes when I save a file (the file is not saved) I get this error:




      E21: Cannot make changes, 'modifiable' is off




      I did :help E21 and the manual says:



              {not in Vi}     *E21*
      When off the buffer contents cannot be changed. The 'fileformat' and
      'fileencoding' options also can't be changed.
      Can be reset with the |-M| command line argument.


      It's not clear to me what it means. I use and start the editor the usual way, nothing is changed. The workflow is the same, too. I open different windows with CTLR-W N, then load and edit files there and switch between windows, etc.



      I'd like to know how to disable this behavior and about side effects.










      share|improve this question















      During a OS upgrade (Linux), Vim or some part of it has been updated as well.



      Now it happens that sometimes when I save a file (the file is not saved) I get this error:




      E21: Cannot make changes, 'modifiable' is off




      I did :help E21 and the manual says:



              {not in Vi}     *E21*
      When off the buffer contents cannot be changed. The 'fileformat' and
      'fileencoding' options also can't be changed.
      Can be reset with the |-M| command line argument.


      It's not clear to me what it means. I use and start the editor the usual way, nothing is changed. The workflow is the same, too. I open different windows with CTLR-W N, then load and edit files there and switch between windows, etc.



      I'd like to know how to disable this behavior and about side effects.







      linux vim






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 25 at 23:57









      Rui F Ribeiro

      38.3k1477127




      38.3k1477127










      asked Jun 10 '12 at 20:49









      Paolo

      5,04772136




      5,04772136






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          5
          down vote



          accepted










          You can use :verbose set modifiable? to find out if a plugin is setting the option. If the option has been modified by a plugin, it will show Last set from /path/to/plugin/file (in addition to showing the value).



          Maybe you are using the Netrw plugin. It comes bundled with Vim and handles “editing” local directories (listing the contents, picking files to view/edit) and remote file/directory access. I know it twiddles modifiable (and some other options). There may be a bug in the version bundled with your updated Vim. You can check the version number of the active installation of Netrw with :echo g:loaded_netrwPlugin.



          If the problem seems to be related to Netrw, you might try installing another released version, or maybe a development version.






          share|improve this answer























          • Thanks for the info. That was indeed a bug in Netrw. groups.google.com/d/msg/vim_dev/8K6qsQrpD5Y/MPQi5CHS89cJ
            – Paolo
            Jun 11 '12 at 10:08




















          up vote
          4
          down vote













          This happens when you open a file that is read-only. Check the file permissions: it seems that your user doesn't have write permission on the file. Or maybe the filesystem is mounted read-only (check with df /path/to/file to see on what filesystem the file is, and use mount or cat /proc/mounts to see the mount options).



          A different possibility would be a buggy decoding plugin, but then I'd expect other error messages.






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f40457%2funderstanding-modifiable-in-vim%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            5
            down vote



            accepted










            You can use :verbose set modifiable? to find out if a plugin is setting the option. If the option has been modified by a plugin, it will show Last set from /path/to/plugin/file (in addition to showing the value).



            Maybe you are using the Netrw plugin. It comes bundled with Vim and handles “editing” local directories (listing the contents, picking files to view/edit) and remote file/directory access. I know it twiddles modifiable (and some other options). There may be a bug in the version bundled with your updated Vim. You can check the version number of the active installation of Netrw with :echo g:loaded_netrwPlugin.



            If the problem seems to be related to Netrw, you might try installing another released version, or maybe a development version.






            share|improve this answer























            • Thanks for the info. That was indeed a bug in Netrw. groups.google.com/d/msg/vim_dev/8K6qsQrpD5Y/MPQi5CHS89cJ
              – Paolo
              Jun 11 '12 at 10:08

















            up vote
            5
            down vote



            accepted










            You can use :verbose set modifiable? to find out if a plugin is setting the option. If the option has been modified by a plugin, it will show Last set from /path/to/plugin/file (in addition to showing the value).



            Maybe you are using the Netrw plugin. It comes bundled with Vim and handles “editing” local directories (listing the contents, picking files to view/edit) and remote file/directory access. I know it twiddles modifiable (and some other options). There may be a bug in the version bundled with your updated Vim. You can check the version number of the active installation of Netrw with :echo g:loaded_netrwPlugin.



            If the problem seems to be related to Netrw, you might try installing another released version, or maybe a development version.






            share|improve this answer























            • Thanks for the info. That was indeed a bug in Netrw. groups.google.com/d/msg/vim_dev/8K6qsQrpD5Y/MPQi5CHS89cJ
              – Paolo
              Jun 11 '12 at 10:08















            up vote
            5
            down vote



            accepted







            up vote
            5
            down vote



            accepted






            You can use :verbose set modifiable? to find out if a plugin is setting the option. If the option has been modified by a plugin, it will show Last set from /path/to/plugin/file (in addition to showing the value).



            Maybe you are using the Netrw plugin. It comes bundled with Vim and handles “editing” local directories (listing the contents, picking files to view/edit) and remote file/directory access. I know it twiddles modifiable (and some other options). There may be a bug in the version bundled with your updated Vim. You can check the version number of the active installation of Netrw with :echo g:loaded_netrwPlugin.



            If the problem seems to be related to Netrw, you might try installing another released version, or maybe a development version.






            share|improve this answer














            You can use :verbose set modifiable? to find out if a plugin is setting the option. If the option has been modified by a plugin, it will show Last set from /path/to/plugin/file (in addition to showing the value).



            Maybe you are using the Netrw plugin. It comes bundled with Vim and handles “editing” local directories (listing the contents, picking files to view/edit) and remote file/directory access. I know it twiddles modifiable (and some other options). There may be a bug in the version bundled with your updated Vim. You can check the version number of the active installation of Netrw with :echo g:loaded_netrwPlugin.



            If the problem seems to be related to Netrw, you might try installing another released version, or maybe a development version.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jan 2 '16 at 18:38









            Community

            1




            1










            answered Jun 11 '12 at 3:16









            Chris Johnsen

            14.5k64847




            14.5k64847












            • Thanks for the info. That was indeed a bug in Netrw. groups.google.com/d/msg/vim_dev/8K6qsQrpD5Y/MPQi5CHS89cJ
              – Paolo
              Jun 11 '12 at 10:08




















            • Thanks for the info. That was indeed a bug in Netrw. groups.google.com/d/msg/vim_dev/8K6qsQrpD5Y/MPQi5CHS89cJ
              – Paolo
              Jun 11 '12 at 10:08


















            Thanks for the info. That was indeed a bug in Netrw. groups.google.com/d/msg/vim_dev/8K6qsQrpD5Y/MPQi5CHS89cJ
            – Paolo
            Jun 11 '12 at 10:08






            Thanks for the info. That was indeed a bug in Netrw. groups.google.com/d/msg/vim_dev/8K6qsQrpD5Y/MPQi5CHS89cJ
            – Paolo
            Jun 11 '12 at 10:08














            up vote
            4
            down vote













            This happens when you open a file that is read-only. Check the file permissions: it seems that your user doesn't have write permission on the file. Or maybe the filesystem is mounted read-only (check with df /path/to/file to see on what filesystem the file is, and use mount or cat /proc/mounts to see the mount options).



            A different possibility would be a buggy decoding plugin, but then I'd expect other error messages.






            share|improve this answer

























              up vote
              4
              down vote













              This happens when you open a file that is read-only. Check the file permissions: it seems that your user doesn't have write permission on the file. Or maybe the filesystem is mounted read-only (check with df /path/to/file to see on what filesystem the file is, and use mount or cat /proc/mounts to see the mount options).



              A different possibility would be a buggy decoding plugin, but then I'd expect other error messages.






              share|improve this answer























                up vote
                4
                down vote










                up vote
                4
                down vote









                This happens when you open a file that is read-only. Check the file permissions: it seems that your user doesn't have write permission on the file. Or maybe the filesystem is mounted read-only (check with df /path/to/file to see on what filesystem the file is, and use mount or cat /proc/mounts to see the mount options).



                A different possibility would be a buggy decoding plugin, but then I'd expect other error messages.






                share|improve this answer












                This happens when you open a file that is read-only. Check the file permissions: it seems that your user doesn't have write permission on the file. Or maybe the filesystem is mounted read-only (check with df /path/to/file to see on what filesystem the file is, and use mount or cat /proc/mounts to see the mount options).



                A different possibility would be a buggy decoding plugin, but then I'd expect other error messages.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jun 11 '12 at 0:38









                Gilles

                523k12610441576




                523k12610441576






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f40457%2funderstanding-modifiable-in-vim%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Morgemoulin

                    Scott Moir

                    Souastre