• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

Ubuntu 下 vim 搭建python 环境 配置

python 搞代码 4年前 (2022-01-07) 76次浏览 已收录 0个评论

这篇文章主要介绍了Ubuntu 下 vim 搭建python环境配置,需要的朋友可以参考下

1. 安装完整的vim

 # apt-get install vim-gnome

2. 安装ctags,ctags用于支持taglist,必需!

 # apt-get install ctags

3. 安装taglist

 #apt-get install vim-scripts #apt-get install vim-addon-manager # vim-addons install taglist

4. 安装pydiction(实现代码补全)

 #wget http://www.pythonclub.org/_media/Python-basic/pydiction-1.2.zip #unzip pydiction-1.2.zip // ~/.vim/after/ftplugin和~/.vim/tools/pydiction/目录默认不存在,需要自行创建 #cp pydiction-1.2/python_pydiction.vim ~/.vim/after/ftplugin #cp pydiction-1.2/complete-dict ~/.vim/tools/pydiction/complete-dict

5. 编辑配置文件

 //~/.vimrc 修改当前用户配置,如果需要修改全局配置,vim /etc/vim/vimrc # vim ~/.vimrc let Tlist_Auto_Highlight_Tag=1 let Tlist_Auto_Open=1 let Tlist_Auto_Update=1 let Tlist_Display_Tag_Scope=1 let Tlist_Exit_OnlyWindow=1 let Tlist_Enable_Dold_Column=1 let Tlist_File_Fold_Auto_Close=1 let Tlist_Show_One_File=1 let Tlist_Use_Right_Window=1 let Tlist_Use_SingleClick=1 nnoremap   :TlistToggle filetype plugin on autocmd FileType python set omnifunc=pythoncomplete#Complete autocmd FileType javascrīpt set omnifunc=javascriptcomplete#CompleteJS autocmd FileType html set omnifunc=htmlcomplete#CompleteTags autocmd FileType css set omnifunc=csscomplete#CompleteCSS autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags autocmd FileType php set omnifunc=phpcomplete#CompletePHP autocmd FileType c set omnifunc=ccomplete#Comple<mark style="color:transparent">来源gaodaimacom搞#^代%!码网</mark>te let g:pydiction_location='~/.vim/tools/pydiction/complete-dict' set autoindent set tabstop=4 set shiftwidth=4 set expandtab set number set lines=35 columns=118

右边即为taglist窗口,按F8打开,使用Ctrl+w,再按w可以在code窗口和taglist窗口间切换。

以上所述是小编给大家介绍的 Ubuntu 下 vim 搭建python 环境 配置,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对gaodaima搞代码网网站的支持!

以上就是Ubuntu 下 vim 搭建python 环境 配置的详细内容,更多请关注gaodaima搞代码网其它相关文章!


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Ubuntu 下 vim 搭建python 环境 配置

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址