diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-20 13:27:38 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-20 13:27:38 +0200 |
| commit | fafdf895e24fd15844fba2668003da77a3dbf0e4 (patch) | |
| tree | a5c9d1dcb19a779a41d218ba1af6038ef8763bbf | |
| parent | 0e9813a5f287df6db030c5aa1abb68691ffb212e (diff) | |
Update
| -rw-r--r-- | fish/conf.d/quickedit.fish | 16 |
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" |
