global/*: add better fzf args

This commit is contained in:
Infinidoge 2024-09-16 01:08:06 -04:00
parent a0230ba810
commit a02bd9d73c
Signed by: Infinidoge
SSH key fingerprint: SHA256:oAMyvotlNFraMmZmr+p6AxnNfW/GioTs1pOn3V4tQ7A
3 changed files with 8 additions and 8 deletions

View file

@ -96,9 +96,9 @@ in
universe.packages = [ universe.packages = [
(pkgs.writeScriptBin "editi" '' (pkgs.writeScriptBin "editi" ''
if [[ $# -eq 0 ]] then if [[ $# -eq 0 ]] then
$EDITOR "$(fd -H -t f | fzf)" $EDITOR "$(fd -H -t f | fzf --filepath-word --multi)"
else else
$EDITOR "$(fd -H -t f | fzf -1 -q "$*")" $EDITOR "$(fd -H -t f | fzf --filepath-word --multi -1 -q "$*")"
fi fi
'') '')
]; ];

View file

@ -9,9 +9,9 @@
echo "Not in a git repository" echo "Not in a git repository"
exit 1 exit 1
elif [[ $# -eq 0 ]] then elif [[ $# -eq 0 ]] then
echo "$(git ls-files | fzf)" echo "$(git ls-files | fzf --filepath-word --multi)"
else else
echo "$(git ls-files | fzf -1 -q "$*")" echo "$(git ls-files | fzf --filepath-word --multi -1 -q "$*")"
fi fi
'') '')
(writeScriptBin "git-fzf-edit" '' (writeScriptBin "git-fzf-edit" ''
@ -20,9 +20,9 @@
echo "Not in a git repository" echo "Not in a git repository"
exit 1 exit 1
elif [[ $# -eq 0 ]] then elif [[ $# -eq 0 ]] then
$EDITOR "$(git ls-files | fzf)" $EDITOR "$(git ls-files | fzf --filepath-word --multi)"
else else
$EDITOR "$(git ls-files | fzf -1 -q "$*")" $EDITOR "$(git ls-files | fzf --filepath-word --multi -1 -q "$*")"
fi fi
'') '')
]; ];

View file

@ -40,9 +40,9 @@
j() { j() {
if [[ $# -eq 0 ]] then if [[ $# -eq 0 ]] then
\builtin cd -- "$(fd -H -t d | fzf)" \builtin cd -- "$(fd -H -t d | fzf --filepath-word)"
else else
\builtin cd -- "$(fd -H -t d | fzf -1 -q "$*")" \builtin cd -- "$(fd -H -t d | fzf --filepath-word -1 -q "$*")"
fi fi
} }