使用jedi-vim对python代码进行自动补全

安装pathogen

1
2
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

修改vimrc

1
2
3
execute pathogen#infect()
syntax on
filetype plugin indent on

git clone jedi-vim

1
git clone https://github.com/davidhalter/jedi-vim.git

更新vim

1
2
3
4
5
sudo apt-get install software-properties-common
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:jonathonf/vim
sudo apt update
sudo apt install vim

安装jedi

1
2
3
pip install jedi
cd ~/.vim/bundle/jedi-vim
git submodule update --init

安装完成。