diff options
author | Marc Cornellà <marc.cornella@live.com> | 2019-08-07 20:10:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-07 20:10:54 +0200 |
commit | 2156b4c08134e3918af78038416c407e4b28dbf6 (patch) | |
tree | 930f78ede08f551a0de72986fb083ea947202f49 /plugins/colored-man-pages/colored-man-pages.plugin.zsh | |
parent | 89366be43fd6ceff52a9da2f2edef654ab619514 (diff) | |
parent | 26aad59779b2cd7ce313798a4e6b76a29b9f2347 (diff) | |
download | zsh-2156b4c08134e3918af78038416c407e4b28dbf6.tar.gz zsh-2156b4c08134e3918af78038416c407e4b28dbf6.tar.bz2 zsh-2156b4c08134e3918af78038416c407e4b28dbf6.zip |
colored-man-pages: add option to color any help command (#7173)
This allows you to use `colored git log --help` for example, to get
colored output.
Diffstat (limited to 'plugins/colored-man-pages/colored-man-pages.plugin.zsh')
-rw-r--r-- | plugins/colored-man-pages/colored-man-pages.plugin.zsh | 8 |
1 files 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 "$@" } |