summaryrefslogtreecommitdiff
path: root/mac/.local/bin/fzffiles
diff options
context:
space:
mode:
Diffstat (limited to 'mac/.local/bin/fzffiles')
-rwxr-xr-xmac/.local/bin/fzffiles9
1 files changed, 5 insertions, 4 deletions
diff --git a/mac/.local/bin/fzffiles b/mac/.local/bin/fzffiles
index 97047e9..6c0bcfd 100755
--- a/mac/.local/bin/fzffiles
+++ b/mac/.local/bin/fzffiles
@@ -11,7 +11,7 @@ IFS='
files=$(fzf-tmux \
--header "^a pwd ^b public ^d .dotfiles ^f configs ^g git ^h home ^k desktop ^r scripts ^s suckless ^u staged files ^v private ^/ help" \
--preview "selection={};
- clean=\$(printf '%s' \"\$selection\" | sed -e 's/^📄 //' -e 's/^✏️ //' -e 's/^✅ //' -e 's/^❌ //' -e 's/^🔀 //' -e 's/^❓ //');
+ clean=\$(printf '%s' \"\$selection\" | sed -e 's/^📄 //' -e 's/^✏️ //' -e 's/^✅ //' -e 's/^❌ //' -e 's/^🔀 //' -e 's/^🗑️ //' -e 's/^❓ //');
[ -z \"\$clean\" ] && { echo 'No selection'; exit 0; }
target=\$(readlink -f \"\$clean\" 2>/dev/null || printf '%s' \"\$clean\");
if [ -z \"\$target\" ]; then
@@ -35,7 +35,7 @@ files=$(fzf-tmux \
fi
fi
if [ -d \"\$target\" ]; then
- exa --color=always --long --all --header --icons --git \"\$target\"
+ eza --color=always --long --all --header --icons --git \"\$target\"
elif [ -f \"\$target\" ]; then
bat --color=always --style=header,grid --line-range=:500 \"\$target\"
else
@@ -61,7 +61,8 @@ files=$(fzf-tmux \
file=substr(\$0,4);
gsub(/^ +/, \"\", file);
if (file == \"\") next;
- if (staged == \"?\" && unstaged == \"?\") icon=\"📄\";
+ if (staged == \"D\" || unstaged == \"D\") icon=\"🗑️\";
+ else if (staged == \"?\" && unstaged == \"?\") icon=\"📄\";
else if (staged == \"!\" && unstaged == \"!\") icon=\"❌\";
else if (staged != \" \" && staged != \"?\" && unstaged != \" \" && unstaged != \"?\") icon=\"🔀\";
else if (staged != \" \" && staged != \"?\") icon=\"✅\";
@@ -85,7 +86,7 @@ files=$(fzf-tmux \
# Check if any files were selected, and exit if not
[ -z "$files" ] && exit 0
-files=$(printf '%s\n' "$files" | sed -e 's/^📄 //' -e 's/^✏️ //' -e 's/^✅ //' -e 's/^❌ //' -e 's/^🔀 //' -e 's/^❓ //')
+files=$(printf '%s\n' "$files" | sed -e 's/^📄 //' -e 's/^✏️ //' -e 's/^✅ //' -e 's/^❌ //' -e 's/^🔀 //' -e 's/^🗑️ //' -e 's/^❓ //')
if [ -d "$files" ]; then
absolute_files=$(realpath $files)