Ubuntu 下 vim 搭建python 环境 配置
1.安装完整的vim
#apt-getinstallvim-gnome
2.安装ctags,ctags用于支持taglist,必需!
#apt-getinstallctags
3.安装taglist
#apt-getinstallvim-scripts #apt-getinstallvim-addon-manager #vim-addonsinstalltaglist
4.安装pydiction(实现代码补全)
#wgethttp://www.pythonclub.org/_media/Python-basic/pydiction-1.2.zip #unzippydiction-1.2.zip //~/.vim/after/ftplugin和~/.vim/tools/pydiction/目录默认不存在,需要自行创建 #cppydiction-1.2/python_pydiction.vim~/.vim/after/ftplugin #cppydiction-1.2/complete-dict~/.vim/tools/pydiction/complete-dict
5.编辑配置文件
//~/.vimrc修改当前用户配置,如果需要修改全局配置,vim/etc/vim/vimrc #vim~/.vimrc letTlist_Auto_Highlight_Tag=1 letTlist_Auto_Open=1 letTlist_Auto_Update=1 letTlist_Display_Tag_Scope=1 letTlist_Exit_OnlyWindow=1 letTlist_Enable_Dold_Column=1 letTlist_File_Fold_Auto_Close=1 letTlist_Show_One_File=1 letTlist_Use_Right_Window=1 letTlist_Use_SingleClick=1 nnoremap:TlistToggle filetypepluginon autocmdFileTypepythonsetomnifunc=pythoncomplete#Complete autocmdFileTypejavascrīptsetomnifunc=javascriptcomplete#CompleteJS autocmdFileTypehtmlsetomnifunc=htmlcomplete#CompleteTags autocmdFileTypecsssetomnifunc=csscomplete#CompleteCSS autocmdFileTypexmlsetomnifunc=xmlcomplete#CompleteTags autocmdFileTypephpsetomnifunc=phpcomplete#CompletePHP autocmdFileTypecsetomnifunc=ccomplete#Complete letg:pydiction_location='~/.vim/tools/pydiction/complete-dict' setautoindent settabstop=4 setshiftwidth=4 setexpandtab setnumber setlines=35columns=118
右边即为taglist窗口,按F8打开,使用Ctrl+w,再按w可以在code窗口和taglist窗口间切换。
以上所述是小编给大家介绍的Ubuntu下vim搭建python环境配置,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!