summaryrefslogtreecommitdiff
path: root/fish
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-20 21:26:07 +0200
committerPaul Buetow <paul@buetow.org>2026-02-20 21:26:07 +0200
commitc2ad8e4aa2f827111ca0dcdf277243edb66740db (patch)
treeea8b50d9b35323531be213146a429eec500f38d9 /fish
parente29711f39647ca765ab93397136ba795456142a5 (diff)
parentfafdf895e24fd15844fba2668003da77a3dbf0e4 (diff)
Merge branch 'master' of codeberg.org:snonux/dotfiles
Diffstat (limited to 'fish')
-rw-r--r--fish/conf.d/quickedit.fish16
1 files changed, 12 insertions, 4 deletions
diff --git a/fish/conf.d/quickedit.fish b/fish/conf.d/quickedit.fish
index af79c84..eee5005 100644
--- a/fish/conf.d/quickedit.fish
+++ b/fish/conf.d/quickedit.fish
@@ -38,7 +38,15 @@ function quickedit
end
cd $QUICKEDIT_DIR
- if not test -f .index -o (math (date +%s) - (stat -c %Y .index)) -gt 86400
+ set -l index_age 99999
+ if test -f .index
+ if test (uname) = Darwin
+ set index_age (math (date +%s) - (stat -f %m .index))
+ else
+ set index_age (math (date +%s) - (stat -c %Y .index))
+ end
+ end
+ if test $index_age -gt 86400
echo Indexing quickedit
find -L . -type f -not -path '*/.*' | sort >$QUICKEDIT_DIR/.index.tmp && mv $QUICKEDIT_DIR/.index.tmp $QUICKEDIT_DIR/.index
end
@@ -61,14 +69,14 @@ function quickedit
cd $prev_dir
end
-function quickedit::force_index
+function slowedit
if test -f $QUICKEDIT_DIR/.index
rm $QUICKEDIT_DIR/.index
end
- quickedit
+ quickedit $argv
end
-abbr -e E quickedit::force_index
+abbr -e E slowedit
abbr -a e quickedit
abbr -a er "ranger $QUICKEDIT_DIR"
abbr -a cdquickedit "cd $QUICKEDIT_DIR"