Open man pages in Vim

2020-04-22

Man · Manual · Vim

1 minute

Most of the time when I open a man page for a certain command or tool, I use Vim:

# Open man page for the 'dd' command:
$ man dd | col -b | vim -MR -

It’s actually a handful to type but since I use zsh + fzf, it’s not really a big deal as recalling the command is pretty straightforward.

But yesterday, I came across this nifty little plugin called vim-manpager. I tried adding it to my vimrc, added the environment variable below to my zshrc:

export MANPAGER="vim -c MANPAGER -"

And now, I can open all man pages by calling the man command directly. I can also open man pages directly from within Vim. Brilliant!