You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.2 KiB
Bash

# start up the autocompletions engine
autoload -Uz compinit && compinit
autoload -U colors && colors
autoload -Uz vcs_info
export EDITOR=nvim
# adds the cargo environment, which also adds rust binaries. We want to do this
# early in case anything else depends on a rust binary, such as direnv
if [[ -f "$HOME/.cargo/env" ]]; then
. "$HOME/.cargo/env"
fi
# configure git info in shell prompt
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
setopt prompt_subst
# vcs prompt info should be just the branch name
zstyle ':vcs_info:git:*' formats '%b'
# prompt configs
# RPROMPT='${vcs_info_msg_0_}'
PROMPT='%F{#99ad6a}%~ %(1j.%F{#adadad}[%j]%f .)%F{#99ad6a}▷%f '
# history stuff
export HISTFILE=~/.zsh_history
export HISTSIZE=5000000
export SAVEHIST=$HISTSIZE
setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format.
setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history.
setopt HIST_FIND_NO_DUPS # Do not display a previously found event.
setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again.
setopt HIST_IGNORE_SPACE # Do not record an event starting with a space.
setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file.
setopt SHARE_HISTORY # Share history between all sessions.
# misc ls configuration
LS_COLORS='rs=0:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:';
export LS_COLORS
alias ls="ls --color=auto"
alias tree="tree --gitignore"
# if kitty is installed, register its completions
if (( $+commands[kitty] )); then
source <(kitty + complete setup zsh)
fi
if (( $+commands[direnv] )); then
eval "$(direnv hook zsh)"
fi
# run local machine-specific settings
if [ -f "$HOME/.zlocalrc" ]; then
source "$HOME/.zlocalrc"
fi
# sometimes I put executables into ~/bin
if [ -d "$HOME/bin" ]; then
export PATH="$PATH:$HOME/bin"
fi
# add the Go bindir to the path if we have the standard Go install dir
if [ -d /usr/local/go ]; then
export PATH=$PATH:$HOME/go/bin:/usr/local/go/bin
fi
# allow comments on the command line
setopt interactivecomments