Cygwin: how does /usr/bin/vim resolve to a specific version of vim?












0














This started when I ran vim in Cygwin and all of a sudden I got the error message: E185: Cannot find color scheme 'alduin' when I didn't used to get this error prior to today.



I had been messing with installing Cygwin packages, and must've inadvertently installed a new version of vim(?): I now have the folders /usr/share/vim/vim74/ and /usr/share/vim/vim80/.



When I run vim the splash screen does say it's version 8.0.1567. And I guess I put alduin.vim in .../vim74/ and not .../vim80/



My question: how does /usr/bin/vim.exe get associated with a particular version of vim? I.e. when I run "vim" why is vim 8.0 invoked and not vim 7.4?



> which vim
/usr/bin/vim
>
> ls -l /usr/bin/vim*
-rwxr-xr-x 1 User None 2645011 Mar 4 2018 /usr/bin/vim.exe
lrwxrwxrwx 1 User None 7 Dec 14 21:39 /usr/bin/vimdiff -> vim.exe
-rwxr-xr-x 1 User None 2099 Mar 4 2018 /usr/bin/vimtutor
lrwxrwxrwx 1 Usr None 8 Dec 14 21:31 /usr/bin/vimx -> gvim.exe
>
> find /usr/share/vim/vim74/ -name "*.exe"
> find /usr/share/vim/vim80/ -name "*.exe"
>
> printenv | grep -i vim
>


Note, above, that /usr/bin/vim is not a softlink to the executable in one of my two vim versions' directories, which is how I'd have assumed this version-selection would've been done.










share|improve this question
























  • Why are you looking for the .exe in /usr/share? That's not where the symlink points (and not where executables are kept in general).
    – grawity
    Dec 20 '18 at 7:32












  • @grawity - Umm...not really knowing what I was doing, I think I did a "find / -name "*vim*" and those locations came up in the results. But here's the crux of my question/confusion is: when I run "vim", I think I am running /usr/bin/vim - true? I think this is backed up by the output of "which vim" But then why isn't /usr/bin/vim a symlink?
    – StoneThrow
    Dec 20 '18 at 7:44
















0














This started when I ran vim in Cygwin and all of a sudden I got the error message: E185: Cannot find color scheme 'alduin' when I didn't used to get this error prior to today.



I had been messing with installing Cygwin packages, and must've inadvertently installed a new version of vim(?): I now have the folders /usr/share/vim/vim74/ and /usr/share/vim/vim80/.



When I run vim the splash screen does say it's version 8.0.1567. And I guess I put alduin.vim in .../vim74/ and not .../vim80/



My question: how does /usr/bin/vim.exe get associated with a particular version of vim? I.e. when I run "vim" why is vim 8.0 invoked and not vim 7.4?



> which vim
/usr/bin/vim
>
> ls -l /usr/bin/vim*
-rwxr-xr-x 1 User None 2645011 Mar 4 2018 /usr/bin/vim.exe
lrwxrwxrwx 1 User None 7 Dec 14 21:39 /usr/bin/vimdiff -> vim.exe
-rwxr-xr-x 1 User None 2099 Mar 4 2018 /usr/bin/vimtutor
lrwxrwxrwx 1 Usr None 8 Dec 14 21:31 /usr/bin/vimx -> gvim.exe
>
> find /usr/share/vim/vim74/ -name "*.exe"
> find /usr/share/vim/vim80/ -name "*.exe"
>
> printenv | grep -i vim
>


Note, above, that /usr/bin/vim is not a softlink to the executable in one of my two vim versions' directories, which is how I'd have assumed this version-selection would've been done.










share|improve this question
























  • Why are you looking for the .exe in /usr/share? That's not where the symlink points (and not where executables are kept in general).
    – grawity
    Dec 20 '18 at 7:32












  • @grawity - Umm...not really knowing what I was doing, I think I did a "find / -name "*vim*" and those locations came up in the results. But here's the crux of my question/confusion is: when I run "vim", I think I am running /usr/bin/vim - true? I think this is backed up by the output of "which vim" But then why isn't /usr/bin/vim a symlink?
    – StoneThrow
    Dec 20 '18 at 7:44














0












0








0







This started when I ran vim in Cygwin and all of a sudden I got the error message: E185: Cannot find color scheme 'alduin' when I didn't used to get this error prior to today.



I had been messing with installing Cygwin packages, and must've inadvertently installed a new version of vim(?): I now have the folders /usr/share/vim/vim74/ and /usr/share/vim/vim80/.



When I run vim the splash screen does say it's version 8.0.1567. And I guess I put alduin.vim in .../vim74/ and not .../vim80/



My question: how does /usr/bin/vim.exe get associated with a particular version of vim? I.e. when I run "vim" why is vim 8.0 invoked and not vim 7.4?



