Reverse fzf in git pickers

This commit is contained in:
Talia 2025-03-12 15:17:51 +01:00
parent 696701e420
commit 9df7d07b95
2 changed files with 3 additions and 3 deletions

View file

@ -3,6 +3,6 @@
root=$1
shift 1
if [ -n "$*" ]
then find $root -type d -name .git | xargs -L 1 dirname | fzf -1 -q "$*"
else find $root -type d -name .git | xargs -L 1 dirname | fzf -1
then find $root -type d -name .git | xargs -L 1 dirname | fzf --reverse -1 -q "$*"
else find $root -type d -name .git | xargs -L 1 dirname | fzf --reverse -1
fi

View file

@ -21,6 +21,6 @@ do
type=$(echo $line | cut -b -3)
/bin/echo -e "$type\x00$(basename $path)\x00$path"
done \
| fzf --multi --with-nth=2 -d '\0' -q "$*" --history=$history \
| fzf --reverse --multi --with-nth=2 -d '\0' -q "$*" --history=$history \
--preview='if [ ${1} = "??" ]; then /bin/echo -e "\x1b[32m"; cat {3}; else git diff --color {3}; fi' \
| cut -d "$null" -f 3-