CentOS6.7源码安装vim-8.0

参考网址:
1、http://www.linuxprobe.com/easymake-vim8.html
2、https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source

源码编译安装Python-2.7.14、Python-3.3.7
https://www.python.org/ftp/python/2.7.14/Python-2.7.14rc1.tgz
https://www.python.org/ftp/python/3.3.7/Python-3.3.7.tgz

安装依赖库
sudo yum install -y ruby ruby-devel lua lua-devel luajit \
    luajit-devel ctags git python python-devel \
    python34 python34-devel tcl-devel \
    perl perl-devel perl-ExtUtils-ParseXS \
    perl-ExtUtils-XSpp perl-ExtUtils-CBuilder \
    perl-ExtUtils-Embed libX11-devel \

下载vim源码
git clone https://github.com/vim/vim.git

删除旧版本的vim
sudo yum -y remove vim

配置configure、编译、安装
sudo ./configure --with-features=huge \
--enable-multibyte \
--enable-rubyinterp=yes \
--enable-pythoninterp=yes \
--with-python-config-dir=/usr/local/python-2.7.14/lib/python2.7/config \
//--enable-python3interp=yes \ 注释
//--with-python3-config-dir=/usr/local/python-3.5.3/lib/python3.5/config-3.5m \ 注释
--enable-perlinterp=yes \
--enable-luainterp=yes \
--enable-gui=gtk2 \
--enable-cscope \
--prefix=/usr/local/vim-8.0
make VIMRUNTIMEDIR=/usr/local/vim-8.0/share/vim/vim80
make install
#不能同时支持python2和python3的脚本,只能2选1,如果同时允许的话,
当安装完成以后输入:vim--version的时候,将出现python/dyn和python3/dyn,表示对python的脚本支持都停止
#with-python3-config-dir=/usr/local/python-3.5.3/lib/python3.5/config-3.5m中的
config-3.5m每个平台不一样的,和自己的机器有关

设置vim为默认编辑器
#Set vim as your default editor with update-alternatives.
sudo update-alternatives --install /usr/bin/editor editor /usr/local/vim-8.0/bin/vim 1
sudo update-alternatives --set editor /usr/local/vim-8.0/bin/vim
sudo update-alternatives --install /usr/bin/vi vi /usr/local/vim-8.0/bin/vim 1
sudo update-alternatives --set vi /usr/local/vim-8.0/bin/vim
/usr/local/vim-8.0/bin/vim中的/usr/local/vim-8.0是vim的安装目录

你可能感兴趣的:(Linux)