Add some fzf functions

This commit is contained in:
David Morgan 2022-12-02 12:23:32 +00:00
parent c4a71cbc90
commit 39cd18a854
Signed by: djm
GPG Key ID: C171251002C200F2
1 changed files with 9 additions and 0 deletions

View File

@ -136,6 +136,15 @@
stty -ixon
function generate () { gopass generate -s -p $1 $((RANDOM % 14 + 45)) }
function fcd { cd $(fd -L --max-depth=''${1:-1} --type=d 2>/dev/null | fzf-tmux) }
fif() {
if [ ! "$#" -gt 0 ]; then
echo "usage: fif <SEARCH_TERM>"
return 1;
fi
rg --files-with-matches --no-messages "$1" | fzf $FZF_PREVIEW_WINDOW --preview "rg --ignore-case --pretty --context 10 '$1' {}"
}
tre () { command tre "$@" -e && source "/tmp/tre_aliases_$USER" 2>/dev/null; }