m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 15:23:48 -05:00

Updated Examples (markdown)

Johan Widén
2023-03-04 12:55:52 +01:00
parent 7665a22b8c
commit 31d6140138

@@ -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