# ZSH configuration
# 31 August 2020: Created.

# Important stuff first.
setopt no_beep                  # Don't beep at me.

# Set up the $path.
typeset -U path                 # Ignore duplicated values in $path.
path=(~/bin $path)              # Check my ~/bin directory first.

# Set other environment variables.
export EDITOR=/usr/pkg/bin/mg
export LANG=en_US.UTF-8
export TZ=US/Central

# Configure history.
HISTSIZE=500                    # Load 500 lines from the history file.
SAVEHIST=500                    # Save 500 lines to the history file.
HISTFILE=~/.history             # Speaking of the history file...
setopt hist_verify              # Show history substitutions before executing.
setopt share_history            # Add and import history lines incrementally.
setopt hist_ignore_all_dups     # Remove old duplicate commands.
setopt hist_ignore_space        # Don't save lines beginning with a space.

# Aliases
alias ls='ls -F'                # Append suffixes to different file types.

# Make the prompt more useful. This puts the host name on the left and the
# current path on the right. If the previous command exited with a non-zero
# status, put that on the left side as well.
#
# (1)[host]% _                                                      ~/tmp
#
autoload -U colors && colors
PS1="%{${fg[red]}%}%(?..(%?%))%{${fg[green]}%}[%m]%{${fg[cyan]}%}%#%{%f%} "
RPS1="%{${fg[yellow]}%}%~%{%f%}"

# Enable completions.
autoload -Uz compinit && compinit