Vim 8.0 版本安装方法及添加Python支持

利用Git安装 最简单也是最有效的方法

1. 获取Vim仓库:   

  git clone https://github.com/vim/vim.git 

2. 升级到最新的版本:

  cd vim

  git pull 

3. 安装:

  cd src

  make distclean #如果你以前编译过Vim

  make

  sudo make install

 

错误解决: 

  报错:checking for tgetent()… configure: error: NOT FOUND!

     You need to install a terminal library; for example ncurses.
  解决方法:sudo apt-get install libncurses5-dev

 

  

附:Vim卸载方法(Ubuntu):

  sudo apt-get remove –purge vim (–purge 是完全删除,会连配置文件一起删除)

  suso apt-get clean 

 

=========传说中的华丽分割线==============

 

转:编译安装vim8.0,添加python支持 原文

获得python支持,编译时得加入参数

./configure –with-features=huge –enable-python3interp –enable-pythoninterp –with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/ –enable-rubyinterp –enable-luainterp –enable-perlinterp –with-python3-config-dir=/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu/ –enable-multibyte –enable-cscope      –prefix=/usr/local/vim/
参数说明如下:

–with-features=huge:支持最大特性
–enable-rubyinterp:打开对ruby编写的插件的支持
–enable-pythoninterp:打开对python编写的插件的支持
–enable-python3interp:打开对python3编写的插件的支持
–enable-luainterp:打开对lua编写的插件的支持
–enable-perlinterp:打开对perl编写的插件的支持
–enable-multibyte:打开多字节支持,可以在Vim中输入中文
–enable-cscope:打开对cscope的支持
–with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/ 指定python 路径
–with-python-config-dir=/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu/ 指定python3路径

–prefix=/usr/local/vim:指定将要安装到的路径(自行创建)

如果出现问题请安装python-dev 再执行上面命令

sudo apt-get install python-dev

sudo apt-get install python3-dev

sudo apt-get install libncurses5-dev

=======lua支持======

 Lua 支持

转自 https://gist.github.com/dyzajash/9cfd2c821fc599cbb1a5d1c72305a0b7

sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
 
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev

sudo rm -rf /usr/local/share/vim

sudo rm /usr/bin/vim
 
sudo mkdir /usr/include/lua5.1/include
sudo cp /usr/include/lua5.1/*.h /usr/include/lua5.1/include/

cd /opt/
git clone https://github.com/vim/vim
git pull && git fetch
cd vim/src
make distclean # if vim was prev installed
./configure --with-features=huge \
            --enable-rubyinterp \
            --enable-largefile \
            --disable-netbeans \
            --enable-pythoninterp \
            --with-python-config-dir=/usr/lib/python2.7/config \
            --enable-perlinterp \
            --enable-luainterp \
            --with-luajit \
            --enable-fail-if-missing \
            --with-lua-prefix=/usr/include/lua5.1 \
            --enable-cscope
        
make 
sudo make install

# alias vi="vim" in .zshrc / .bashrc

 

 

 

 

点赞