From 621de1e20bbe97dc6d867be47b8e797280bb079c Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Mon, 30 Mar 2020 18:13:12 +0000 Subject: [PATCH] colorized-man-pages: add hooks for dman and debman commands (#8776) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * colorized-man-pages: Added hooks for commands dman and debman `dman` and `debman` are tools from the package `debian-goodies` for Debian systems (see https://packages.debian.org/stable/debian-goodies). They can display man pages from manpages.debian.org or local debian packages respectively. README of the plugin is also updated. * Simplify syntax for future changes * Fix README syntax Co-authored-by: Marc Cornellà --- plugins/colored-man-pages/README.md | 3 +++ plugins/colored-man-pages/colored-man-pages.plugin.zsh | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/colored-man-pages/README.md b/plugins/colored-man-pages/README.md index d9f6acb2a..f34941e73 100644 --- a/plugins/colored-man-pages/README.md +++ b/plugins/colored-man-pages/README.md @@ -8,6 +8,9 @@ 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`](https://packages.debian.org/stable/debian-goodies). + You can also try to color other pages by prefixing the respective command with `colored`: ```zsh diff --git a/plugins/colored-man-pages/colored-man-pages.plugin.zsh b/plugins/colored-man-pages/colored-man-pages.plugin.zsh index f74105d40..ec518472c 100644 --- a/plugins/colored-man-pages/colored-man-pages.plugin.zsh +++ b/plugins/colored-man-pages/colored-man-pages.plugin.zsh @@ -31,6 +31,9 @@ function colored() { "$@" } -function man() { - colored man "$@" +# Colorize man and dman/debman (from debian-goodies) +function man \ + dman \ + debman { + colored $0 "$@" }