Can't find path to ~/.vimrc file











up vote
11
down vote

favorite
5












I've read plenty of post on how to change the tab length in my vim editor, but only temporary changes.



I want to make the configuration permanent and my understanding is that I can configure it in the file mentioned above.



I've tried:



vim ~/.vimrc


In my home directory with no results. This just opens a new file with the name.










share|improve this question
























  • Well just enter set tabstop=<whatever> in the empty file...
    – LittleByBlue
    Jul 15 '16 at 10:00








  • 1




    btw you should remember nano ~/.vimrc, if you messed something up!
    – LittleByBlue
    Jul 15 '16 at 10:02















up vote
11
down vote

favorite
5












I've read plenty of post on how to change the tab length in my vim editor, but only temporary changes.



I want to make the configuration permanent and my understanding is that I can configure it in the file mentioned above.



I've tried:



vim ~/.vimrc


In my home directory with no results. This just opens a new file with the name.










share|improve this question
























  • Well just enter set tabstop=<whatever> in the empty file...
    – LittleByBlue
    Jul 15 '16 at 10:00








  • 1




    btw you should remember nano ~/.vimrc, if you messed something up!
    – LittleByBlue
    Jul 15 '16 at 10:02













up vote
11
down vote

favorite
5









up vote
11
down vote

favorite
5






5





I've read plenty of post on how to change the tab length in my vim editor, but only temporary changes.



I want to make the configuration permanent and my understanding is that I can configure it in the file mentioned above.



I've tried:



vim ~/.vimrc


In my home directory with no results. This just opens a new file with the name.










share|improve this question















I've read plenty of post on how to change the tab length in my vim editor, but only temporary changes.



I want to make the configuration permanent and my understanding is that I can configure it in the file mentioned above.



I've tried:



vim ~/.vimrc


In my home directory with no results. This just opens a new file with the name.







vim vimrc






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 4 at 21:22









guntbert

9,048133069




9,048133069










asked Jul 15 '16 at 8:50









Øystein Seel

2121413




2121413












  • Well just enter set tabstop=<whatever> in the empty file...
    – LittleByBlue
    Jul 15 '16 at 10:00








  • 1




    btw you should remember nano ~/.vimrc, if you messed something up!
    – LittleByBlue
    Jul 15 '16 at 10:02


















  • Well just enter set tabstop=<whatever> in the empty file...
    – LittleByBlue
    Jul 15 '16 at 10:00








  • 1




    btw you should remember nano ~/.vimrc, if you messed something up!
    – LittleByBlue
    Jul 15 '16 at 10:02
















Well just enter set tabstop=<whatever> in the empty file...
– LittleByBlue
Jul 15 '16 at 10:00






Well just enter set tabstop=<whatever> in the empty file...
– LittleByBlue
Jul 15 '16 at 10:00






1




1




btw you should remember nano ~/.vimrc, if you messed something up!
– LittleByBlue
Jul 15 '16 at 10:02




btw you should remember nano ~/.vimrc, if you messed something up!
– LittleByBlue
Jul 15 '16 at 10:02










2 Answers
2






active

oldest

votes

















up vote
17
down vote



accepted










The path is correct but the file doesn't exist yet. It is not created by default because it's an optional way to configure your own settings.



Like with any text editor, when you call vim and enter the name of a file that doesn't exist (or is blank) it opens a blank file with that name, that's why



vim ~/.vimrc


opens an empty file. Press i, write something, and then save the file somehow by typing esc:wenter and now you have a ~/.vimrc



Should you need one, you will find an example for ~/.vimrc somewhere in /usr/share/vim/. On my system it's /usr/share/vim/vim74/vimrc_example.vim



Inside it tells you what to do if you want to use it:



" An example for a vimrc file.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2016 Mar 25
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc


Lazy way to find it:



sudo updatedb && locate vimrc


Otherwise, you can make your own from scratch. Here's one wiki with some guidance on making ~/.vimrc.






share|improve this answer



















  • 1




    +1 for the wiki, but there is no need to copy the file. just create a new one.
    – LittleByBlue
    Jul 15 '16 at 10:03






  • 2




    what you needed to say was , if you try to open a file that doesn't exist with vi it will open an empty file which if saved (Esc : w enter) will create the file you want.
    – Amias
    Jul 15 '16 at 10:21










  • @Amias thanks for that, I couldn't quite get my words out ^_^ I have edited to make it clearer thanks to your input
    – Zanna
    Jul 15 '16 at 12:52


















up vote
3
down vote













The easiest way to create a ~/.vimrc file, and have an excellent starting point for your own explorations, is to run the following from a Terminal window:



cp -v /usr/share/vim/vim*/vimrc_example.vim ~/.vimrc


