diff options
author | Brahmajit Das <brahmajit.xyz@gmail.com> | 2024-04-28 21:20:58 +0530 |
---|---|---|
committer | Brahmajit Das <brahmajit.xyz@gmail.com> | 2024-04-28 21:20:58 +0530 |
commit | de5982fa30dd5f27c4545cfb2a9ed101813b3634 (patch) | |
tree | 9eb048ca51a75dd3e85d4c48a034df702ce38820 | |
parent | 4362ed96d0abbb99adb7c0d69eeccb0a44e7b706 (diff) |
zsh: aliases: adding fman function
Using fzf to find man pages.
Needs man-db, and tr.
-rw-r--r-- | .config/zsh/aliases.zsh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/.config/zsh/aliases.zsh b/.config/zsh/aliases.zsh index 43efdaf..2b317e2 100644 --- a/.config/zsh/aliases.zsh +++ b/.config/zsh/aliases.zsh @@ -81,3 +81,7 @@ function ss () { alias get_idf='. $HOME/esp/esp-idf/export.sh' export MENUCONFIG_STYLE=monochrome export IDF_ENABLE_CCACHE=1 + +function fman() { + man -k . | fzf -q "$1" --prompt='man> ' --preview $'echo {} | tr -d \'()\' | awk \'{printf "%s ", $2} {print $1}\' | xargs -r man' | tr -d '()' | awk '{printf "%s ", $2} {print $1}' | xargs -r man +} |