mirror of
https://git.decapod.one/brethil/dotfiles
synced 2025-01-06 22:16:03 +01:00
zsh: add ffunctions (fuzzy functions list)
This commit is contained in:
parent
075e06df8f
commit
d9d88fb8de
|
@ -385,3 +385,13 @@ function which(){
|
|||
builtin which $@ | bat --language=zsh
|
||||
fi
|
||||
}
|
||||
|
||||
# list all functions, highlighted, using fzf (adapted from https://github.com/junegunn/fzf/releases/tag/v0.56.0)
|
||||
function ffunctions(){
|
||||
if [[ $(fzf --version | cut -d " " -f 1 | cut -d. -f 2) -ge 56 ]]; then
|
||||
gap_arg="--gap"
|
||||
fi
|
||||
declare -f | perl -0777 -pe 's/^}\n/}\0/gm' |
|
||||
bat --plain --language bash --color always |
|
||||
fzf --read0 --ansi --reverse --multi $gap_arg
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user