Install and compile Vim in Linux source code

Source: Internet
Author: User
Tags expression engine

The editor is indispensable for learning and working in Linux. Vim can greatly improve your work efficiency. Installing vim on Ubuntu directly using commands is simple. But sometimes you need to manually compile and install it. For example, YouCompleteMe, the killer plug-in vim, requires that the Vim version be 7.3.548 or later. to upgrade to the latest version of the function, you must compile and install the plug-in using the source code.

I have also checked a lot of information during compilation and installation. Here I will record the entire compilation and installation process.

Recommended reading:

Vim Learning Guide

Quick learn Vi Editor

Powerful Vim Editor

Build a Vim Development Environment on CentOS 6.2

Vim 7.4a released, a new and faster Regular Expression Engine

Install the highlighted Vim editing tool in CentOS 5.4

Vim tips: C language settings

Set the Vim row number in Ubuntu

Vim editor basic tutorial

Directory
  • Install and compile Vim in Linux source code
    • 1. Download required tools
    • Ii. Uninstall the old vim version
    • 3. download the new version
    • Iv. Compilation and Installation
1. Download required tools

Before compiling Vim, You need to download the compilation tools and libraries.

sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev ruby-dev mercurial

Ii. Uninstall the old vim version

Before installing the new version of Vim, You Need To uninstall the old version of Vim, and then execute the following commands on the terminal:

    sudo apt-get remove vim      sudo apt-get remove vim-runtime      sudo apt-get remove gvim      sudo apt-get remove vim-tiny      sudo apt-get remove vim-common      sudo apt-get remove vim-gui-common  
3. download the new version

URL: (ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2)

tar -xjvf vim-7.4.tar.bz2

Extract ~ /Downloads/vim74/

Iv. Compilation and Installation

cd ~/downloads/vim74/

Set the compilation attribute of Vim source code

./configure --with-features=huge --enable-rubyinterp --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.7/config-i386-linux-gnu/ --enable-perlinterp --enable-gui=gtk2 --enable-cscope --enable-luainterp --enable-perlinterp --enable-multibyte --prefix=/usr

You can entermake distclean# Clear all the files generated in the previous compilation

The parameters are described as follows:

  • -- With-features = huge: Maximum features supported
  • -- Enable-rubyinterp: enable Vim to support plug-ins written in ruby.
  • -- Enable-pythoninterp: enable Vim to support python-compiled plug-ins
  • -- Enable-luainterp: enable Vim to support plug-ins written by lua.
  • -- Enable-perlinterp: enable Vim to support perl-compiled plug-ins
  • -- Enable-multibyte: supports Inputting Chinese Characters in Vim.
  • -- Enable-csable: Vim supports cscope
  • -- Enable-gui = gtk2: supported by gtk2. You can also use gnome to generate gvim
  • -- With-python-config-dir =/usr/lib/python2.7/config-i386-linux-gnu/Specify the python path
  • -- Prefix =/usr: compiling and installation path

sudo make VIMRUNTIMEDIR=/usr/share/vim/vim74

sudo make install

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.