mirror of
https://git.decapod.one/brethil/dotfiles
synced 2024-11-21 19:11:30 +01:00
20 lines
413 B
Bash
20 lines
413 B
Bash
function fuzzyman() {
|
|
local preview_cmd
|
|
preview_cmd='command man {+1} 2>/dev/null | bat --style=plain --language=man --color=always'
|
|
|
|
apropos_args=$@
|
|
if [[ -z $apropos_args ]]; then
|
|
apropos_args="."
|
|
fi
|
|
|
|
man $(command man -k "${apropos_args}" \
|
|
| fzf \
|
|
--preview="${preview_cmd}" \
|
|
--preview-window=right,60% \
|
|
| awk '{print $1}'
|
|
)
|
|
|
|
}
|
|
|
|
compdef _man fuzzyman=man
|