一、vim自动补全:
执行以下命令:
wget https://github.com/rkulla/pydiction/archive/master.zip
unzip -q master
mv pydiction-master pydiction
mkdir -p ~/.vim/tools/pydiction
cp -r pydiction/after ~/.vim
cp pydiction/complete-dict ~/.vim/tools/pydiction
创建~/.vimrc
vim ~/.vimrc
~/.vimrc输入内容如下:
filetype plugin on
let g:pydiction_location = '~/.vim/tools/pydiction/complete-dict'
二、python shell 的tab补全:
用vim新建pythonstartup文件
vim /root/.pythonstartup
文件内输入以下内容:
try:
import readline
except ImportError:
print("Module readline not available.")
else:
import rlcompleter
readline.parse_and_bind("tab: complete")
执行一下命令:
echo “export PYTHONSTARTUP=~/.pythonstartup” >> ~/.bashrc
source /root/.bashrc