I\'m trying to get PHP autocompletion right in Vim. Right now when I do a $blog = new Blog(); $blog->
and then hit CTRL+X CTRL+O
I\'d expect omn
try
curl -L -s https://git.io/ide | sh
then relaunch your nvim. You might got code completion, and goto definition features.
*Currently, it's only available for neovim
" Assuming Vim 7 (full version) is installed,
" adding the following to your ~/.vimrc should work.
filetype plugin on
au FileType php set omnifunc=phpcomplete#CompletePHP
" You might also find this useful
" PHP Generated Code Highlights (HTML & SQL)
let php_sql_query=1
let php_htmlInStrings=1
" Hope this helps!
(via http://www.linuxquestions.org/questions/linux-software-2/vim-omin-completion-for-php-621940/#post3155311)
In C++, I run the following to get better context sensitivity:
ctags '--c++-kinds=+p' '--fields=+iaS' '--extra=+q'
It's not perfect, but after ctags adds the extra information to the tags file as specified by the above command vim handles completion better.