summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLindolfo 'Lorn' Rodrigues <lorn@lornlab.org>2013-04-30 01:51:09 -0300
committerLindolfo 'Lorn' Rodrigues <lorn@lornlab.org>2013-04-30 02:04:09 -0300
commitf28e16a15856baf92163dba8ac6eec1e02cf6c1f (patch)
tree3a1e1220906a027d924dc48485445a201d40e877
parentb6ea876971b2270a2c73a07a6f6a337604132c6f (diff)
downloadzsh-f28e16a15856baf92163dba8ac6eec1e02cf6c1f.tar.gz
zsh-f28e16a15856baf92163dba8ac6eec1e02cf6c1f.tar.bz2
zsh-f28e16a15856baf92163dba8ac6eec1e02cf6c1f.zip
Cache for fasd --init
Using cache technique for faster fasd --init as shown at: https://github.com/clvv/fasdi#install
-rw-r--r--plugins/fasd/fasd.plugin.zsh7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/fasd/fasd.plugin.zsh b/plugins/fasd/fasd.plugin.zsh
index d42584f1a..8ad43fc23 100644
--- a/plugins/fasd/fasd.plugin.zsh
+++ b/plugins/fasd/fasd.plugin.zsh
@@ -1,5 +1,10 @@
if [ $commands[fasd] ]; then # check if fasd is installed
- eval "$(fasd --init auto)"
+ fasd_cache="$HOME/.fasd-init-cache"
+ if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then
+ fasd --init auto >| "$fasd_cache"
+ fi
+ source "$fasd_cache"
+ unset fasd_cache
alias v='f -e vim'
alias o='a -e open'
fi