by tomxor · 1y ago · 0 comments
export MANPAGER="nvim +Man!"
Using Vim's built in ft-man-plugin [1] as the default man pager seems to go pretty far towards resolving what the author is complaining about.Links work, and it respects the indentation when soft wrapping lines. It isn't doing full reflow or regenerating the page, but it maintains legibility while soft wrapping, and messing up indentation is my main annoyance with less... You can improve less by chopping lines -S by default, but then you have horizontal scrolling so neither is great.
[0] In Vim, you can use K to open a man page for the word under the cursor
Here is what I'm using for fish:
if type -q neovim
set -gx MANPAGER "nvim +Man!"
# abbr --add man --set-cursor "nvim \"+hide Man %\""
end
I can finally retire fisher and decors/fish-colored-man. MANPAGER="vim +MANPAGER --not-a-term -"
Documentation can be found via :help manpager.vimI liked the idea of using nvim but i rewrote it with bash function for easier argument handling
nman () {
if [ $# -ne 1 ]; then
echo "Usage: nman <command>"
return 1
fi
command nvim "+hide Man $1"
}