Greetings:
The ":Man" command uses "cat" as the pager. This can result in troff
errors showing up in the man page buffer. On Debian-based systems, you
can see this with the following:
1. vim
2. :vsplit
3. * set width of window to ~70 cells
4. Open one of these pages...
man keytool
man nm-settings
man readelf
You can see that several errors show up (screenshot attached).
Since these don't do the user any good, and the output is, usually still
legible, we can silence them.
This patch will silence these errors by sending them to /dev/null:
diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim
index f627035eb..b5de1d60a 100644
--- a/runtime/ftplugin/man.vim
+++ b/runtime/ftplugin/man.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: man
" Maintainer: SungHyun Nam <
gow...@gmail.com>
-" Last Change: 2020 Apr 13
+" Last Change: 2020 Apr 23
" To make the ":Man" command available before editing a manual page, source
" this script from your startup vimrc file.
@@ -205,11 +205,11 @@ func <SID>GetPage(cmdmods, ...)
endif
let env_cmd = s:env_has_u ? 'env -u MANPAGER' : 'env MANPAGER=cat'
let env_cmd .= ' GROFF_NO_SGR=1'
- let man_cmd = env_cmd . ' man ' . s:GetCmdArg(sect, page) . ' | col -b'
- silent exec "r !" . man_cmd
+ let man_cmd = env_cmd . ' man ' . s:GetCmdArg(sect, page) . '
2>/dev/null | col -b'
+ silent exec 'r !' . man_cmd
if unsetwidth
- let $MANWIDTH = ''
+ unlet $MANWIDTH
endif
" Remove blank lines from top and bottom.
while line('$') > 1 && getline(1) =~ '^\s*$'
--
Jason Franklin