开发者

Explore php man page with manpageview in vim

开发者 https://www.devze.com 2023-03-17 09:01 出处:网络
This feature isn\'t working like it supposed to work. Example: I write substr and I want open man page about substr command but when I hit K (cursor is on substr comm开发者_JAVA技巧and) it shows

This feature isn't working like it supposed to work.

Example:

I write substr and I want open man page about substr command but when I hit K (cursor is on substr comm开发者_JAVA技巧and) it shows

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

but when I write

:Man substr.php

it shows substr description properly.


This page details how to open the PHP.net documentation for the keyword under the cursor, using the browser:

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>

Or, with 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


You need to nstall the elinks web browser.

See help manpageviewphp for details.

0

精彩评论

暂无评论...
验证码 换一张
取 消