aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload/man.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/autoload/man.vim')
-rw-r--r--runtime/autoload/man.vim5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim
index 41c2f5a405..153f1afed8 100644
--- a/runtime/autoload/man.vim
+++ b/runtime/autoload/man.vim
@@ -150,8 +150,9 @@ endfunction
function! s:get_page(path) abort
" Disable hard-wrap by using a big $MANWIDTH (max 1000 on some systems #9065).
- " We use soft wrap: ftplugin/man.vim sets wrap/breakindent/….
- let manwidth = 999
+ " Soft-wrap: ftplugin/man.vim sets wrap/breakindent/….
+ " Hard-wrap: driven by `man`.
+ let manwidth = !get(g:,'man_hardwrap') ? 999 : (empty($MANWIDTH) ? winwidth(0) : $MANWIDTH)
" Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db).
" http://comments.gmane.org/gmane.editors.vim.devel/29085
" Set MAN_KEEP_FORMATTING so Debian man doesn't discard backspaces.