Building Vim from source
2015-01-28 00:00
567 查看
摘要: 默认的VIM版本不能使用YouCompleteMe插件
Compiling Vim from source is actually not that difficult. Here's what you should do:
First, install all the prerequisite libraries, including Mercurial. For a Debian-like Linux distribution like Ubuntu, that would be the following:
Remove vim if you have it already.
Once everything is installed, getting the source is easy. 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):
Double check that you are in fact running the new Vim binary by looking at the output of
Compiling Vim from source is actually not that difficult. Here's what you should do:
First, install all the prerequisite libraries, including Mercurial. For a Debian-like Linux distribution like Ubuntu, that would be the following:
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 mercurialFor Fedora 20, that would be the following:
sudo yum install -y ruby ruby-devel lua lua-devel luajit \ luajit-devel ctags mercurial python python-devel \ python3 python3-devel tcl-devel \ perl perl-devel perl-ExtUtils-ParseXS \ perl-ExtUtils-XSpp perl-ExtUtils-CBuilder \ perl-ExtUtils-EmbedThis step is needed to rectify an issue with how Fedora 20 installs XSubPP:
# symlink xsubpp (perl) from /usr/bin to the perl dirsudo ln -s /usr/bin/xsubpp /usr/share/perl5/ExtUtils/xsubpp
Remove vim if you have it already.
sudo apt-get remove vim vim-runtime gvimOn Ubuntu 12.04.2 you probably have to remove these packages as well:
sudo apt-get remove vim-tiny vim-common vim-gui-common
Once everything is installed, getting the source is easy. 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 ~hg clone https://code.google.com/p/vim/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 installIf you want to be able to easily uninstall the package use
checkinstallinstead of
sudo make install
sudo apt-get install checkinstallcd vim sudo checkinstallSet 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
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 (on ubuntu 12.04.1 LTS), try changing
--enable-gui=gtk2to
--enable-gui=gnome2You may need to add
--with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/to the
configurecall.These
configureand
makecalls assume a Debian-like distro where Vim's runtime files directory is placed in
/usr/share/vim/vim74/, which is not Vim's default. Same thing goes for
--prefix=/usrin the
configurecall. Those values may need to be different with a Linux distro that is not based on Debian. In such a case, try to remove the
--prefixvariable in the
configurecall and the
VIMRUNTIMEDIRin the
makecall (in other words, go with the defaults).If you get stuck, here's some other useful information on building Vim.
相关文章推荐
- Building Vim from source(转)
- Chapter 3. Building from Source
- Building a Linux Kernel from source
- Android for MSM Project,Downloading and Building from Source
- Building from source--想自己编译cyanogenmod ROM吗?
- Qt for Linux/X11 - Building from Source
- building-gcc-4-8-from-source-on-ubunu-12-04/
- 【Android平台】 Alljoyn学习笔记三 开发环境的搭建和Building AllJoyn from Source for Android
- Building Apache2 From Source on Linux (Redhat 8)
- Getting Started With OData Part 2: Building an OData Services from Any Data Source
- Building Ext From Source(制定自己的EXT版本)
- About Xorg building from the source codes
- Building an ARM GCC Toolchain from Source
- (OK) Building Android from AOSP source code
- how to build and install vim from source code
- A guide to get you building OGRE from source with the default settings in the shortest possible time
- Building Visual Leak Detector from Source
- 3.6. Building RPMs from Source
- Tutorial:Building Ext From Source(制定自己的EXT版本)
- [Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 4