Vim as a Man Page Viewer

December 20, 2014

Man pages are an essential part of every developer’s workflow. Unfortunately, the default system pager less isn’t the best interface. That’s why I wrote a Vim plugin and a short shell function to take care of opening man pages in Vim.

The Plugin

If you’re eager to dive right into the source or to install the plugin, head on over to the GitHub repository. It’s a whopping 32 SLOC, so feel free to peek under the hood.


You might be thinking, “But Jake, man works just fine for me, why would I switch?” I’m glad you asked!

Mouse Support

The first reason why I was interested in getting man pages to open in Vim was because I wanted to be able to scroll with the mouse. When I have to read man pages for a long time, usually as a part of some more all-encompasing bit of research, I find scrolling to be a much better interface for quickly perusing the content of a man page.

Syntax Highlighting

As it turns out, man pages have a syntax to them, and Vim does a pretty excellent job at highlighting them. Rather than talk about it, here are some screenshots. Note how code samples (C system calls and library functions) are also syntax highlighted appropriately.

Example 1
vman vim

Example 2
vman 3 printf

All the benefits of Vim

While less makes a good effort to emulate certain Vim keybindings (or maybe it’s the other way around, I don’t know which came first), less certainly falls short of the full power of Vim.

For example, once you’ve opened a man page in Vim, you can open a new tab or split side-by-side with the man page. Especially if you’re switching between Vim and the man page often, being able to open man pages in tabs or splits is invaluable.

Mine doesn’t look like yours!

A couple of my other plugins are showing in the screenshots above. I’m using the Solarized Dark color scheme, the plugin vim-airline to take over the statuslines at the very top and bottom, and iTerm2 on Mac OS X 10.10.

You can see my complete configuration on GitHub.


As a matter of fact, this was my first Vim plugin! If you notice anything out of place, even if it’s a small detail, I’d love to hear it. Make no assumptions about the reasoning behind why certain decisions were made, because I have none XD

Jake on the Web

If you cared enough to read that far, you should consider following me on GitHub or paying a visit to my homepage. If this post was about one of my open source projects, make sure to star it on GitHub! I love hearing what people think, so feel free to comment, open an issue, or send me an email.

Vim and Haskell in 2016 on OS X

Stephen Diehl’s article “Vim and Haskell in 2016” does a great job of outlining the quickest way to get a quality Haskell development experience. His post presumes Ubuntu; here we presume OS X. Continue reading

Let’s Have a Chat about Encryption

Published on April 17, 2016

SML Dev Setup

Published on March 09, 2016