summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2014-04-13 09:50:36 +0100
committerAlan Pearce2014-04-13 09:50:36 +0100
commit53861212825c8cf6096a30e1d047931286e85846 (patch)
tree0a9e925388737a18aa8884070e8e729656df3746
parentee6d56fdaba008f2b16afdbd400021afa6231b36 (diff)
downloaddotfiles-53861212825c8cf6096a30e1d047931286e85846.tar.lz
dotfiles-53861212825c8cf6096a30e1d047931286e85846.tar.zst
dotfiles-53861212825c8cf6096a30e1d047931286e85846.zip
zsh: Compile fasd and use as a function.
-rwxr-xr-xhooks/post-up/zsh10
-rwxr-xr-xtag-zsh/config/zsh/zshrc1
2 files changed, 11 insertions, 0 deletions
diff --git a/hooks/post-up/zsh b/hooks/post-up/zsh
index e69362b..05a7237 100755
--- a/hooks/post-up/zsh
+++ b/hooks/post-up/zsh
@@ -39,4 +39,14 @@ for fp in $ZDOTDIR/functions/*(/); do
 	zrecompile -p $fp $fp/*
 done
 
+if [[ -s $commands[fasd] ]]; then
+	if [[ ! -d $ZDOTDIR/functions/fasd ]]; then
+		mkdir $ZDOTDIR/functions/fasd
+	fi
+	if [[ ! -h $ZDOTDIR/functions/fasd/fasd ]]; then
+		ln -s =fasd $ZDOTDIR/functions/fasd/fasd
+	fi
+	zrecompile -p $ZDOTDIR/functions/fasd $ZDOTDIR/functions/fasd/fasd
+fi
+
 [[ -f ~/.zsh/fasd-data ]] && mv ~/.zsh/fasd-data ~/.cache/zsh/fasd-data
diff --git a/tag-zsh/config/zsh/zshrc b/tag-zsh/config/zsh/zshrc
index eff4039..40af65c 100755
--- a/tag-zsh/config/zsh/zshrc
+++ b/tag-zsh/config/zsh/zshrc
@@ -355,6 +355,7 @@ ec () {
 }
 
 _FASD_DATA="$HOME/.cache/zsh/fasd-data"
+autoload -U fasd
 source ~/.cache/zsh/fasd-init-zsh
 
 if [[ $OSTYPE == freebsd* ]]; then