Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get official PHP function Doc directly in Vim [closed]

Tags:

php

vim

I want to know if is there a Vim plugin which integrates the PHP documentation of an official class or its methods directly in Vim.
Just Like pydoc.vim for Python: Pydoc.vim

like image 980
Hakim Avatar asked Apr 15 '26 15:04

Hakim


1 Answers

I use something like this in .vimrc

" F7 opens documentation for php/perl function under cursor
function! BrowseDoc()
    if b:current_syntax == "php"
        ! open "http://ch2.php.net/manual-lookup.php?pattern=<cword>"
    elseif b:current_syntax == "perl"
        ! open http://perldoc.perl.org/search.html?q=<cword>
    elseif b:current_syntax == "cpp"
          let cname = tolower(cword);
        ! open file:///opt/qt-4.3.4/doc/html/<cname>
    else
        return
    endif
endfunction
map <F7> :call BrowseDoc()^M^M

open is an OS X command, you may need to adapt that on other platforms

like image 149
C. Ramseyer Avatar answered Apr 17 '26 04:04

C. Ramseyer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!