incorporate PHP manual into (g) Vim

Source: Internet
Author: User
Tags manual gz file linux

First of all, the topic: Vim released 7.3.

In looking at the Vim plug-in, found a more interesting application (non-Plug-ins): The Handbook of PHP as a vim, in Vim, press "K", you can jump to the cursor under the function manual description ...

1. First, download a specially customized PHP manual (all functions that contain PHP5.3): vim-php-manual.tar.gz

2. Unzip the downloaded file and place it in a directory such as/tmp/phpmuanul (under Windows such as "D:/phpmanual").

3. Configure VIMRC (under Linux vimrc,windows is _VIMRC), add phpmanual directory to Runtimepath (explain why later).

4. Configure VIMRC to make keywordprg= "help". On my machine, keywordprg default is!man, most of the time, I still want to be able to direct man to the standard library of Linux, so I use (in VIMRC file):

Autocmd bufnewfile,bufread *.ros,*.inc,*.php Set keywordprg= "Help"

Or it can be written in the Vim directory under the Ftplugin under the Php.vim (if not new), so that when the FT is PHP, this configuration script will be loaded.

As for the reason why the Phpmanual directory was added to the Runtimepath, it is because:

When no argument are given to:help the file given with the ' HelpFile ' Optionwill to be opened. Otherwise the specified tag is searched to all "doc/tags" files in the directories specified in the ' Runtimepath ' Optio N.

That means, in vim, when calling help, helps will go to all the doc directories under Runtimpath to look for tags files to find the helpful keyword.

In the vim-php-manual.tar.gz file we downloaded, we included a file directory structure such as doc/tags, so just add the phpmanual directory to Runtimepath and set Keywordprg as Vim's help, Can be implemented at the cursor at the "K" Jump to the function manual.


Use screenshots

Finally, add that if you are using, Vim prompts you:

tags file not sorted

Then you can use vim to open phpmanual/doc/tags, and then%sort ...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.