To view various external documentation (man / perldoc / pydoc / etc.) Vim has many plugins and recipes. The problem is that some are not configured to open the windows with documentation in a convenient way for me, others are not expanding to support new sources of documentation, others are buggy and are written too crookedly so that they can be relatively easily fixed and sent to the author. The other day, this situation got me completely, and I wrote a viewdoc plugin that solves all these problems.
It is simple inside and easy to use, provides a single user interface for working with any documentation (including urgent :help ), knows how to determine the required documentation by context, is flexible, and very easy to expand (with external plugins or right into ~ / .vimrc) for adding new sources of documentation. The main drawback - it was tested only in linux, it can work in other * nix, it will definitely not work in Windows.
You can customize your buttons / commands to access documentation. By default, viewdoc will replace the standard K and :help plus add <F1> and commands :man:perldoc:doc:perldoc .
You can configure where (buffer / window / tab) documentation will open. New documentation can be opened either in an existing window with documentation ( K ) or each time in a new window ( <F1> ). All possible styles of working with windows are supported:
full screen (no tabs, one window, additional files / documentation open in hidden buffers);
windowed (no tabs, many windows with additional files / documentation);
fullscreen with tabs (many tabs, in each one window, additional files / documentation open in new tabs);
with tabs (many tabs, many windows inside tabs, additional files / documentation open anywhere :)).
All types of documentation (including built-in :help ) are displayed in the same way.
All types of documentation (and not only :help ) now support internal navigation a la tags ( <C-]> and <CT> plus alternative <CR> and <BS> ).
Even closing the buffer / window / tab with the documentation has become easier ( q ) and smarter (optional transition to the previous tab instead of the next tab and exit Vim when closing the last buffer)! :)
In case of ambiguous interpretation, he is able to determine the required documentation by context (using the name of the syntax highlighting for the current word and the symbols surrounding it).
Example 1: when editing ~ / .vimrc, you pressed <F1> on the word "highlight" - do you need to show the documentation for the option "& highlight" or the command ": highglight"?
Example 2: when editing a perl script, press <F1> to "$ _ [2]" - the documentation for the variable "@_" will be displayed.
For the :man and :perldoc , full autocompletion is implemented, no worse than the default for :help .
Supported out of the box types of documentation:
Vim built-in documentation
additional documentation written in the Vim help format (for example: CSS2.1 )
man
perldoc
pydoc
Support for new types of documentation is easily added by the user without the need to modify the plug-in code.
You can define several sources of documentation for one type of file (for example, local and pumped out from an Internet) and easily switch between them.
It can be used to display man pages directly from the console.