Open this file with you favorite text editor and start exploring, the file is well commented and there are also endless examples on the Internet to experiment with...






share|improve this answer























    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',
    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%2f798864%2fcant-find-path-to-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








    up vote
    17
    down vote



    accepted










    The path is correct but the file doesn't exist yet. It is not created by default because it's an optional way to configure your own settings.



    Like with any text editor, when you call vim and enter the name of a file that doesn't exist (or is blank) it opens a blank file with that name, that's why



    vim ~/.vimrc


    opens an empty file. Press i, write something, and then save the file somehow by typing esc:wenter and now you have a ~/.vimrc



    Should you need one, you will find an example for ~/.vimrc somewhere in /usr/share/vim/. On my system it's /usr/share/vim/vim74/vimrc_example.vim



    Inside it tells you what to do if you want to use it:



    " An example for a vimrc file.
    "
    " Maintainer: Bram Moolenaar <Bram@vim.org>
    " Last change: 2016 Mar 25
    "
    " To use it, copy it to
    " for Unix and OS/2: ~/.vimrc


    Lazy way to find it:



    sudo updatedb && locate vimrc


    Otherwise, you can make your own from scratch. Here's one wiki with some guidance on making ~/.vimrc.






    share|improve this answer



















    • 1




      +1 for the wiki, but there is no need to copy the file. just create a new one.
      – LittleByBlue
      Jul 15 '16 at 10:03






    • 2




      what you needed to say was , if you try to open a file that doesn't exist with vi it will open an empty file which if saved (Esc : w enter) will create the file you want.
      – Amias
      Jul 15 '16 at 10:21










    • @Amias thanks for that, I couldn't quite get my words out ^_^ I have edited to make it clearer thanks to your input
      – Zanna
      Jul 15 '16 at 12:52















    up vote
    17
    down vote



    accepted










    The path is correct but the file doesn't exist yet. It is not created by default because it's an optional way to configure your own settings.



    Like with any text editor, when you call vim and enter the name of a file that doesn't exist (or is blank) it opens a blank file with that name, that's why



    vim ~/.vimrc


    opens an empty file. Press i, write something, and then save the file somehow by typing esc:wenter and now you have a ~/.vimrc



    Should you need one, you will find an example for ~/.vimrc somewhere in /usr/share/vim/. On my system it's /usr/share/vim/vim74/vimrc_example.vim



    Inside it tells you what to do if you want to use it:



    " An example for a vimrc file.
    "
    " Maintainer: Bram Moolenaar <Bram@vim.org>
    " Last change: 2016 Mar 25
    "
    " To use it, copy it to
    " for Unix and OS/2: ~/.vimrc


    Lazy way to find it:



    sudo updatedb && locate vimrc


    Otherwise, you can make your own from scratch. Here's one wiki with some guidance on making ~/.vimrc.






    share|improve this answer



















    • 1




      +1 for the wiki, but there is no need to copy the file. just create a new one.
      – LittleByBlue
      Jul 15 '16 at 10:03






    • 2




      what you needed to say was , if you try to open a file that doesn't exist with vi it will open an empty file which if saved (Esc : w enter) will create the file you want.
      – Amias
      Jul 15 '16 at 10:21










    • @Amias thanks for that, I couldn't quite get my words out ^_^ I have edited to make it clearer thanks to your input
      – Zanna
      Jul 15 '16 at 12:52













    up vote
    17
    down vote



    accepted







    up vote
    17
    down vote



    accepted






    The path is correct but the file doesn't exist yet. It is not created by default because it's an optional way to configure your own settings.



    Like with any text editor, when you call vim and enter the name of a file that doesn't exist (or is blank) it opens a blank file with that name, that's why



    vim ~/.vimrc


    opens an empty file. Press i, write something, and then save the file somehow by typing esc:wenter and now you have a ~/.vimrc



    Should you need one, you will find an example for ~/.vimrc somewhere in /usr/share/vim/. On my system it's /usr/share/vim/vim74/vimrc_example.vim



    Inside it tells you what to do if you want to use it:



    " An example for a vimrc file.
    "
    " Maintainer: Bram Moolenaar <Bram@vim.org>
    " Last change: 2016 Mar 25
    "
    " To use it, copy it to
    " for Unix and OS/2: ~/.vimrc


    Lazy way to find it:



    sudo updatedb && locate vimrc


    Otherwise, you can make your own from scratch. Here's one wiki with some guidance on making ~/.vimrc.






    share|improve this answer














    The path is correct but the file doesn't exist yet. It is not created by default because it's an optional way to configure your own settings.



    Like with any text editor, when you call vim and enter the name of a file that doesn't exist (or is blank) it opens a blank file with that name, that's why



    vim ~/.vimrc


    opens an empty file. Press i, write something, and then save the file somehow by typing esc:wenter and now you have a ~/.vimrc



    Should you need one, you will find an example for ~/.vimrc somewhere in /usr/share/vim/. On my system it's /usr/share/vim/vim74/vimrc_example.vim



    Inside it tells you what to do if you want to use it:



    " An example for a vimrc file.
    "
    " Maintainer: Bram Moolenaar <Bram@vim.org>
    " Last change: 2016 Mar 25
    "
    " To use it, copy it to
    " for Unix and OS/2: ~/.vimrc


    Lazy way to find it:



    sudo updatedb && locate vimrc


    Otherwise, you can make your own from scratch. Here's one wiki with some guidance on making ~/.vimrc.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Sep 8 '16 at 21:32

























    answered Jul 15 '16 at 9:07









    Zanna

    49.4k13127236




    49.4k13127236








    • 1




      +1 for the wiki, but there is no need to copy the file. just create a new one.
      – LittleByBlue
      Jul 15 '16 at 10:03






    • 2




      what you needed to say was , if you try to open a file that doesn't exist with vi it will open an empty file which if saved (Esc : w enter) will create the file you want.
      – Amias
      Jul 15 '16 at 10:21










    • @Amias thanks for that, I couldn't quite get my words out ^_^ I have edited to make it clearer thanks to your input
      – Zanna
      Jul 15 '16 at 12:52














    • 1




      +1 for the wiki, but there is no need to copy the file. just create a new one.
      – LittleByBlue
      Jul 15 '16 at 10:03






    • 2




      what you needed to say was , if you try to open a file that doesn't exist with vi it will open an empty file which if saved (Esc : w enter) will create the file you want.
      – Amias
      Jul 15 '16 at 10:21










    • @Amias thanks for that, I couldn't quite get my words out ^_^ I have edited to make it clearer thanks to your input
      – Zanna
      Jul 15 '16 at 12:52








    1




    1




    +1 for the wiki, but there is no need to copy the file. just create a new one.
    – LittleByBlue
    Jul 15 '16 at 10:03




    +1 for the wiki, but there is no need to copy the file. just create a new one.
    – LittleByBlue
    Jul 15 '16 at 10:03




    2




    2




    what you needed to say was , if you try to open a file that doesn't exist with vi it will open an empty file which if saved (Esc : w enter) will create the file you want.
    – Amias
    Jul 15 '16 at 10:21




    what you needed to say was , if you try to open a file that doesn't exist with vi it will open an empty file which if saved (Esc : w enter) will create the file you want.
    – Amias
    Jul 15 '16 at 10:21












    @Amias thanks for that, I couldn't quite get my words out ^_^ I have edited to make it clearer thanks to your input
    – Zanna
    Jul 15 '16 at 12:52




    @Amias thanks for that, I couldn't quite get my words out ^_^ I have edited to make it clearer thanks to your input
    – Zanna
    Jul 15 '16 at 12:52












    up vote
    3
    down vote













    The easiest way to create a ~/.vimrc file, and have an excellent starting point for your own explorations, is to run the following from a Terminal window:



    cp -v /usr/share/vim/vim*/vimrc_example.vim ~/.vimrc


    Open this file with you favorite text editor and start exploring, the file is well commented and there are also endless examples on the Internet to experiment with...






    share|improve this answer



























      up vote
      3
      down vote













      The easiest way to create a ~/.vimrc file, and have an excellent starting point for your own explorations, is to run the following from a Terminal window:



      cp -v /usr/share/vim/vim*/vimrc_example.vim ~/.vimrc


      Open this file with you favorite text editor and start exploring, the file is well commented and there are also endless examples on the Internet to experiment with...






      share|improve this answer

























        up vote
        3
        down vote










        up vote
        3
        down vote









        The easiest way to create a ~/.vimrc file, and have an excellent starting point for your own explorations, is to run the following from a Terminal window:



        cp -v /usr/share/vim/vim*/vimrc_example.vim ~/.vimrc


        Open this file with you favorite text editor and start exploring, the file is well commented and there are also endless examples on the Internet to experiment with...






        share|improve this answer














        The easiest way to create a ~/.vimrc file, and have an excellent starting point for your own explorations, is to run the following from a Terminal window:



        cp -v /usr/share/vim/vim*/vimrc_example.vim ~/.vimrc


        Open this file with you favorite text editor and start exploring, the file is well commented and there are also endless examples on the Internet to experiment with...







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Feb 4 '17 at 9:02

























        answered Jul 15 '16 at 9:43









        andrew.46

        21.2k1468145




        21.2k1468145






























            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.





            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%2faskubuntu.com%2fquestions%2f798864%2fcant-find-path-to-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

            flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

            Mangá

            Eduardo VII do Reino Unido