给 VIM 添加 PHPdoc

VIM 是我最喜欢的文本编辑器(没有之一),今天看了一篇文章:Unix manual pages for PHP functions (需自行翻墙阅读),才知道现在类 Unix 系统的 Manual 也可以添加对 PHP doc 的支持了,同时它也可以让你的 VIM 支持快速查找文档。在我的 MacBook 上试了一下,效果不错。

其实安装方法很简单,在你的终端里输入:

$ pear install doc.php.net/pman

如果你的 pear 版本较老,必须先 “discover” 到 doc.php.net 这个频道,然后再运行上面的命令:

$ pear channel-discover doc.php.net

安装完成后就可以在终端里输入 pman [function name] 来查询文档了。

———————————— 分割线 ———————————-

让你的 VIM 支持快速查找 PHP 函数文档也很简单,现在只需要在你的 vimrc 文件里加上一行就搞定了:

set keywordprg=pman

现在把你的 VIM 光标移到某个 PHP 函数上,输入 “K” (大写的哦),看到了吗? :D

This entry was posted in 技术分享 and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>