61 lines
1.6 KiB
Bash
61 lines
1.6 KiB
Bash
# autoload and kickoff
|
|
autoload -Uz colors vcs_info compinit
|
|
compinit
|
|
colors
|
|
|
|
# Make sure moving by whole word can stop at directories
|
|
WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'
|
|
ZSH_CACHE_DIR="$HOME/.cache/zsh"
|
|
|
|
# history support, time reporting, auto-cd
|
|
HISTFILE=~/.zhistory
|
|
HISTSIZE=5000
|
|
SAVEHIST=5000
|
|
setopt INC_APPEND_HISTORY
|
|
setopt EXTENDED_HISTORY
|
|
setopt HIST_IGNORE_ALL_DUPS
|
|
setopt HIST_IGNORE_SPACE
|
|
setopt AUTO_CD
|
|
setopt PROMPT_SUBST
|
|
|
|
SCRIPTPATH=$HOME/.config/dotfiles/zsh
|
|
|
|
# google cloud sdk
|
|
if [[ -a "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc" ]]; then
|
|
source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc"
|
|
fi
|
|
|
|
# history substring search
|
|
if [[ -a "$SCRIPTPATH/zsh-history-substring-search/zsh-history-substring-search.zsh" ]]; then
|
|
source "$SCRIPTPATH/zsh-history-substring-search/zsh-history-substring-search.zsh"
|
|
bindkey '^[[A' history-substring-search-up
|
|
bindkey '^[[B' history-substring-search-down
|
|
fi
|
|
|
|
# extra autocompletions
|
|
if [[ -a "$SCRIPTPATH/zsh-completions/zsh-completions.plugin.zsh" ]]; then
|
|
fpath=($SCRIPTPATH/zsh-completions/src $fpath)
|
|
fi
|
|
|
|
# starship
|
|
if [[ -x "$(command -v starship)" ]]; then
|
|
export STARSHIP_CONFIG="$HOME/.config/starship/starship.toml"
|
|
eval "$(starship init zsh)"
|
|
fi
|
|
|
|
# asdf
|
|
if [[ -d "$HOME/.asdf/completions" ]]; then
|
|
fpath=($HOME/.asdf/completions $fpath)
|
|
fi
|
|
|
|
# plugins
|
|
mkdir -p "$ZSH_CACHE_DIR"
|
|
source "$SCRIPTPATH/dotenv.zsh"
|
|
|
|
# What OS are we running?
|
|
if [[ $(uname) == "Darwin" ]]; then
|
|
source $SCRIPTPATH/mac-tty.zsh
|
|
fi
|
|
|
|
# See zprofile for all other exports and path configuration
|