Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php autocomplete with vim

i'm looking for an php autocomplete solution for vim. I already was at this thread: Vim PHP omni completion but it doesn't work for me. I generate the tags file with this bash script:

#!/bin/bash
exec ctags -V -f tags \
-h \".php\" -R \
--exclude=\"\.git\" \
--totals=yes \
--language-force=PHP \
--tag-relative=yes \
--PHP-kinds=+cfiv \
--regex-PHP='/(abstract)?\s+class\s+([^ ]+)/\2/c/' \
--regex-PHP='/(static|abstract|public|protected|private)\s+(final\s+)?function\s+(\&\s+)?([^ (]+)/\4/f/' \
--regex-PHP='/interface\s+([^ ]+)/\1/i/' \
--regex-PHP='/\$([a-zA-Z_][a-zA-Z0-9_]*)/\1/v/' \
kernel/classes/

but the autocomplete is not as desired. I don't even know if the plugin is loading. so, how can i see if the plugin is loading? (the plugin is located under bundle, i use pathogen, and other plugins do work..) it is necessary to activate something else? i have VIM - Vi IMproved 7.3, Exuberant Ctags 5.8

thanks

like image 729
Juanolo Avatar asked Mar 25 '12 20:03

Juanolo


1 Answers

I´ve also tried to get php autocompletion working better in vim. I used the phpcomplete.vim plugin, but found out that there was a bug when using more than one tag file (what is not unusual in most vimrc configs). In this case it just searches the first tagfile to resolve the class-filename, and then fallbacks to the standard completion (showing a long long not scope aware list)

However, i´ve forked the plugin and fixed the bug. For me it´s working wonderful now: https://github.com/sebastiankessler/phpcomplete.vim

like image 196
Sebastian Keßler Avatar answered Sep 28 '22 08:09

Sebastian Keßler