Ubuntu won't let me edit or delete .vimrc fileCan't save .bashrc file in VIM (“The swap file ”.bashrc.swp“ already exists!”)Recovery of vim running in screen session after crash of XorgVim change colorscheme and vimrc location fileReflect changes to file that .vimrc sourceshow to use my vimrc file when edit file width sudo commandVI won't let me save my vimrc fileNeed good example of .vimrc fileWhy do I get these .vimrc errors in Ubuntu 14 after upgrade from Ubuntu 13?Why won't Vim source my .vimrc at startup?How to write comment in .vimrc file?Can't find path to ~/.vimrc fileUnmet dependencies installing vim or vim-tiny

Can a character with the War Caster feat call a bolt with Call Lightning instead of making an opportunity attack?

Is there a simple example that empirical evidence is misleading?

Is it legal to have an abortion in another state or abroad?

Why isn't 'chemically-strengthened glass' made with potassium carbonate to begin with?

Why would a rational buyer offer to buy with no conditions precedent?

Do photons bend spacetime or not?

How to deal with a colleague who is being aggressive?

How do I disable login of user?

Is it legal to meet with potential future employers in the UK, whilst visiting from the USA

Dealing with spaghetti codebase, manager asks for things I can't deliver

Is there a context where the expression `a.b::c` makes sense?

Function argument returning void or non-void type

What's difference between "depends on" and "is blocked by" relations between issues in Jira next-gen board?

Is it possible to prohibit all prohibitable schools of magic with a single character?

Are runways booked by airlines to land their planes?

What weight should be given to writers groups critiques?

Job Market: should one hide their (young) age?

Does French have the English "short i" vowel?

Manager questioning my time estimates for a project

On San Andreas Speedruns, why do players blow up the Picador in the mission Ryder?

Why did other houses not demand this?

How to cut a climbing rope?

Drums and punctuation

How to keep consistency across the application architecture as a team grows?



Ubuntu won't let me edit or delete .vimrc file


Can't save .bashrc file in VIM (“The swap file ”.bashrc.swp“ already exists!”)Recovery of vim running in screen session after crash of XorgVim change colorscheme and vimrc location fileReflect changes to file that .vimrc sourceshow to use my vimrc file when edit file width sudo commandVI won't let me save my vimrc fileNeed good example of .vimrc fileWhy do I get these .vimrc errors in Ubuntu 14 after upgrade from Ubuntu 13?Why won't Vim source my .vimrc at startup?How to write comment in .vimrc file?Can't find path to ~/.vimrc fileUnmet dependencies installing vim or vim-tiny






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








6















I wanted to add set mouse=a to the .vimrc file to add point and click cursor, but the /etc/vim/vimrc file is read-only and won't allow me to edit or delete it. I tried to uninstall and reinstall vim but the .vimrc file remained unchanged.

Additionally when I try to edit it from terminal using



sudo vim /etc/vim/vimrc


it says



Found a swap file by name of 'filename'


Apparently it says I edited the same file twice.










