I use this in my .vim/after/plugin/php.vim file (which gets sourced after all the regular stuff):
augroup WezsPHPStuff
au BufEnter *.php set complete-=k~/.vim/php-funclist.txt complete+=k~/.vim/php-funclist.txt
au BufLeave *.php set complete-=k~/.vim/php-funclist.txt
au BufEnter *.inc set complete-=k~/.vim/php-funclist.txt complete+=k~/.vim/php-funclist.txt
au BufLeave *.inc set complete-=k~/.vim/php-funclist.txt
augroup END
What does it do? It only applies the php function list completion to buffers that contain php code, as it's really annoying to have php functions complete in a buffer containing C code :-)
As Sean pointed out, you can get a more up to date function list from the phpdoc repository:
wget 'http://viewcvs.php.net/viewcvs.cgi/*checkout*/phpdoc/funclist.txt' -O php-funclist.txt.new
cat php-funclist.txt.new php-lang-constructs.txt | egrep -v '^#' | sort | uniq > php-funclist.txt
Where php-lang-constructs.txt contains:
echo
print
foreach
list
new
(language constructs are not implemented in the same way as the other functions, so the phpdoc tools can't pick them up from the source).
↧