2018-09-19 17:47:23 -05:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
#
|
|
|
|
# ~/.zshrc
|
|
|
|
#
|
|
|
|
|
|
|
|
# Source /etc/profile
|
2018-08-08 18:05:26 -05:00
|
|
|
if [[ -f "/etc/profile" ]]; then
|
|
|
|
source /etc/profile 2>& /dev/null
|
|
|
|
fi
|
|
|
|
|
2018-08-23 12:05:07 -05:00
|
|
|
# General options
|
2018-08-08 18:05:26 -05:00
|
|
|
DEFAULT_USER=salt
|
|
|
|
HISTFILE=~/.histfile
|
|
|
|
HISTSIZE=1000
|
|
|
|
SAVEHIST=1000
|
2018-08-23 12:05:07 -05:00
|
|
|
export LANG="en_US.UTF-8"
|
2018-08-23 12:01:56 -05:00
|
|
|
setopt appendhistory autocd extendedglob nomatch
|
2018-08-08 18:05:26 -05:00
|
|
|
unsetopt beep notify
|
2018-08-23 12:01:56 -05:00
|
|
|
bindkey -e
|
|
|
|
|
|
|
|
# Partial history matching
|
2018-08-24 18:08:20 -05:00
|
|
|
autoload -U history-search-end
|
|
|
|
zle -N history-beginning-search-backward-end history-search-end
|
|
|
|
zle -N history-beginning-search-forward-end history-search-end
|
|
|
|
bindkey '\e[A' history-beginning-search-backward-end
|
|
|
|
bindkey '\e[B' history-beginning-search-forward-end
|
2018-08-23 12:01:56 -05:00
|
|
|
|
|
|
|
# Set up styling
|
2018-08-08 18:05:26 -05:00
|
|
|
zstyle :compinstall filename '/home/salt/.zshrc'
|
2018-08-23 12:01:56 -05:00
|
|
|
|
|
|
|
# Completion
|
2018-08-08 18:05:26 -05:00
|
|
|
autoload -Uz compinit
|
|
|
|
compinit
|
2018-10-07 00:24:28 -05:00
|
|
|
compdef _git dot
|
2018-10-19 19:02:18 -05:00
|
|
|
compdef _ssh ssht
|
2018-08-08 18:05:26 -05:00
|
|
|
|
2018-08-23 12:01:56 -05:00
|
|
|
# The prompt
|
|
|
|
autoload -Uz promptinit
|
|
|
|
setopt prompt_percent
|
|
|
|
if [ "$SSH_CLIENT" = "" ]; then
|
|
|
|
PROMPT="[%F{blue}%~"
|
|
|
|
else
|
|
|
|
PROMPT="[%F{red}%B%m%b:%~"
|
|
|
|
fi
|
2018-08-23 12:05:07 -05:00
|
|
|
PROMPT="$PROMPT%f]%(0?..%F{red}%B?%b%f)%(!.%F{red}#%f.%F{green}$%f) "
|
2018-08-23 12:01:56 -05:00
|
|
|
promptinit
|
|
|
|
|
|
|
|
# Source .profile
|
2018-08-08 18:05:26 -05:00
|
|
|
if [[ -f "$HOME/.profile" ]]; then
|
|
|
|
source "$HOME/.profile" 2>& /dev/null
|
|
|
|
fi
|