The legend of Ubuntu is to develop the necessary, but also want to try hackers;
ubuntu16.04 comes with python2.7 and 3.5 two versions and Vim editor
One, on-line check a lot of information is the Pydiction plug-in installation use, to achieve tab automatic completion;
#默认ubuntu是没有远程ssh所以需要安装以下software
sudo apt-get install openssh-server wget tree unzip Ipython-ywget https://github.com/rkulla/pydiction/archive/ Master.zipunzip-q mastermv pydiction-master pydictionmkdir-p ~/.vim/tools/pydictioncp-r pydiction/after ~/.VIMCP Pydiction/complete-dict ~/.vim/tools/pydiction
Ii. ensure that the structure of the document is as follows:
# tree ~/. Vim/root/. vim├──after│ └──ftplugin│ └──python_pydiction.vim└──tools └── Pydiction └──complete-dict
Third, create ~/.VIMRC to ensure that the contents are as follows:
# vim ~/.vimrcfiletype plugin Onlet g:pydiction_location = ' ~/.vim/tools/pydiction/complete-dict '
Iv. automatic completion in Python interactive mode
Create the following file:
# vim ~/.pythonstartup# python startup file#!/usr/bin/env pythonimport sysimport readlineimport rlcompleterimport Atexitimport os# tab completionreadline.parse_and_bind (' Tab:complete ') # History filehistfile = Os.path.join ( os.environ[' HOME '], '. Pythonhistory ') Try: readline.read_history_file (histfile) except IOError: Passatexit.register (Readline.write_history_file, Histfile) del os, Histfile, ReadLine, Rlcompleter1
To add an environment variable:
Echo ' Export Pythonstartup=~/.pythonstartup ' >> ~/.bash_profile
Re-login to the shell, enter the python command into interactive mode, you can use the TAB key to complete the completion.
Reference: http://www.jb51.net/article/58009.htm
Python's Ubuntu development environment vim and Ipython