> which vim
/usr/bin/vim
>
> ls -l /usr/bin/vim*
-rwxr-xr-x 1 User None 2645011 Mar 4 2018 /usr/bin/vim.exe
lrwxrwxrwx 1 User None 7 Dec 14 21:39 /usr/bin/vimdiff -> vim.exe
-rwxr-xr-x 1 User None 2099 Mar 4 2018 /usr/bin/vimtutor
lrwxrwxrwx 1 Usr None 8 Dec 14 21:31 /usr/bin/vimx -> gvim.exe
>
> find /usr/share/vim/vim74/ -name "*.exe"
> find /usr/share/vim/vim80/ -name "*.exe"
>
> printenv | grep -i vim
>


Note, above, that /usr/bin/vim is not a softlink to the executable in one of my two vim versions' directories, which is how I'd have assumed this version-selection would've been done.










share|improve this question















This started when I ran vim in Cygwin and all of a sudden I got the error message: E185: Cannot find color scheme 'alduin' when I didn't used to get this error prior to today.



I had been messing with installing Cygwin packages, and must've inadvertently installed a new version of vim(?): I now have the folders /usr/share/vim/vim74/ and /usr/share/vim/vim80/.



When I run vim the splash screen does say it's version 8.0.1567. And I guess I put alduin.vim in .../vim74/ and not .../vim80/



My question: how does /usr/bin/vim.exe get associated with a particular version of vim? I.e. when I run "vim" why is vim 8.0 invoked and not vim 7.4?



> which vim
/usr/bin/vim
>
> ls -l /usr/bin/vim*
-rwxr-xr-x 1 User None 2645011 Mar 4 2018 /usr/bin/vim.exe
lrwxrwxrwx 1 User None 7 Dec 14 21:39 /usr/bin/vimdiff -> vim.exe
-rwxr-xr-x 1 User None 2099 Mar 4 2018 /usr/bin/vimtutor
lrwxrwxrwx 1 Usr None 8 Dec 14 21:31 /usr/bin/vimx -> gvim.exe
>
> find /usr/share/vim/vim74/ -name "*.exe"
> find /usr/share/vim/vim80/ -name "*.exe"
>
> printenv | grep -i vim
>


Note, above, that /usr/bin/vim is not a softlink to the executable in one of my two vim versions' directories, which is how I'd have assumed this version-selection would've been done.







vim cygwin






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 20 '18 at 8:31

























asked Dec 20 '18 at 7:12









StoneThrow

157110




157110












  • Why are you looking for the .exe in /usr/share? That's not where the symlink points (and not where executables are kept in general).
    – grawity
    Dec 20 '18 at 7:32












  • @grawity - Umm...not really knowing what I was doing, I think I did a "find / -name "*vim*" and those locations came up in the results. But here's the crux of my question/confusion is: when I run "vim", I think I am running /usr/bin/vim - true? I think this is backed up by the output of "which vim" But then why isn't /usr/bin/vim a symlink?
    – StoneThrow
    Dec 20 '18 at 7:44


















  • Why are you looking for the .exe in /usr/share? That's not where the symlink points (and not where executables are kept in general).
    – grawity
    Dec 20 '18 at 7:32












  • @grawity - Umm...not really knowing what I was doing, I think I did a "find / -name "*vim*" and those locations came up in the results. But here's the crux of my question/confusion is: when I run "vim", I think I am running /usr/bin/vim - true? I think this is backed up by the output of "which vim" But then why isn't /usr/bin/vim a symlink?
    – StoneThrow
    Dec 20 '18 at 7:44
















Why are you looking for the .exe in /usr/share? That's not where the symlink points (and not where executables are kept in general).
– grawity
Dec 20 '18 at 7:32






Why are you looking for the .exe in /usr/share? That's not where the symlink points (and not where executables are kept in general).
– grawity
Dec 20 '18 at 7:32














@grawity - Umm...not really knowing what I was doing, I think I did a "find / -name "*vim*" and those locations came up in the results. But here's the crux of my question/confusion is: when I run "vim", I think I am running /usr/bin/vim - true? I think this is backed up by the output of "which vim" But then why isn't /usr/bin/vim a symlink?
– StoneThrow
Dec 20 '18 at 7:44




@grawity - Umm...not really knowing what I was doing, I think I did a "find / -name "*vim*" and those locations came up in the results. But here's the crux of my question/confusion is: when I run "vim", I think I am running /usr/bin/vim - true? I think this is backed up by the output of "which vim" But then why isn't /usr/bin/vim a symlink?
– StoneThrow
Dec 20 '18 at 7:44










1 Answer
1






active

oldest

votes


















2














