vim

install vim-8.2 version with python2 and python3 supported on Ubuntu 18.04

you can run the command to check whether your vim is supported by python2 and python3

vim --version

if you can seek “+python2”, “+python3”, congratulations, you have already resolved the problem, and you can quit

  1. use the command to remove the old vim without python2 or python3 supported

    sudo apt remove vim
    
  2. click this web and download the source code of vim-8.2

  3. use the command to install the dependency of vim (such as gcc, make, python2 and python3, et.)

    sudo apt install gcc make python-dev python3-dev libncurses5-dev
    

    you can use this command to examine whether one dependency was installed well

    gcc --version
    

    if there exist some information about gcc to be printed in the terminal, gcc was installed well

  4. change the directory to “vim-master/src”, which is the source code you just downloaded, and run the command

    ./configure --with-features=huge --enable-python3interp=yes --with-python3-config-dir=/usr/lib/python3.6 --prefix='/usr/local/vim82/' 
    
–with-features=hugemaximum features supported
–enable-pythoninterp=yesturn on the support of python2
–with-python-config-dir=/usr/lib/python2.7indicate the path of python2.7
-enable-python3interp=yesturn on the support of python3
–with-python3-config-dir=/usr/lib/python3.6indicate the path of python3.6
–prefix=’/usr/local/vim82/’indicate the path of vim
  1. start Compilation

    make
    sudo make install
    
  2. add the vim to the PATH (or make a soft link)

    sudo ln -s /usr/local/vim82/bin/vim /usr/bin
    
  3. use these commands to check status of vim

    vim --version
    

    or

    vim
    :python3 import sys; print(sys.version)
    

    if you can see the version of your python3, congratulations, you are successful.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值