View all files | ||||
Usage • Requirements • Installation • Configuration
The :DevdocsInstall command opens a popup window for downloading new documentation trees. Please allow a few seconds for the gathering of all slugs (document tree metadata) from devdocs.io.
Navigate through the choices using <Tab> and <S-Tab>, or simply type in the window for fuzzy searching. Depending on the documentation size, the downloading process may take up to a minute.
Installation directory can be changed, as explained below.
To remove documentation trees, use the :DevdocsUninstall command.
Use the :DevdocsFind command, or map it to your preferred shortcut, for a fuzzy search of API keywords. Use <Tab> and <S-Tab> for navigation.
The documentation file opens in a new split window, similar to Vim's help files. You can configure the height of this window. Type q to quit the window.
Links are underlined. Place the cursor on a link and type <C-]> (Control-]) or K to follow the link. <C-t> to go back. These mappings mirror Vim tags. Link targets are echoed on the command line when the cursor is on the link.
Search and copy using familiar Vim commands. There are no markup artifacts that require cleanup.
Use the provided shell script devdocs to view documents in full window. Vim is used as a sort of pager.
The devdocs2 script is similar except it does not source ~/.vimrc. Instead, customization is done through ~/.devdocs.vim file. You can treat this as a standalone app and configure it independent of normal Vim configuration.
To use custom installation of Vim, set the $VIMCMD environment variable to the path of Vim executable.
Install pandoc.
Install this plugin via vim-plug.
Show instructionsUsing vim9 script:
Using legacy script:
Install using Vim's built-in package manager.
Show instructionsAdd the following line to your $HOME/.vimrc file.
Note: If you are going to use devdocs2 script only, you can clone this repository anywhere. The script does not use Vim's plugin system.
Map keys as shown for quick navigation.
There are a couple of options you can set. Here are the defaults:
Options are set using g:DevdocsOptionsSet().
For example, use the following configuration to generate documents with a fixed 80-character width (instead of full terminal width) and to set split window height to 30 lines.
If you installed documentation for multiple languages, you can set the slugs list to limit the fuzzy search to specific documentation trees. Furthermore, you can use the filetype event to set a list of slugs based on the filetype you are working on.
The following syntax groups control the look and feel of the document. They are linked by default to Vim groups as follows:
| DevdocCodeblock | Special |
| DevdocBlockquote | None |
| DevdocLink | Underlined |
| DevdocCode | String |
| DevdocUnderline | Underlined |
| DevdocSection | Comment |
| DevdocDefn | PreProc |
| DevdocH1 | PreProc |
| DevdocH2 | PreProc |
| DevdocH3 | PreProc |
| DevdocH4 | PreProc |
| DevdocH5 | PreProc |
| DevdocH6 | PreProc |
The appearance of the popup window can be configured using borderchars, borderhighlight, highlight, scrollbarhighlight, thumbhighlight, and other :h popup_create-arguments. To configure these settings, use popup.OptionsSet().
For instance, to set the border of the popup window to the Comment highlight group:
or,
The DevdocMenuMatch highlight group modifies the appearance of characters searched so far. By default, it is linked to the Special group.
Vimcomplete - enhances autocompletion in Vim.
Scope.vim - fuzzy find anything.
VimBits - curated suite of lightweight Vim plugins.
VimSuggest - autocompletion for Vim's command-line.