# Antigen Stuff ADOTDIR="$HOME/.antigen" [ ! -e "$ADOTDIR" ] && git clone https://github.com/zsh-users/antigen.git "$ADOTDIR" source "$ADOTDIR/antigen.zsh" # Temporary, hopefully remove later when antigen correctly fails to shallow clone from http [ ! -e "$ADOTDIR/bundles/zsh/fred-prompt" ] && git clone https://adamgoldsmith.name/cgit/zsh/fred-prompt.git/ $ADOTDIR/bundles/zsh/fred-prompt antigen bundles </dev/null && eval "$(fasd --init auto)" # Load run-help unalias run-help autoload run-help # Auto start tmux if a remote connection if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -n "$SSH_TTY" ]] then # Attach only to the 'auto' session exec tmux new-session -A -s 'auto' fi # History Substring Search bindings (PageUp and PageDown) bindkey '^[[5~' history-substring-search-up bindkey '^[[6~' history-substring-search-down # Expands ... to ../.. function expand-dot-to-parent-directory-path { if [[ $LBUFFER = *.. ]]; then LBUFFER+='/..' else LBUFFER+='.' fi } zle -N expand-dot-to-parent-directory-path bindkey -M emacs "." expand-dot-to-parent-directory-path bindkey -M isearch "." self-insert # Inserts 'sudo ' at the beginning of the line. function prepend-sudo() { if [[ "$BUFFER" != su(do|)\ * ]]; then BUFFER="sudo $BUFFER" (( CURSOR += 5 )) fi } zle -N prepend-sudo bindkey "^X^S" prepend-sudo # Control-Backspace and Control-Delete bindkey '^H' backward-kill-word bindkey '5~' kill-word