Skip to content

Instantly share code, notes, and snippets.

@ChrisPenner
Last active August 15, 2019 20:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ChrisPenner/cc7c7154fc13c9b66ad7 to your computer and use it in GitHub Desktop.
Save ChrisPenner/cc7c7154fc13c9b66ad7 to your computer and use it in GitHub Desktop.
Use Vim as a man pages viewer.
# Set this in your ~/.bash_profile
export PAGER="/bin/sh -c \"unset PAGER;col -b -x | \
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>' -\""
# Set this in your ~/.vimrc (This will allow using 'K' to look up man pages inside vim.
let $PAGER=''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment