diff --git a/Examples.md b/Examples.md index 0f95a74..678b70f 100644 --- a/Examples.md +++ b/Examples.md @@ -2163,6 +2163,26 @@ fman() { # Get the colors in the opened man page itself export MANPAGER="sh -c 'col -bx | bat -l man -p --paging always'" ``` + +Same as above, but for Termux (Android). man -k behaves differently in Android. +```sh +#!/data/data/com.termux/files/usr/bin/bash +export MANPAGER=~/bin/pman +man -k . | fzf --height=100% --preview-window=up -q "$1" --prompt='man> ' \ + --preview $"echo {} | perl -p -e 's/[-\w, ]*, //; s/\((\d+).*/ \1/' \ + | awk '{printf \"%s \", \$2} {print \$1}' \ + | xargs -r man \ + | col -bx | bat -l man -p --color always " \ + | perl -p -e 's/[-\w, ]*, //; s/\((\d+).*/ \1/' \ + | awk '{printf "%s ", $2} {print $1}' \ + | xargs -n 2 -r man +``` +Here is ~/bin/pman: +```sh +#!/data/data/com.termux/files/usr/bin/bash +cat $* | col -bx | bat -l man -p --paging always +``` + #### fzf-man-pages widget (for zsh) Same functionality as above - with colored and syntax higlighting