b427a41fd3401947242711d0b181faed31c349e0

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #1779 from lorn/fasd_update

Cache for fasd --init

Diff

 1diff --git a/plugins/fasd/fasd.plugin.zsh b/plugins/fasd/fasd.plugin.zsh
 2index d42584f1a49b6236f2104fd8e54837e678a10a01..8ad43fc233012bfdd8978976e6d9d54db26e0381 100644
 3--- a/plugins/fasd/fasd.plugin.zsh
 4+++ b/plugins/fasd/fasd.plugin.zsh
 5@@ -1,5 +1,10 @@
 6 if [ $commands[fasd] ]; then # check if fasd is installed
 7-  eval "$(fasd --init auto)"
 8+  fasd_cache="$HOME/.fasd-init-cache"
 9+  if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then
10+    fasd --init auto >| "$fasd_cache"
11+  fi
12+  source "$fasd_cache"
13+  unset fasd_cache
14   alias v='f -e vim'
15   alias o='a -e open'
16 fi