share|improve this question
























  • this could help askubuntu.com/questions/736182/… and askubuntu.com/questions/883224/…

    – Lety
    May 10 at 9:59







  • 6





    Note that .vimrc and vimrc are not the same filename

    – wjandrea
    May 10 at 17:05











  • In this case, the solution is to edit a different file. But when you really do need sudo to edit a file, use sudoedit /etc/whatever instead of sudo vim /etc/whatever. (You'll need to add export EDITOR=/usr/bin/vim to ~/.bashrc.) You get your own .vimrc, not root's, and you can't run privileged shell commands from within vim.

    – AuxTaco
    May 10 at 20:06

















6















I wanted to add set mouse=a to the .vimrc file to add point and click cursor, but the /etc/vim/vimrc file is read-only and won't allow me to edit or delete it. I tried to uninstall and reinstall vim but the .vimrc file remained unchanged.

Additionally when I try to edit it from terminal using



sudo vim /etc/vim/vimrc


it says



Found a swap file by name of 'filename'


Apparently it says I edited the same file twice.










share|improve this question
























  • this could help askubuntu.com/questions/736182/… and askubuntu.com/questions/883224/…

    – Lety
    May 10 at 9:59







  • 6





    Note that .vimrc and vimrc are not the same filename

    – wjandrea
    May 10 at 17:05











  • In this case, the solution is to edit a different file. But when you really do need sudo to edit a file, use sudoedit /etc/whatever instead of sudo vim /etc/whatever. (You'll need to add export EDITOR=/usr/bin/vim to ~/.bashrc.) You get your own .vimrc, not root's, and you can't run privileged shell commands from within vim.

    – AuxTaco
    May 10 at 20:06













6












6








6








I wanted to add set mouse=a to the .vimrc file to add point and click cursor, but the /etc/vim/vimrc file is read-only and won't allow me to edit or delete it. I tried to uninstall and reinstall vim but the .vimrc file remained unchanged.

Additionally when I try to edit it from terminal using



sudo vim /etc/vim/vimrc


it says



Found a swap file by name of 'filename'


Apparently it says I edited the same file twice.










share|improve this question
















I wanted to add set mouse=a to the .vimrc file to add point and click cursor, but the /etc/vim/vimrc file is read-only and won't allow me to edit or delete it. I tried to uninstall and reinstall vim but the .vimrc file remained unchanged.

Additionally when I try to edit it from terminal using



sudo vim /etc/vim/vimrc


it says



Found a swap file by name of 'filename'


Apparently it says I edited the same file twice.







command-line vim vimrc






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 10 at 9:59









dessert

27.3k682115




27.3k682115










asked May 10 at 9:57









TistayuTistayu

333




333












  • this could help askubuntu.com/questions/736182/… and askubuntu.com/questions/883224/…

    – Lety
    May 10 at 9:59







  • 6





    Note that .vimrc and vimrc are not the same filename

    – wjandrea
    May 10 at 17:05











  • In this case, the solution is to edit a different file. But when you really do need sudo to edit a file, use sudoedit /etc/whatever instead of sudo vim /etc/whatever. (You'll need to add export EDITOR=/usr/bin/vim to ~/.bashrc.) You get your own .vimrc, not root's, and you can't run privileged shell commands from within vim.

    – AuxTaco
    May 10 at 20:06

















  • this could help askubuntu.com/questions/736182/… and askubuntu.com/questions/883224/…

    – Lety
    May 10 at 9:59







  • 6





    Note that .vimrc and vimrc are not the same filename

    – wjandrea
    May 10 at 17:05











  • In this case, the solution is to edit a different file. But when you really do need sudo to edit a file, use sudoedit /etc/whatever instead of sudo vim /etc/whatever. (You'll need to add export EDITOR=/usr/bin/vim to ~/.bashrc.) You get your own .vimrc, not root's, and you can't run privileged shell commands from within vim.

    – AuxTaco
    May 10 at 20:06
















this could help askubuntu.com/questions/736182/… and askubuntu.com/questions/883224/…

– Lety
May 10 at 9:59






this could help askubuntu.com/questions/736182/… and askubuntu.com/questions/883224/…

– Lety
May 10 at 9:59





6




6





Note that .vimrc and vimrc are not the same filename

– wjandrea
May 10 at 17:05





Note that .vimrc and vimrc are not the same filename

– wjandrea
May 10 at 17:05













In this case, the solution is to edit a different file. But when you really do need sudo to edit a file, use sudoedit /etc/whatever instead of sudo vim /etc/whatever. (You'll need to add export EDITOR=/usr/bin/vim to ~/.bashrc.) You get your own .vimrc, not root's, and you can't run privileged shell commands from within vim.

– AuxTaco
May 10 at 20:06





In this case, the solution is to edit a different file. But when you really do need sudo to edit a file, use sudoedit /etc/whatever instead of sudo vim /etc/whatever. (You'll need to add export EDITOR=/usr/bin/vim to ~/.bashrc.) You get your own .vimrc, not root's, and you can't run privileged shell commands from within vim.

– AuxTaco
May 10 at 20:06










2 Answers
2






active

oldest

votes


















20














User-specific changes like that should go in your personal .vimrc, which should be located in your home directory. If this file doesn’t exist yet you can simply create it. This will add your set line to ~/.vimrc creating this file if necessary:



echo 'set mouse=a' >>~/.vimrc


After that, either restart vim or source the file in a running instance with



:source ~/.vimrc


for the change to take effect.






share|improve this answer






























    9














    When vim gives you this warning, it also should give you some options at the bottom:



    [O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:


    Chose "R" if you want to recover whatever changes and "E" if you don't.



    If you persistently get this message, delete the swap file named.



    More information is found in the error message normally.






    share|improve this answer























    • This is only the case when vim didn't close correctly previously. In this case, he doesn't have permission to edit the file that he opened. If he wanted to edit the file, he should should so with sudo. However, the correct thing to do here is to edit the user config file instead of the system one.

      – Ben
      May 11 at 15:10











    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    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',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    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%2faskubuntu.com%2fquestions%2f1142064%2fubuntu-wont-let-me-edit-or-delete-vimrc-file%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









    20














    User-specific changes like that should go in your personal .vimrc, which should be located in your home directory. If this file doesn’t exist yet you can simply create it. This will add your set line to ~/.vimrc creating this file if necessary:



    echo 'set mouse=a' >>~/.vimrc


    After that, either restart vim or source the file in a running instance with



    :source ~/.vimrc


    for the change to take effect.






    share|improve this answer



























      20














      User-specific changes like that should go in your personal .vimrc, which should be located in your home directory. If this file doesn’t exist yet you can simply create it. This will add your set line to ~/.vimrc creating this file if necessary:



      echo 'set mouse=a' >>~/.vimrc


      After that, either restart vim or source the file in a running instance with



      :source ~/.vimrc


      for the change to take effect.






      share|improve this answer

























        20












        20








        20







        User-specific changes like that should go in your personal .vimrc, which should be located in your home directory. If this file doesn’t exist yet you can simply create it. This will add your set line to ~/.vimrc creating this file if necessary:



        echo 'set mouse=a' >>~/.vimrc


        After that, either restart vim or source the file in a running instance with



        :source ~/.vimrc


        for the change to take effect.






        share|improve this answer













        User-specific changes like that should go in your personal .vimrc, which should be located in your home directory. If this file doesn’t exist yet you can simply create it. This will add your set line to ~/.vimrc creating this file if necessary:



        echo 'set mouse=a' >>~/.vimrc


        After that, either restart vim or source the file in a running instance with



        :source ~/.vimrc


        for the change to take effect.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered May 10 at 10:02









        dessertdessert

        27.3k682115




        27.3k682115























            9














            When vim gives you this warning, it also should give you some options at the bottom:



            [O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:


            Chose "R" if you want to recover whatever changes and "E" if you don't.



            If you persistently get this message, delete the swap file named.



            More information is found in the error message normally.






            share|improve this answer























            • This is only the case when vim didn't close correctly previously. In this case, he doesn't have permission to edit the file that he opened. If he wanted to edit the file, he should should so with sudo. However, the correct thing to do here is to edit the user config file instead of the system one.

              – Ben
              May 11 at 15:10















            9














            When vim gives you this warning, it also should give you some options at the bottom:



            [O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:


            Chose "R" if you want to recover whatever changes and "E" if you don't.



            If you persistently get this message, delete the swap file named.



            More information is found in the error message normally.






            share|improve this answer























            • This is only the case when vim didn't close correctly previously. In this case, he doesn't have permission to edit the file that he opened. If he wanted to edit the file, he should should so with sudo. However, the correct thing to do here is to edit the user config file instead of the system one.

              – Ben
              May 11 at 15:10













            9












            9








            9







            When vim gives you this warning, it also should give you some options at the bottom:



            [O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:


            Chose "R" if you want to recover whatever changes and "E" if you don't.



            If you persistently get this message, delete the swap file named.



            More information is found in the error message normally.






            share|improve this answer













            When vim gives you this warning, it also should give you some options at the bottom:



            [O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:


            Chose "R" if you want to recover whatever changes and "E" if you don't.



            If you persistently get this message, delete the swap file named.



            More information is found in the error message normally.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered May 10 at 13:45









            didwefixitdidwefixit

            911




            911












            • This is only the case when vim didn't close correctly previously. In this case, he doesn't have permission to edit the file that he opened. If he wanted to edit the file, he should should so with sudo. However, the correct thing to do here is to edit the user config file instead of the system one.

              – Ben
              May 11 at 15:10

















            • This is only the case when vim didn't close correctly previously. In this case, he doesn't have permission to edit the file that he opened. If he wanted to edit the file, he should should so with sudo. However, the correct thing to do here is to edit the user config file instead of the system one.

              – Ben
              May 11 at 15:10
















            This is only the case when vim didn't close correctly previously. In this case, he doesn't have permission to edit the file that he opened. If he wanted to edit the file, he should should so with sudo. However, the correct thing to do here is to edit the user config file instead of the system one.

            – Ben
            May 11 at 15:10





            This is only the case when vim didn't close correctly previously. In this case, he doesn't have permission to edit the file that he opened. If he wanted to edit the file, he should should so with sudo. However, the correct thing to do here is to edit the user config file instead of the system one.

            – Ben
            May 11 at 15:10

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Ask Ubuntu!


            • 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%2faskubuntu.com%2fquestions%2f1142064%2fubuntu-wont-let-me-edit-or-delete-vimrc-file%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

            How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

            What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

            Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos