From 23688fc7ab925111fdb0db07670b6b641e380ec9 Mon Sep 17 00:00:00 2001 From: Iulian Onofrei <6d0847b9@opayq.com> Date: Sat, 29 Sep 2018 17:01:41 +0300 Subject: [PATCH 1/2] Add option to color any help command This allows you to use `colored git log --help` for example, to get colored output. --- plugins/colored-man-pages/colored-man-pages.plugin.zsh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/colored-man-pages/colored-man-pages.plugin.zsh b/plugins/colored-man-pages/colored-man-pages.plugin.zsh index 1bea536e0..ac6a94654 100644 --- a/plugins/colored-man-pages/colored-man-pages.plugin.zsh +++ b/plugins/colored-man-pages/colored-man-pages.plugin.zsh @@ -16,7 +16,7 @@ EOF fi fi -function man() { +function colored() { env \ LESS_TERMCAP_mb=$(printf "\e[1;31m") \ LESS_TERMCAP_md=$(printf "\e[1;31m") \ @@ -28,5 +28,9 @@ function man() { PAGER="${commands[less]:-$PAGER}" \ _NROFF_U=1 \ PATH="$HOME/bin:$PATH" \ - man "$@" + "$@" +} + +function man() { + colored man "$@" } From 26aad59779b2cd7ce313798a4e6b76a29b9f2347 Mon Sep 17 00:00:00 2001 From: Iulian Onofrei Date: Sun, 4 Aug 2019 00:33:40 +0300 Subject: [PATCH 2/2] Add README file --- plugins/colored-man-pages/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 plugins/colored-man-pages/README.md diff --git a/plugins/colored-man-pages/README.md b/plugins/colored-man-pages/README.md new file mode 100644 index 000000000..d9f6acb2a --- /dev/null +++ b/plugins/colored-man-pages/README.md @@ -0,0 +1,15 @@ +# 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: + +```zsh +plugins=(... colored-man-pages) +``` + +You can also try to color other pages by prefixing the respective command with `colored`: + +```zsh +colored git help clone +```