Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Expanding on pjmlp's comment [0] buried in this thread:

    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

[1] https://neovim.io/doc/user/filetype.html#ft-man-plugin



Thank you for this. This is actually quite marvelous.

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.


The vanilla vim version is

    MANPAGER="vim +MANPAGER --not-a-term -"
Documentation can be found via :help manpager.vim


the crawlers are working hard today because I got lead here just by searching for a better man page on kagi

I 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"
  }




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: