Using vim as a man page viewer
I love color on my terminal. Black and white editors and and man pages are boring and more difficult to read than simple syntax highlighting. Vim supports syntax highlighting for man pages. Using it is as simple as setting an environment variable.
MANPAGER=”col -b | vim -c ’set ft=man nomod nolist’ -”
You can add this line into your .bashrc to enable vim to be the man page viewer by default.
export MANPAGER=”col -b | vim -c ’set ft=man nomod nolist’ -”
The one problem with this is that it gets somewhat annoying to type :q to quit viewing a man page. The default man page viewer, less has ‘q’ mapped to quit. I map this in vim to make it easier to quit viewing files and man pages. Simply add this to your .vimrc file.
map q :q!
This will map the q key to quit vim while in visual mode. I’m not sure what q does by default but whatever it does I don’t use it.

Leave a Reply