summaryrefslogtreecommitdiff
path: root/mac/.local/bin/fzffiles
diff options
context:
space:
mode:
Diffstat (limited to 'mac/.local/bin/fzffiles')
-rwxr-xr-xmac/.local/bin/fzffiles7
1 files changed, 4 insertions, 3 deletions
diff --git a/mac/.local/bin/fzffiles b/mac/.local/bin/fzffiles
index 97047e9..454bf79 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
@@ -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)