Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

12
  • 3
    @DrEval because aliases are shell and user-specific while man is global. It has no knowledge of your aliases, functions, scripts etc. Commented Sep 28, 2017 at 10:04
  • 1
    @DrEval I have alias emacs='$VISUAL'; alias vi='$VISUAL'; alias vim='$VISUAL' on many of my machines. Would you propose man try to expand these (if it could even see them) to try to figure out what command that refers to? Commented Sep 28, 2017 at 10:09
  • 1
    @DrEval Define "simple". In my case, if $VISUAL happens to be nano, then man emacs would display the wrong page, and man '$VISUAL' would say there is no manual entry for $VISUAL. If it is to expand the variable, it has to know how, and then you're reimplementing half the shell just to display a manpage (possible hyperbole) Commented Sep 28, 2017 at 10:14
  • 2
    @DrEval I don't know about terdon's case, but in mine, the output of alias vi is literally alias vi='$VISUAL'. That is, the variable itself is the output, not its contents Commented Sep 28, 2017 at 10:24
  • 2
    If you are really desperate, you can copy /usr/share/man/man1/vim.1.gz to somewhere independent and then copy your nvim man page to /usr/share/man/man1/vim.1.gz. After this run "mandb" Commented Sep 28, 2017 at 10:29