man.vim: Hard wrap by default

Closes #11436
This commit is contained in:
Anmol Sethi
2019-11-24 19:55:38 -05:00
parent 078f279691
commit 4ce96e4979
2 changed files with 4 additions and 4 deletions

View File

@@ -139,7 +139,7 @@ function! s:get_page(path) abort
" Disable hard-wrap by using a big $MANWIDTH (max 1000 on some systems #9065). " Disable hard-wrap by using a big $MANWIDTH (max 1000 on some systems #9065).
" Soft-wrap: ftplugin/man.vim sets wrap/breakindent/…. " Soft-wrap: ftplugin/man.vim sets wrap/breakindent/….
" Hard-wrap: driven by `man`. " Hard-wrap: driven by `man`.
let manwidth = !get(g:,'man_hardwrap') ? 999 : (empty($MANWIDTH) ? winwidth(0) : $MANWIDTH) let manwidth = !get(g:,'man_hardwrap', 1) ? 999 : (empty($MANWIDTH) ? winwidth(0) : $MANWIDTH)
" Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db). " Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db).
" http://comments.gmane.org/gmane.editors.vim.devel/29085 " http://comments.gmane.org/gmane.editors.vim.devel/29085
" Set MAN_KEEP_FORMATTING so Debian man doesn't discard backspaces. " Set MAN_KEEP_FORMATTING so Debian man doesn't discard backspaces.

View File

@@ -550,7 +550,7 @@ Variables:
For example in C one usually wants section 3 or 2: > For example in C one usually wants section 3 or 2: >
:let b:man_default_sections = '3,2' :let b:man_default_sections = '3,2'
*g:man_hardwrap* Hard-wrap to $MANWIDTH or window width if $MANWIDTH is *g:man_hardwrap* Hard-wrap to $MANWIDTH or window width if $MANWIDTH is
empty. Enabled by default. Disable to enable soft empty. Enabled by default. Set |FALSE| to enable soft
wrapping. wrapping.
To use Nvim as a manpager: > To use Nvim as a manpager: >
@@ -560,10 +560,10 @@ Note that when running `man` from the shell and with that `MANPAGER` in your
environment, `man` will pre-format the manpage using `groff`. Thus, Neovim environment, `man` will pre-format the manpage using `groff`. Thus, Neovim
will inevitably display the manual page as it was passed to it from stdin. One will inevitably display the manual page as it was passed to it from stdin. One
of the caveats of this is that the width will _always_ be hard-wrapped and not of the caveats of this is that the width will _always_ be hard-wrapped and not
soft wrapped as with `:Man`. You can set in your environment: > soft wrapped as with `g:man_hardwrap=0`. You can set in your environment: >
export MANWIDTH=999 export MANWIDTH=999
So `groff`'s pre-formatting output will be the same as with `:Man` i.e soft-wrapped. So `groff`'s pre-formatting output will be the same as with `g:man_hardwrap=0` i.e soft-wrapped.
To disable bold highlighting: > To disable bold highlighting: >
:highlight link manBold Normal :highlight link manBold Normal