# plugin - fzf # arch puts these here if [[ -a /usr/share/fzf/key-bindings.zsh ]] && [[ -a /usr/share/fzf/completion.zsh ]]; then export FZF_DEFAULT_OPTS='--no-height --no-reverse' source /usr/share/fzf/key-bindings.zsh source /usr/share/fzf/completion.zsh fi # magic navigation setopt autocd export CDPATH=".:$HOME:$HOME/devil:$HOME/src" alias -g ...='../..' alias -g ....='../../..' alias -g .....='../../../..' # a bit nicer life when copy/pasting commands from docs setopt interactive_comments # aliases alias cls=clear alias config='git --git-dir=$HOME/.dotfiles --work-tree=$HOME' # collapse spaces into tabs in-place # spacetotab [WIDTH=4] function spacetotab () { unexpand --tabs=${2:-4} --first-only "$1" > "$1.tmp" mv "$1.tmp" "$1" } # load remaining config for conf in "$ZDOTDIR/"*.zsh; do source "${conf}" done unset conf # display a fortune when opening an interactive terminal tty -s && fortune $HOME/fortunes 2>/dev/null ||: # startx if not already running an x server (e.g. via display manager) and only on tty1 if [ -z "${DISPLAY}" ] && [ "$(tty)" = "/dev/tty1" ]; then exec startx fi