0

I just built vim in a local directory so it is self contained. It went OK, I can start vim/gvim etc...

But when I start vim I get the following message:

[statquant@localhost BuildFromSources]$ ./myOwnVim/usr/bin/vim
Error detected while processing /home/statquant/.vimrc:
line   85:
E484: Can't open file /usr/share/vim/syntax/syntax.vim
Press ENTER or type command to continue

For some reason I think it does not know what $VIM is.

Indeed even after setting

$VIM=$HOME/BuildFromSources/myOwnVim/usr/share/vim

in .bashrc and sourcing it, it does not pick it up (doing :echo within vim gives /usr/share/vim which is the fall back)

What should I do to set it up correctly?

2 Answers 2

2

Here are the complete instructions

#install all packages
sudo yum install -y ruby ruby-devel \
    lua lua-devel luajit luajit-devel \
    ctags mercurial tcl-devel \
    python python-devel python3 python3-devel \
    perl perl-devel perl-ExtUtils-ParseXS \
    perl-ExtUtils-XSpp perl-ExtUtils-CBuilder \
    perl-ExtUtils-Embed

This step is needed to rectify an issue with how Fedora 20 installs XSubPP

#symlink xsubpp (perl) from /usr/bin to the perl dir
sudo ln -s /usr/bin/xsubpp /usr/share/perl5/ExtUtils/xsubpp 

Sources are available via mercurial

#download the sources in $HOME/Sources
mkdir $HOME/Sources
cd $HOME/Sources
hg clone https://code.google.com/p/vim/
cd vim

The vim we build should have all features

#configure the install, vim will be located at $HOME/Build/vim 
mkdir $HOME/Build/vim
./configure --with-features=huge \
            --enable-fail-if-missing \
            --enable-luainterp=yes \
            --enable-mzschemeinterp \
            --enable-perlinterp \
            --enable-pythoninterp=yes \
            --with-python-config-dir=/usr/lib64/python2.7/config \
            --enable-python3interp=yes \
            --enable-tclinterp=yes \
            --enable-rubyinterp=yes \
            --enable-cscope \
            --enable-multibyte \
            --enable-gui=gtk2 \
            --prefix=$HOME/Build/vim \
            --with-compiledby=YOU

Then the installation

#install 
make install

It should look like this

#check the install
[statquant@localhost vim]$ tree -L 3 $HOME/Build/vim/
home/statquant/Build/vim
├── bin
│   ├── eview -> vim
│   ├── evim -> vim
│   ├── ex -> vim
│   ├── gview -> vim
│   ├── gvim -> vim
│   ├── gvimdiff -> vim
│   ├── gvimtutor
│   ├── rgview -> vim
│   ├── rgvim -> vim
│   ├── rview -> vim
│   ├── rvim -> vim
│   ├── view -> vim
│   ├── vim
│   ├── vimdiff -> vim
│   ├── vimtutor
│   └── xxd
└── share
    ├── man
    │   ├── fr
    │   ├── fr.ISO8859-1
    │   ├── fr.UTF-8
    │   ├── it
    │   ├── it.ISO8859-1
    │   ├── it.UTF-8
    │   ├── ja
    │   ├── man1
    │   ├── pl
    │   ├── pl.ISO8859-2
    │   ├── pl.UTF-8
    │   ├── ru.KOI8-R
    │   └── ru.UTF-8
    └── vim
        └── vim74

And last:

#change ~/.bashrc so you can call vim/gvim...
PATH=$PATH:$HOME/Build/vim/bin

#source your bashrc
source ~/.bashrc

#to uninstall
cd $HOME/Sources/vim
make uninstall 

That's what you get:

[statquant@localhost vim]$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Apr 19 2015 16:16:44)
Included patches: 1-703
Compiled by statquant
Huge version with GTK2 GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
+balloon_eval    +float           +mouse_urxvt     -tag_any_white
+browse          +folding         +mouse_xterm     +tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         +gettext         -mzscheme        +textobjects
+clientserver    -hangul_input    +netbeans_intg   +title
+clipboard       +iconv           +path_extra      +toolbar
+cmdline_compl   +insert_expand   +perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python/dyn      +viminfo
+cscope          +lispindent      +python3/dyn     +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con_gui  +lua             +rightleft       +windows
+diff            +menu            +ruby            +writebackup
+digraphs        +mksession       +scrollbind      +X11
+dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     +xim
+emacs_tags      +mouseshape      -sniff           +xsmp_interact
+eval            +mouse_dec       +startuptime     +xterm_clipboard
+ex_extra        -mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    +xpm
1

When running ./configure you need include the argument --prefix=path/to/install/location. After compiling you then run make install, which will place all files in the desired location. This will allow you to have a custom vim install.

In summary:

  1. ./configure --prefix=path/to/install/location.
  2. make.
  3. make install.
3
  • I use --prefix all the time and I have no need for post installation environment settings. Could you please try this option to see if it works?
    – Vitor
    Apr 19, 2015 at 10:02
  • It's not expected that you would need to use sudo.
    – Vitor
    Apr 19, 2015 at 11:12
  • Please confirm that you are following the exact steps I describe in the updated answer.
    – Vitor
    Apr 19, 2015 at 11:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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