Add PHP API documentation to vims balloonexpr [closed]

五迷三道 提交于 2019-12-13 16:14:58

问题


Vim has balloonexpr, which is leveraged in e.g. Ruby to show the API documentation for current hovered word.

How could I get something similar for PHP? What CLI/programmable options are there to access the PHP API documentation? Obviously an offline version is preferred over the online php.net HTML version :). Could e.g. doxygen be used for this?

Are there projects already that allow tooltips with PHP API documentation?


回答1:


The manual is also available via *nix style man pages. To install and use:

Install: pear install doc.php.net/pman

Upgrade: pear upgrade doc.php.net/pman

Example usage: pman strlen

(From: http://php.net/download-docs.php)

Once you have the pman pages installed, you could write a little balloonexpr function to get whatever information you need.

There are also SQLite and JSON documentation sources which might contain the information you want to display, at http://doc.php.net/downloads/




回答2:


It's using the ri CLI utility. Does such a program exist for PHP?

EDIT

Yes, more or less. Here are a few links:

  • phpm
  • php --rf function_name
  • phpm 2.0

Note that I just discovered them myself.



来源:https://stackoverflow.com/questions/8954659/add-php-api-documentation-to-vims-balloonexpr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!