2

I tried to install vim from source. I do not have sudo rights.

So, i cloned the last revision from github, and configured as follows:

./configure                  \
    --with-features=huge                    \
    --enable-multibyte                      \
    --enable-pythoninterp=dynamic           \
    --enable-python3interp=dynamic          \
    --with-python-config-dir=$PY_CONFIG     \
    --with-python3-config-dir=$PY3_CONFIG   \
    --enable-gui=gtk2                       \
    --enable-cscope                         \
    --prefix=$HOME/.local $@

note the $HOME/.local prefix. Then I did make && make install. All went great. Now, unfortunately, when I try to take my first steps with vim, and do ~/.local/bin/vimtutor, It complains that it can't find the corresponding page:

Error detected while processing command line:
E484: Can't open file /usr/share/vim/vim74/tutor/tutor.vim

I am baffled how it thinks that I might have vim 7.4, and managed to mess up it's paths like that - because it installed the corresponding files, as was to be expected, in /home/simon/.local/share/vim/vim80.

Help? :D

Tips on whether I have not yet grasped how to build software like vim with make locally the right way, would be also very appreciated :) I'm new to the whole linux stuff...

Thanks a lot!

0

Note that vimtutor is actually a script with searches for a suitable vim and runs it. So, make sure that your local vim comes before the system vim in PATH. For example, with this minimal PATH ensuring no other vim is found, vimtutor loads fine:

PATH=$HOME/.local/bin:/bin ~/.local/bin/vimtutor

It's better to prefix $HOME/.local/bin to $PATH in your .profile or equivalent.

  • After I added the $PATH to include my $HOME/.local/bin, it worked. However, I am extremely curios to understand this: If I don't have it on my PATH, $ which vim and $ which vimtutor return nothing; but when I call the binary directly, i.e. $ $HOME/.local/bin/vimtutor, it exhibits the erroneous behavior described in my OP. So, the PATH seems to be not only used by the shell to locate the binary, but also by vim to locate it's files? Anyone care to provide the rationale behind this behavior? Thanks! (I fear I will encounter it in other places too, and want to understand) – simlei Apr 7 '18 at 17:00
  • @user172973 no, Vim doesn't use PATH to locate its files. Vimtutor uses PATH to locate a suitable vim, which maybe called vim or gvim or vim74 or ... (see the script for the full list of all the commands it looks for). So even if you don't have command named vim installed, vim might already be present on your system with a different name. – muru Apr 8 '18 at 0:44
  • ah hah. That makes sense. I did not think there might be a differently-named binary floating somewhere. Makes sense now! thank you. – simlei Apr 8 '18 at 1:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.