From 9eb5d323a12a8c3b36c0fe72c06d77451096b166 Mon Sep 17 00:00:00 2001 From: schwert Date: Tue, 27 Apr 2021 22:58:39 +0200 Subject: [PATCH] man pages with colors --- Examples.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Examples.md b/Examples.md index 915395a..f25a5fc 100644 --- a/Examples.md +++ b/Examples.md @@ -1613,6 +1613,15 @@ function fman() { } ``` +Same as above, but the preview is colored with [bat](https://github.com/sharkdp/bat) +```sh +fman() { + man -k . | fzf -q "$1" --prompt='man> ' --preview $'echo {} | tr -d \'()\' | awk \'{printf "%s ", $2} {print $1}\' | xargs -r man | col -bx | bat -l man -p --color always' | tr -d '()' | awk '{printf "%s ", $2} {print $1}' | xargs -r man +} +# Get the colors in the opened man page itself +export MANPAGER="sh -c 'col -bx | bat -l man -p --paging always'" +``` + ### Python Behave BDD Tab copy the step name.