- Notifications
You must be signed in to change notification settings - Fork32
vim-utils/vim-man
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
View man pages in vim. Grep for the man pages.
:Man printf- openprintf(1)man page in a split:Vman 3 putc- openputc(3)man page in a vertical split (read morehere on what themanual 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
:Man- (without arguments) open a currentnrofffile as a man page
[[and]]- jump to prev/next section headingCtrl-]- jump to man page for a word under cursor (works nicely withspecially highlighted references to other man pages i.e.printf(3)), alsodefined for other tag mappings likeg_Ctrl-],Ctrl-W_Ctrl-]etc.K- same asCtrl-]Ctrl-T- jump *back* to the previous man pageg/- start option search (useful for quickly jumping to man page optiondescription, example--quietor-q)gx- open a link under cursor in a browser(vim feature)gf- jump to a file under cursor(vim feature,works nicely with C header files often found in section 2 and 3 man pages i.e.<sys/socket.h>)q- quitvim-manbuffer
You can use vim-man from the shell (instead of standardman program) usingthe following script:
#! /bin/shvim -c "Man $1 $2" -c 'silent only'Save it in/usr/bin/ as a file namedviman, give it executionpermission with:
$ chmod +x /usr/bin/vimanThen from your shell you can read a DOC with:
$ viman docOr you can use the aliasalias man=viman so you can do (as usual):
$ man docAlso seeAbout Mangrep
:Mangrep 1 foobar- search for "foobar" in all section 1 man pages:Mangrep foobar- same as:Mangrep 1 foobar(grepping all man sectionsby default would take too long):Mangrep * foobar- force search *all* man sections:Mangrep -i 6 foobar- case insensitive search:Mangrep 6 '(foo|bar|baz)'- regex search (Mangrepusesgrep -E), justremember to quote the search pattern
No mappings are defined by default.
map <leader>k <Plug>(Man)- open man page for word under cursor in a horizontalsplitmap <leader>v <Plug>(Vman)- open man page for word under cursor in a verticalsplit
This feature is still in beta.Please help fix theissues.
Mangrep populates quickfix list with the results. While they should beaccurate, you might experience hiccups when opening those results.
RunningMangrep:
- the command runs in the background if you use neovim
- The command runs in the background if you havevim-dispatch installed. Access theresults with
:Copencommand(may be called before the process is finished). - If you have vanilla vim the command will *block* and make vim unusableuntil done (and it can take a while).
Installingvim-dispatchis recommended. Or at least runMangrepin another vim so your working viminstance stays usable.
Just use your favorite plugin manager.
If you were previously usingman.vim that comes with vim by default, pleaseremove this lineruntime! ftplugin/man.vim from your.vimrc. It's known tobe causingissues with thisplugin.
Contributing and bug fixes are welcome. If you have an idea for a new featureplease get in touch by opening an issue so we can discuss it first.
Vim by default comes with man page viewer, as decribed infind-manpage.This work is the improvement of vim's original man page plugin. The list ofimprovements ishere.
These people created and maintain (or maintained)man.vim that comes with vimitself:
- SungHyun Nam
- Gautam H. Mudunuri
- Johannes Tanzler
Vim license, see:help license.
About
View and grep man pages in vim
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Contributors6
Uh oh!
There was an error while loading.Please reload this page.