ansible-collection-dotfiles/roles/zsh/files/zshrc

65 lines
1.8 KiB
Bash

autoload colors && colors
export ZSH_CACHE_DIR=~/.cache/zsh
export ZSH_CONFIG_DIR=~/.config/zsh
fpath=($ZSH_CACHE_DIR/completions/ $fpath)
autoload -Uz compinit && compinit -d $ZSH_CACHE_DIR/zcompdump-$ZSH_VERSION
typeset -U path
# Prepend directories: last one will be the first.
for dir in \
/opt/aseprite \
/opt/kotlinc/bin \
$JAVA_HOME/bin \
~/.nix-profile/bin/ \
~/.juliaup/bin/ \
~/.go/bin \
~/.bun/bin \
~/.cargo/bin \
~/.local/bin \
~/.bin \
; do
if [[ -d $dir ]]; then path[1,0]=$dir; fi
done
# History stuff
HISTFILE=~/.zsh_history
HISTSIZE=10000000
SAVEHIST=10000000
HISTORY_IGNORE="(cd|exit|ls|pwd)*"
setopt APPEND_HISTORY
setopt EXTENDED_HISTORY
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_NO_STORE
setopt HIST_REDUCE_BLANKS
setopt HIST_SAVE_NO_DUPS
setopt HIST_VERIFY
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
source ~/.local/lib/antidote/antidote.zsh
bundlefile=~/.config/zsh/plugins.txt
zstyle ':antidote:bundle' file $bundlefile
staticfile=~/.config/zsh/plugins.zsh
zstyle ':antidote:static' file $staticfile
antidote load
[[ -f $ZSH_CONFIG_DIR/variables.zsh ]] && source $ZSH_CONFIG_DIR/variables.zsh
[[ -f $ZSH_CONFIG_DIR/aliases.zsh ]] && source $ZSH_CONFIG_DIR/aliases.zsh
[[ -f $ZSH_CONFIG_DIR/functions.zsh ]] && source $ZSH_CONFIG_DIR/functions.zsh
# [[ -f $ZSH_CONFIG_DIR/zshrc.local ]] && source $ZSH_CONFIG/zshrc.local
# fzf
[[ -f /usr/share/doc/fzf/examples/completion.zsh ]] && source /usr/share/doc/fzf/examples/completion.zsh
[[ -f /usr/share/doc/fzf/examples/key-bindings.zsh ]] && source /usr/share/doc/fzf/examples/key-bindings.zsh
# virtualenvwrapper
[[ -f /usr/share/virtualenvwrapper/virtualenvwrapper.sh ]] && source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
eval "$(starship init zsh)"
eval "$(direnv hook zsh)"
eval $(ssh-agent) > /dev/null