›INDEX
Last Updated:

Pretty Man Pages

Are you tired of looking at white text on a black background (or black text on a white background) when you read a man page? Well, I found a great solution using the bat command to make the man command a lot prettier!

Before:

before-bat-command

After:

after-bat-command

Before you can use the bat command, you're going to have to install it. You can find how to install this command by going here: https://github.com/sharkdp/bat#installation

To set man to use this "pager" instead of the default one, you need to add the following line to your .bashrc or .zshrc or whatever config file your shell requires. Check which shell you're using by running: echo $SHELL.

export MANPAGER="sh -c 'col -bx | bat -l man -p'"

NOTE: replace bat with batcat if you're on Debian or Ubuntu.

Once you've added it, you should source your config file by running source ~/.bashrc or source <your config file>.

If you see formatting issues then add the following line right after the previous one:

export MANROFFOPT="-c"

Now, if you try to read a man page, it's going to be a lot easier. Read the details of this feature here: https://github.com/sharkdp/bat#man

Sources

Enjoy the notes on this website? Consider supporting me in this adventure in you preferred way: Support me.