Through the package manager (Cygwin's, but the same applies to "real" Linux distributions as well), you can only install one particular version of Vim. So /usr/bin/vim.exe (with /usr/bin being owned by the package manager) does not need to be a link. The Vim package can directly place the executable there.



Now for the runtime files (under /usr/share/vim), following that "single version" argument, there's also no need for a version number inside the path, but there's a version in Vim's default install script (Makefile), and most package maintainers keep it that way. Depending on how your (accidental) upgrade worked, you either have a full abandoned Vim 7.4 runtime at /usr/share/vim/vim74/ (and vim.exe got overwritten), or this is just a mostly empty skeleton directory hierarchy that only contains those files that you added to it (like your colors/alduin.vim).



To avoid such problems in the future, please stay off the system directories, and instead place your Vim customization in the user-specific directory; i.e. ~/.vim/, as described by :help load-plugins. Unix / Linux (where Vim comes from) has a clean separation between system and user, and even though this has been less pronounced under Windows (at least in its early history), it's advisable to stick to this, especially with Cygwin.






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    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%2fsuperuser.com%2fquestions%2f1386164%2fcygwin-how-does-usr-bin-vim-resolve-to-a-specific-version-of-vim%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Through the package manager (Cygwin's, but the same applies to "real" Linux distributions as well), you can only install one particular version of Vim. So /usr/bin/vim.exe (with /usr/bin being owned by the package manager) does not need to be a link. The Vim package can directly place the executable there.



    Now for the runtime files (under /usr/share/vim), following that "single version" argument, there's also no need for a version number inside the path, but there's a version in Vim's default install script (Makefile), and most package maintainers keep it that way. Depending on how your (accidental) upgrade worked, you either have a full abandoned Vim 7.4 runtime at /usr/share/vim/vim74/ (and vim.exe got overwritten), or this is just a mostly empty skeleton directory hierarchy that only contains those files that you added to it (like your colors/alduin.vim).



    To avoid such problems in the future, please stay off the system directories, and instead place your Vim customization in the user-specific directory; i.e. ~/.vim/, as described by :help load-plugins. Unix / Linux (where Vim comes from) has a clean separation between system and user, and even though this has been less pronounced under Windows (at least in its early history), it's advisable to stick to this, especially with Cygwin.






    share|improve this answer


























      2














      Through the package manager (Cygwin's, but the same applies to "real" Linux distributions as well), you can only install one particular version of Vim. So /usr/bin/vim.exe (with /usr/bin being owned by the package manager) does not need to be a link. The Vim package can directly place the executable there.



      Now for the runtime files (under /usr/share/vim), following that "single version" argument, there's also no need for a version number inside the path, but there's a version in Vim's default install script (Makefile), and most package maintainers keep it that way. Depending on how your (accidental) upgrade worked, you either have a full abandoned Vim 7.4 runtime at /usr/share/vim/vim74/ (and vim.exe got overwritten), or this is just a mostly empty skeleton directory hierarchy that only contains those files that you added to it (like your colors/alduin.vim).



      To avoid such problems in the future, please stay off the system directories, and instead place your Vim customization in the user-specific directory; i.e. ~/.vim/, as described by :help load-plugins. Unix / Linux (where Vim comes from) has a clean separation between system and user, and even though this has been less pronounced under Windows (at least in its early history), it's advisable to stick to this, especially with Cygwin.






      share|improve this answer
























        2












        2








        2






        Through the package manager (Cygwin's, but the same applies to "real" Linux distributions as well), you can only install one particular version of Vim. So /usr/bin/vim.exe (with /usr/bin being owned by the package manager) does not need to be a link. The Vim package can directly place the executable there.



        Now for the runtime files (under /usr/share/vim), following that "single version" argument, there's also no need for a version number inside the path, but there's a version in Vim's default install script (Makefile), and most package maintainers keep it that way. Depending on how your (accidental) upgrade worked, you either have a full abandoned Vim 7.4 runtime at /usr/share/vim/vim74/ (and vim.exe got overwritten), or this is just a mostly empty skeleton directory hierarchy that only contains those files that you added to it (like your colors/alduin.vim).



        To avoid such problems in the future, please stay off the system directories, and instead place your Vim customization in the user-specific directory; i.e. ~/.vim/, as described by :help load-plugins. Unix / Linux (where Vim comes from) has a clean separation between system and user, and even though this has been less pronounced under Windows (at least in its early history), it's advisable to stick to this, especially with Cygwin.






        share|improve this answer












        Through the package manager (Cygwin's, but the same applies to "real" Linux distributions as well), you can only install one particular version of Vim. So /usr/bin/vim.exe (with /usr/bin being owned by the package manager) does not need to be a link. The Vim package can directly place the executable there.



        Now for the runtime files (under /usr/share/vim), following that "single version" argument, there's also no need for a version number inside the path, but there's a version in Vim's default install script (Makefile), and most package maintainers keep it that way. Depending on how your (accidental) upgrade worked, you either have a full abandoned Vim 7.4 runtime at /usr/share/vim/vim74/ (and vim.exe got overwritten), or this is just a mostly empty skeleton directory hierarchy that only contains those files that you added to it (like your colors/alduin.vim).



        To avoid such problems in the future, please stay off the system directories, and instead place your Vim customization in the user-specific directory; i.e. ~/.vim/, as described by :help load-plugins. Unix / Linux (where Vim comes from) has a clean separation between system and user, and even though this has been less pronounced under Windows (at least in its early history), it's advisable to stick to this, especially with Cygwin.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 20 '18 at 7:57









        Ingo Karkat

        17.3k22343




        17.3k22343






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • 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%2fsuperuser.com%2fquestions%2f1386164%2fcygwin-how-does-usr-bin-vim-resolve-to-a-specific-version-of-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

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

            Mangá

             ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