ohmyzsh/plugins/colored-man-pages
Adam Spiers 77d0c6afa4 fix(colored-man-pages): quote array expansion in colored function
Unquoted $environment expansion causes a 'bad pattern' error when the
GLOB_SUBST option is set, because zsh then treats the ANSI escape
sequences in LESS_TERMCAP_* values (e.g. ESC[00m) as glob patterns.
2026-02-22 16:46:42 +00:00
..
colored-man-pages.plugin.zsh fix(colored-man-pages): quote array expansion in colored function 2026-02-22 16:46:42 +00:00
nroff refactor(colored-man-pages): move nroff wrapper and refactor logic in colored function (#9437) 2020-11-12 19:32:17 +01:00
README.md refactor(colored-man-pages): move nroff wrapper and refactor logic in colored function (#9437) 2020-11-12 19:32:17 +01:00

Colored man pages plugin

This plugin adds colors to man pages.

To use it, add colored-man-pages to the plugins array in your zshrc file:

plugins=(... colored-man-pages)

It will also automatically colorize man pages displayed by dman or debman, from debian-goodies.

You can also try to color other pages by prefixing the respective command with colored:

colored git help clone

Customization

The plugin declares global associative array less_termcap, which maps termcap capabilities to escape sequences for the less pager. This mapping can be further customized by the user after the plugin is loaded. Check out sources for more.

For example: less_termcap[md] maps to LESS_TERMCAP_md which is the escape sequence that tells less how to print something in bold. It's currently shown in bold red, but if you want to change it, you can redefine less_termcap[md] in your zshrc file, after OMZ is sourced:

less_termcap[md]="${fg_bold[blue]}" # this tells less to print bold text in bold blue