Vim rocks! We all know that. It’s a really great editor and its various features make it great for programming (Screenshot editing LaTeX).
Now wouldn’t it be cool if you also could use Vim to view your man pages, syntax highlighting included? If you answered this question with “yes”, here are some good news, you really can do that!
I got this idea from a screenshot I saw somewhere else. Some googling led me to Vim Tip #167, which explains how to set up Vim as your $MANPAGER. Make sure you also add the vimscript posted there to your ~/.vim/after/syntax/man.vim, it really makes for some cool syntax highlighting and you can set extra options there (for example I use it to disable line numbers and code folding which I set in my default .vimrc but which I don’t need in manual pages).
Now wouldn’t it be even cooler if you also had Vim’s syntax highlighting in less? Well, you can, and it’s not even hard (inspired by Vim tip #121)!
Finally you have to export the the correct PAGER value to your environment (my example uses the bash shell, insert the following code either in your ~/.bashrc or your ~/.bash_profile):