在vim中使用manpageview探索php手册页

时间:2011-07-04 16:10:50

标签: vim

此功能无法正常工作。

示例:

我写了substr,我想要打开关于substr命令的手册页但是当我点击K(光标在substr命令上)时它会显示

***warning*** sorry, no manpage exists for <substr>

但是当我写

:Man substr.php

它正确显示了substr描述。

2 个答案:

答案 0 :(得分:2)

This page详细介绍了如何使用浏览器在光标下打开关键字的PHP.net文档:

function OpenPHPManual(keyword)
  let firefox = '/Applications/Firefox.app/Contents/MacOS/firefox-bin'
  " you will need to create this profile in firefox
  let profile = 'Profile for PHP Manual'
  let url = 'http://www.php.net/' . a:keyword
  exec '!' . firefox . ' -p "' . profile . '" "' . url . '"'
endfunction
noremap gd :call OpenPHPManual(expand('<cword>'))<CR>

或者lynx(1)

function OpenPHPManual(keyword)
  let web = 'lynx -accept_all_cookies --cookie_file=/home/jon/.lynx_cookies --cookie_save_file=/home/jon/.lynx_cookies --cookies'
  let url = 'http://jp2.php.net/' . a:keyword
  exec '!' . web . ' "' . url . '"'
endfunction

答案 1 :(得分:0)

您需要安装 elinks 网络浏览器。

有关详细信息,请参阅 help mainpagenew php