vim 下python代码提示
# 首先 ,python需要共享库的编译和安装
需要增加 ./configure --enable-shared
基于共享库安装,
因此,安装完成后,需要导入共享库路径
cd /etc/ld.so.conf.d
vim python3.conf # 输入python/lib的位置
ldconfig # 加载
vim --version # 7.4 不支持python3
yum update; yum install -y git
yum -y install cmake make gcc gcc-c
git clone vim/vim
cd vim
export LDFLAGS="-rdynamic" # undefined symbol: PyByteArray_Type · Issue #3629 · vim/vim
./configure --with-features=huge --enable-multibyte --enable-pythoninterp=yes --enable-python3interp=yes --prefix=$(dirname $(pwd))/vim8
make && make install
ln -s $(pwd)/vim /usr/bin/vim8
git clone VundleVim/Vundle.vim ~/.vim/bundle/Vundle.vim
git clone --recursive Valloric/YouCompleteMe ~/.vim/bundle/YouCompleteMe
vim ~/.vimrc
内容如下
if has('mouse')
set mouse-=a
endif
syntax on " 开启高亮的语法
filetype off " 必须
set nocompatible " 去除VI一致性,必须
set backspace=indent,eol,start " 退格键删除空白符
" 设置包括vundle与初始化有关runtime path
set rtp =~/.vim/bundle/Vundle.vim
call vundle#begin()
" 让vundle必须管理插件版本
Plugin 'VundleVim/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
" 你所有的插件都需要在下面的行之前
call vundle#end() " 必须
filetype plugin indent on " 必须 加载vim与插件相关的语法和文件类型
" 常用的命令
" :PluginList - 列出所有已配置的插件
" :PluginInstall - 安装插件,添加 `!` 用于更新或使用 :PluginUpdate
" :PluginSearch foo - 搜索 foo ; 追加 `!` 清除本地缓存
" :PluginClean - 未使用的插件需要确认; 追加 `!`
" 未使用插件的自动批准移除
cd ~/.vim/bundle/YouCompleteMe
python3 install.py
最后使用vim8 test.py你可以看到效果