2016-12-02 12:08:59 -05:00
|
|
|
# Antigen Stuff
|
|
|
|
ADOTDIR="$HOME/.antigen"
|
|
|
|
[ ! -e "$ADOTDIR" ] && git clone https://github.com/zsh-users/antigen.git "$ADOTDIR"
|
|
|
|
source "$ADOTDIR/antigen.zsh"
|
|
|
|
|
2017-09-01 15:29:13 -04:00
|
|
|
# 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
|
|
|
|
|
2016-12-02 12:08:59 -05:00
|
|
|
antigen bundles <<EOBUNDLES
|
2017-09-01 15:29:13 -04:00
|
|
|
https://adamgoldsmith.name/cgit/zsh/fred-prompt.git prompt_fred_setup
|
2016-12-02 12:08:59 -05:00
|
|
|
zsh-users/zsh-syntax-highlighting
|
|
|
|
zsh-users/zsh-history-substring-search
|
|
|
|
Eriner/zim modules/directory
|
|
|
|
Eriner/zim modules/git
|
|
|
|
Eriner/zim modules/history
|
|
|
|
Eriner/zim modules/input
|
|
|
|
Eriner/zim modules/utility
|
2017-09-01 15:28:49 -04:00
|
|
|
Eriner/zim modules/completion
|
2016-12-02 12:08:59 -05:00
|
|
|
EOBUNDLES
|
|
|
|
antigen apply
|
2016-01-22 19:06:27 -05:00
|
|
|
|
|
|
|
# Command Specific Aliases
|
|
|
|
for i in $HOME/.aliases/command-specific/*
|
|
|
|
do
|
|
|
|
if hash $(basename $i) 2>/dev/null
|
|
|
|
then
|
|
|
|
source $i
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# General Aliases
|
|
|
|
source $HOME/.aliases/general
|
|
|
|
|
|
|
|
# Various Options
|
2017-09-02 14:08:32 -04:00
|
|
|
setopt EXTENDED_GLOB
|
2017-09-02 14:13:24 -04:00
|
|
|
unsetopt NOMATCH
|
2016-12-02 12:08:59 -05:00
|
|
|
setopt CORRECT
|
2016-01-22 19:06:27 -05:00
|
|
|
CORRECT_IGNORE="_*"
|
2016-12-02 12:08:59 -05:00
|
|
|
zhighlighters=(main brackets)
|
2016-01-22 19:06:27 -05:00
|
|
|
stty -ixon #disable XON/XOFF, which breaks C-s
|
2016-02-15 11:20:23 -05:00
|
|
|
setopt no_share_history
|
2017-09-02 13:50:05 -04:00
|
|
|
# rehashes on bin change, might cause performance issues
|
|
|
|
zstyle ':completion:*' rehash true
|
2016-01-22 19:06:27 -05:00
|
|
|
|
|
|
|
#load fasd if it exists
|
|
|
|
hash fasd 2>/dev/null && eval "$(fasd --init auto)"
|
2016-02-15 11:20:39 -05:00
|
|
|
|
|
|
|
# Load run-help
|
|
|
|
unalias run-help
|
|
|
|
autoload run-help
|
|
|
|
|
2016-02-15 11:20:51 -05:00
|
|
|
# Auto start tmux if a remote connection
|
2016-12-02 12:49:33 -05:00
|
|
|
if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -n "$SSH_TTY" ]]
|
2016-02-15 11:20:51 -05:00
|
|
|
then
|
2016-12-02 12:49:33 -05:00
|
|
|
# Attach only to the 'auto' session
|
|
|
|
exec tmux new-session -A -s 'auto'
|
|
|
|
fi
|
|
|
|
|
2016-12-02 12:50:17 -05:00
|
|
|
|
2017-09-02 13:47:07 -04:00
|
|
|
# History Substring Search bindings (PageUp and PageDown)
|
2016-12-02 12:50:17 -05:00
|
|
|
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+='.'
|
2016-02-15 11:20:51 -05:00
|
|
|
fi
|
2016-12-02 12:50:17 -05:00
|
|
|
}
|
|
|
|
zle -N expand-dot-to-parent-directory-path
|
|
|
|
bindkey -M emacs "." expand-dot-to-parent-directory-path
|
2016-02-15 11:20:51 -05:00
|
|
|
|
2016-12-02 12:50:17 -05:00
|
|
|
# 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
|
2016-02-15 11:20:51 -05:00
|
|
|
|
2017-09-02 13:46:36 -04:00
|
|
|
# Control-Backspace and Control-Delete
|
2016-12-02 12:50:17 -05:00
|
|
|
bindkey '^H' backward-kill-word
|
2017-09-02 13:46:36 -04:00
|
|
|
bindkey '5~' kill-word
|