mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
man.vim: :Man! operates on buffer contents (#9139)
mandoc may not handle quoted MANPAGER arguments correctly. E.g. with export MANPAGER='nvim -u NORC -c "set ft=man"' mandoc treats `"set` and `ft=man"'` as separate tokens. To workaround that, provide :Man! so that MANPAGER can avoid quoting. closes #9120
This commit is contained in:
@@ -512,7 +512,7 @@ View manpages in Nvim. Supports highlighting, completion, locales, and
|
|||||||
navigation. Also see |find-manpage|.
|
navigation. Also see |find-manpage|.
|
||||||
|
|
||||||
To use Nvim as a manpager: >
|
To use Nvim as a manpager: >
|
||||||
export MANPAGER="nvim -c 'set ft=man' -"
|
export MANPAGER="nvim +Man!"
|
||||||
|
|
||||||
man.vim will always attempt to reuse the closest man window (above/left) but
|
man.vim will always attempt to reuse the closest man window (above/left) but
|
||||||
otherwise create a split.
|
otherwise create a split.
|
||||||
@@ -522,13 +522,14 @@ The case sensitivity of completion is controlled by 'fileignorecase'.
|
|||||||
Commands:
|
Commands:
|
||||||
Man {name} Display the manpage for {name}.
|
Man {name} Display the manpage for {name}.
|
||||||
Man {sect} {name} Display the manpage for {name} and section {sect}.
|
Man {sect} {name} Display the manpage for {name} and section {sect}.
|
||||||
Man {name}({sect}) Alternate syntax which completes the section.
|
Man {name}({sect}) Same as above.
|
||||||
Man {sect} {name}({sect}) Used during completion to show the real section of
|
Man {sect} {name}({sect}) Used during completion to show the real section of
|
||||||
when the provided section is a prefix, e.g. 1m vs 1.
|
when the provided section is a prefix, e.g. 1m vs 1.
|
||||||
Man {path} Open the manpage specified by path. Prepend "./" if
|
Man {path} Open the manpage at {path}. Prepend "./" if {path}
|
||||||
page is in the current directory.
|
is relative to the current directory.
|
||||||
Man Open the manpage for the <cWORD> (man buffers)
|
Man Open the manpage for the <cWORD> (man buffers)
|
||||||
or <cword> (non-man buffers) under the cursor.
|
or <cword> (non-man buffers) under the cursor.
|
||||||
|
Man! Display the current buffer contents as a manpage.
|
||||||
|
|
||||||
|:Man| accepts command modifiers. For example, to use a vertical split: >
|
|:Man| accepts command modifiers. For example, to use a vertical split: >
|
||||||
:vertical Man printf
|
:vertical Man printf
|
||||||
|
@@ -5,7 +5,9 @@ if exists('g:loaded_man')
|
|||||||
endif
|
endif
|
||||||
let g:loaded_man = 1
|
let g:loaded_man = 1
|
||||||
|
|
||||||
command! -bar -range=0 -complete=customlist,man#complete -nargs=* Man call man#open_page(v:count, v:count1, <q-mods>, <f-args>)
|
command! -bang -bar -range=0 -complete=customlist,man#complete -nargs=* Man
|
||||||
|
\ if <bang>0 | set ft=man |
|
||||||
|
\ else | call man#open_page(v:count, v:count1, <q-mods>, <f-args>) | endif
|
||||||
|
|
||||||
augroup man
|
augroup man
|
||||||
autocmd!
|
autocmd!
|
||||||
|
Reference in New Issue
Block a user