ubuntu vim python_转 Ubuntu 下 vim 搭建python 环境 配置

这篇博客介绍了如何在Linux环境下安装和配置Vim编辑器,包括安装vim-gnome、ctags、taglist以及pydiction插件,以实现代码补全和taglist功能。通过编辑~/.vimrc文件设置taglist选项,并为不同文件类型设置了自动完成函数。
摘要由CSDN通过智能技术生成

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=1let Tlist_Auto_Open=1let Tlist_Auto_Update=1let Tlist_Display_Tag_Scope=1let Tlist_Exit_OnlyWindow=1let Tlist_Enable_Dold_Column=1let Tlist_File_Fold_Auto_Close=1let Tlist_Show_One_File=1let Tlist_Use_Right_Window=1let Tlist_Use_SingleClick=1nnoremap :TlistTogglefiletype 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#Complete

let g:pydiction_location='~/.vim/tools/pydiction/complete-dict'set autoindent

set tabstop=4set shiftwidth=4set expandtab

set number

set lines=35 columns=118

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值