vim 添加 php 函数自动完成功能
从官方下载 funclist.txt
# wget -c http://cvs.php.net/viewvc.cgi/phpdoc/funclist.txt
# mv funclist.txt /usr/share/vim/vim70/dict/php.dict
# mv funclist.txt /usr/share/vim/vim70/dict/php.dict
然后
# vi /etc/vimrc
在最下面加入
"ADD BY ANDY =============================
set complete+=k "add dictionary complete
set dictionary=/usr/share/vim/vim70/dict/php.dict "set dictionary
"Auto completion using the TAB key
"This function determines, wether we are on
"the start of the line text(then tab indents)
"or if we want to try auto completion
function! InsertTabWrapper()
let col=col('.')-1
if !col || getline('.')[col-1] !~ '\k'
return "\<TAB>"
else
return "\<C-N>"
endif
endfunction
"Remap the tab key to select action with InsertTabWrapper
inoremap <TAB> <C-R>=InsertTabWrapper()<CR>
"TAB设置===============
set expandtab
"set sw=4
set et sw=4 ts=4 sts=4
set tabstop=4
set softtabstop=4
set complete+=k "add dictionary complete
set dictionary=/usr/share/vim/vim70/dict/php.dict "set dictionary
"Auto completion using the TAB key
"This function determines, wether we are on
"the start of the line text(then tab indents)
"or if we want to try auto completion
function! InsertTabWrapper()
let col=col('.')-1
if !col || getline('.')[col-1] !~ '\k'
return "\<TAB>"
else
return "\<C-N>"
endif
endfunction
"Remap the tab key to select action with InsertTabWrapper
inoremap <TAB> <C-R>=InsertTabWrapper()<CR>
"TAB设置===============
set expandtab
"set sw=4
set et sw=4 ts=4 sts=4
set tabstop=4
set softtabstop=4
搞定
很不错,喜欢vim,她是很有内涵的编辑器。
欢迎指点我的博客,http://virteman.webbeb.com
顺便向你推荐一个实时访客轨迹的挂件,http://fireeye.webbeb.com/