Ubuntu 配置VIM支持Python 完成YCM的安装实现自动补齐的功能

    xiaoxiao2021-08-27  67

    在安装YCM的过程中报错,提示VIM需要support python2.6+以上的版本,后来经过查阅,发现自己在安装VIM的时候,没有配置VIM支持Python。我安装的VIM是VIM80版本的。

    在安装YCM之前,首先要安装Vundle,,安装的流程我已经转载其他前辈的博客。我贴出下我的Vundle在~/.vimrc中的配置(参考Vundle的readme文档):

    80 set rtp+=~/.vim/bundle/Vundle.vim 81 call vundle#begin() "查阅了vundle的readme 这里是begin() 82 83 " alternatively, pass a path where Vundle should install plugins 84 "call vundle#begin('~/some/path/here') 85 86 " let Vundle manage Vundle, required 87 Plugin 'gmarik/Vundle.vim' 88 Plugin 'Valloric/YouCompleteMe' 89 Plugin 'Valloric/ListToggle' 90 Plugin 'scrooloose/syntastic' 91 92 " Add all your plugins here (note older versions of Vundle used Bundle inste ad of Plugin) 93 94 " All of your Plugins must be added before the following line 95 call vundle#end() " required 96 filetype plugin indent on " required

    在执行PluginInstall命令时,开始安装我们配置的插件。

    我这里报错,缺少VIM对Python2.6版本以上的支持。

    我重新配置VIM80,在VM80/src/下面

     

    >./configure --enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-cscope --enable-gui=auto --enable-gtk2-check --enable-gnome-check --with-features=huge --with-x --with-python-config-dir=/usr/lib/python2.7/config-i386-linux-gnu

     注意,编译+python的时候  /usr/lib/python2.7/config-i386-linux-gnu 这个文件夹一定要有 没有的话 安装下这个库 sudo apt-get install python-dev vim --version | grep python察看下该+的有没有加好。

    转载请注明原文地址: https://ju.6miu.com/read-677208.html

    最新回复(0)