#!/usr/bin/env zsh ZDOTDIR="${XDG_CONFIG_HOME:=~/.config}/zsh" pushd $ZDOTDIR for f in z*(-.) do if [[ -e .$f ]] then if [[ ! -h .$f ]] then echo ".$f already exists as a regular file, ignoring" fi else ln -s $f .$f fi done popd if [[ ! -d ~/.cache/zsh ]] then mkdir -p ~/.cache/zsh fi local -a zfiles zfiles=($ZDOTDIR/zshrc) autoload -U zrecompile if [[ -f $ZDOTDIR/${HOST%%.*}.zsh ]]; then zfiles+=$ZDOTDIR/${HOST%%.*}.zsh fi if [[ $OSTYPE == freebsd* ]]; then zfiles+=$ZDOTDIR/freebsd.zsh fi autoload -Uz compinit compinit -u -d ~/.cache/zsh/compdump zrecompile -p -R $ZDOTDIR/.zshrc.zwc $zfiles -- \ -M ~/.cache/zsh/compdump 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 fi for fp in $ZDOTDIR/functions/*(/); do zrecompile -p $fp $fp/* done [[ -f ~/.zsh/fasd-data ]] && mv ~/.zsh/fasd-data ~/.cache/zsh/fasd-data [[ -f ~/.zsh/history ]] && mv ~/.zsh/history ~/.cache/zsh/history