Saturday, December 12, 2015

Install vim with python support

  1. vim has a dependency of libnurses and readline, 
    sudo apt-get install libncurses5-dev libreadline6-dev
    
  2. If you're not using vim 7.4, make sure to set the VIMRUNTIMEDIR variable correctly below (for instance, with vim 7.4a, use /usr/share/vim/vim74a):
    cd ~
    git clone https://github.com/vim/vim.git
    cd vim
    ./configure --with-features=huge \
                --enable-multibyte \
                --enable-rubyinterp \
                --enable-pythoninterp \
                --with-python-config-dir=/usr/lib/python2.7/config \
                --enable-perlinterp \
                --enable-luainterp \
                --enable-gui=gtk2 --enable-cscope --prefix=/usr
    make VIMRUNTIMEDIR=/usr/share/vim/vim74
    sudo make install
    If you want to be able to easily uninstall the package use checkinstall instead of sudo make install
    sudo apt-get install checkinstall
    cd vim
    sudo checkinstall
    Set vim as your default editor with update-alternatives.
    sudo update-alternatives --install /usr/bin/editor editor /usr/bin/vim 1
    sudo update-alternatives --set editor /usr/bin/vim
    sudo update-alternatives --install /usr/bin/vi vi /usr/bin/vim 1
    sudo update-alternatives --set vi /usr/bin/vim
  3. Double check that you are in fact running the new Vim binary by looking at the output of vim --version.
    If you don't get gvim working,try changing --enable-gui=gtk2 to --enable-gui=gnome2
    You may need to add the below option
    --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/ 
    In a Debian-like distribution, Vim's runtime directory(specified by VIMRUNTIMEDIR) is placed in /usr/share/vim/vim74/ by default. Same thing goes for--prefix=/usr in the configure call.
    However, this VIMRUNTIMEDIR may be different with a Linux distro that is not based on Debian. In such a case, just try to build vim in default directory, and not specifying --prefix=.
  4. gconftool-2 command not found

    If you open vim and see above error message, just do
  5. sudo apt-get install gconf2

No comments:

Post a Comment