paretje / nvim-man

View man pages in neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nvim-man

View man pages in neovim.

Features and Usage

Viewing man pages

  • :Man printf - open printf(1) man page in a split
  • :Vman 3 putc - open putc(3) man page in a vertical split (read more here on what the manual page numbers mean, they are really useful)
  • :Man pri<Tab> - command completion for man page names
  • :Man 3 pri<Tab> - completion "respects" the man page section argument
  • :Man 6 <Ctrl-D> - list all man pages from section 6

Configuration

  • au User ManOpen can be used to define, for example, custom bindings
  • let g:nvim_man_default_target can be used to set an alternative default target when opening the manual. Possible values are: horizontal, vertical, tab and current. By default, a vertical split is used.

Installation

Just use your favorite plugin manager.

Contributing

Contributions and bug fixes are welcome. If you have an idea for a new feature please get in touch by opening an issue so we can discuss it first.

Differences with vim-man

This plugin is based on vim-man, which is turn is based on the builtin viewer of vim. Neovim does enable this viewer by default. There are howerver some limitations with both vim-man and the builtin viewer. The builtin viewer has no auto completion on the vim command mode, and both do load the man page as a plain text file with syntax highlighting. This syntax highlighting isn't perfect however, as it sometimes fails, and not everything is highlighted which would be for example bold in the man command.

As neovim has it's terminal command, this can be used to view the man page. On top of that, this plugin applies the syntax highlighting. C-w is available without leaving terminal mode, making it easier to switch to different window. When returning to the man page, the buffer automatically enters terminal mode.

Compared to vim-man, this plugin doesn't provide the Mangrep command, as this is currently broken in neovim. A fix should be trivial, but as I think it's too slow to be useful anyway, I deleted it for now. If anyone wants to fix it, the removal could be reverted. Note however that you can't use vim-man in combination with this plugin.

Credits

Thanks to vim-man for the completion code, and vim and neovim for the syntax and vim/neovim itself, of course.

License

Vim license, see :help license.

About

View man pages in neovim


Languages

Language:Vim Script 100.0%