alias ls='ls --color=auto' alias mailx='/usr/local/bin/mailx' alias grep='grep --color' alias vim='nvim' alias vi='nvim' # cd tricks alias -- -='cd -' setopt auto_cd # there is no binary by that name in your $PATH, your shell will cd into it that directory bindkey -v if [ "${TERM}" = "xterm" ]; then TERM=xterm-256color fi case $TERM in xterm*|st-256color|rxvt-unicode-256color) print -Pn "\e]0;%m\a" ;; esac if [ -e /usr/bin/keychain ]; then eval $(/usr/bin/keychain --eval --agents ssh -Q --quiet id_ed25519) fi # direnv setup whence -p direnv &>/dev/null && eval "$(direnv hook zsh)" # Highlight the current autocomplete option zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" # asdf setup if [ -e $HOME/.asdf/asdf.sh ]; then . "$HOME/.asdf/asdf.sh" fpath=(${ASDF_DIR}/completions $fpath) fi # Better SSH/Rsync/SCP Autocomplete #zstyle ':completion:*:(scp|rsync):*' tag-order ' hosts:-ipaddr:ip\ address hosts:-host:host files' #zstyle ':completion:*:(ssh|scp|rsync):*:hosts-host' ignored-patterns '*(.|:)*' loopback ip6-loopback localhost ip6-localhost broadcasthost #zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*' # # Allow for autocomplete to be case insensitive #zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' \ # '+l:|?=** r:|?=**' # command line completion for ssh h=() if [[ -r ~/.ssh/config ]]; then h=($h ${${${(@M)${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*}) fi if [[ -r ~/.ssh/known_hosts ]]; then h=($h ${${${(f)"$(cat ~/.ssh/known_hosts{,2} || true)"}%%\ *}%%,*}) 2>/dev/null fi if [[ $#h -gt 0 ]]; then zstyle ':completion:*:(ssh|scp|slogin|sftp):*' hosts $h fi zstyle :compinstall filename '~/.zshrc' autoload -Uz compinit compinit # The following lines were added by compinstall #zstyle ':completion:*' completer _complete _ignored #zstyle :compinstall filename '~/.zshrc' # #autoload -Uz compinit #compinit # End of lines added by compinstall