Linux man pages are gold, and much quicker than googling, but I hate having to learn yet another interface for what is just a text flatfile that’s a bit to big to fit on a single 80 x 24 character screen – I want to be able to “/pattern” to find what I’m looking for. While I’m at it, I may as well set my default pager to be vim across the board, not just for help files….. Less is good, more is better, but Vim is the vimmiest.
So, to set your default pager ($PAGER), the program your shell uses for viewing data that’s too big to fit on a single screen, to Vim, do the following:
Add to your .bashrc (/home/yourusername/.bashrc)
vim -R -c 'set ft=man nomod nolist' -c 'map q :q<CR>' \
-c 'map <SPACE> <C-D>' -c 'map b <C-U>' \
-c 'nmap K :Man <C-R>=expand(\\\"<cword>\\\")<CR><CR>' -\""
That will call Vim. Inside Vim, there may be another override to use a different pager, so we need to clear that by adding to your .vimrc (/home/yourusername/.vimrc)
Reload your .bashrc
And you’re good to go!