Operating environment: Aliyun ECS centos6.5_x64
One, vim python automatic complete plug-in pydiction
1. Installation Configuration
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
What's new in creating ~/.VIMRC is as follows:
#cat ~/.vimrc
filetype plugin on
let g:pydiction_location = ‘~/.vim/tools/pydiction/complete-dict‘
When you edit the Python file with VI, the content appears, indicating that it has been successful.
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/80/FB/wKiom1dFt__w3TeVAABE9MhYkis869.png "title=" p1.png "alt=" Wkiom1dft__w3tevaabe9mhykis869.png "/>
Second, the interactive mode of automatic completion
1. Installing the ReadLine module
Yum-y Install readline*
2. Create a file ~/.pythonstartup
#python startup file.
import sys
import readline
import rlcompleter
import atexit
import os
# tab completion
readline.parse_and_bind(‘tab: complete‘)
# history file
histfile = os.path.join(os.environ[‘HOME‘], ‘.pythonhistory‘)
try:
readline.read_history_file(histfile)
except IOError:
pass
atexit.register(readline.write_history_file, histfile)
del os, histfile, readline, rlcompleter
3. Add to Environment variables
Export Pythonstartup=~/.pythonstartup
4. Make configuration effective
SOURCE ~/.bash_profile
In vim edit mode, you can see that the auto-completion is now complete.
This article is from the "less stubborn" blog, please be sure to keep this source http://xushaojie.blog.51cto.com/6205370/1783256
Linux under Python set vim and interactive mode auto complement