about summary refs log tree commit diff stats
path: root/config/zsh/zshrc
blob: 559b1ca6adb40c0969d15f14b4e359bb2ae4ae3c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
export XDG_CACHE_HOME=${XDG_CACHE_HOME:=~/.cache}
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:=~/.config}
export XDG_DATA_HOME=${XDG_DATA_HOME:=~/.local/share}
if printf "$PATH"|grep -q ".local/bin"; then
	export PATH="$PATH:$HOME/.local/bin"
fi

HISTFILE=$XDG_DATA_HOME/zsh/histfile
HISTSIZE=5000
SAVEHIST=5000

typeset -A ZPLGM
ZPLG_HOME=$XDG_CACHE_HOME/zsh/zplugin
ZPLGM[HOME_DIR]=$ZPLG_HOME
ZPLGM[ZCOMPDUMP_PATH]=$XDG_CACHE_HOME/zsh/zcompdump
ZPLGM[COMPLETIONS_DIR]=$XDG_DATA_HOME/zsh/completions
if [[ ! -f $ZPLG_HOME/bin/zplugin.zsh ]]; then
	git clone https://github.com/zdharma/zplugin $ZPLG_HOME/bin
	zcompile $ZPLG_HOME/bin/zplugin.zsh
fi
autoload -Uz _zplugin
(( ${+_comps} )) && _comps[zplugin]=_zplugin
source $ZPLG_HOME/bin/zplugin.zsh
load=light

#load zsh external configs
for file in $ZDOTDIR/*.zsh; do
	source "$file"
done
#make fpath not contain all the completions I don't use (enable completions using "zplugin creinstall [PATH_TO_COMPLETIONS_FOLDER]")
if [[ -d /usr/local/share/zsh ]]; then
fpath=($XDG_DATA_HOME/zsh/completions /usr/local/share/zsh/site-functions /usr/local/share/zsh/$ZSH_VERSION/functions/Calendar /usr/local/share/zsh/$ZSH_VERSION/functions/Chpwd /usr/local/share/zsh/$ZSH_VERSION/functions/Completion /usr/local/share/zsh/$ZSH_VERSION/functions/Exceptions /usr/local/share/zsh/$ZSH_VERSION/functions/MIME /usr/local/share/zsh/$ZSH_VERSION/functions/Exceptions /usr/local/share/zsh/$ZSH_VERSION/functions/Math /usr/local/share/zsh/$ZSH_VERSION/functions/Exceptions /usr/local/share/zsh/$ZSH_VERSION/functions/Misc /usr/local/share/zsh/$ZSH_VERSION/functions/TCP /usr/local/share/zsh/$ZSH_VERSION/functions/VCS_Info /usr/local/share/zsh/$ZSH_VERSION/functions/VCS_Info/Backends /usr/local/share/zsh/$ZSH_VERSION/functions/Zftp /usr/local/share/zsh/$ZSH_VERSION/functions/Zle)
else
fpath=($XDG_DATA_HOME/zsh/completions /usr/share/zsh/site-functions /usr/share/zsh/$ZSH_VERSION/functions/Calendar /usr/share/zsh/$ZSH_VERSION/functions/Chpwd /usr/share/zsh/$ZSH_VERSION/functions/Completion /usr/share/zsh/$ZSH_VERSION/functions/Exceptions /usr/share/zsh/$ZSH_VERSION/functions/MIME /usr/share/zsh/$ZSH_VERSION/functions/Exceptions /usr/share/zsh/$ZSH_VERSION/functions/Math /usr/share/zsh/$ZSH_VERSION/functions/Exceptions /usr/share/zsh/$ZSH_VERSION/functions/Misc /usr/share/zsh/$ZSH_VERSION/functions/TCP /usr/share/zsh/$ZSH_VERSION/functions/VCS_Info /usr/share/zsh/$ZSH_VERSION/functions/VCS_Info/Backends /usr/share/zsh/$ZSH_VERSION/functions/Zftp /usr/share/zsh/$ZSH_VERSION/functions/Zle)
fi
# load shortcutrc and aliasrc to grab cross-shell niceties
[ -f "$XDG_CONFIG_HOME/shortcutrc" ] && source "$XDG_CONFIG_HOME/shortcutrc"
[ -f "$XDG_CONFIG_HOME/aliasrc" ] && source "$XDG_CONFIG_HOME/aliasrc"
# plugin loading goes here:
# theme
zplugin ice silent depth=1
zplugin $load romkatv/powerlevel10k
# Ctrl-R functionality
zplugin $load zdharma/history-search-multi-word
# completions
zplugin ice blockf
zplugin $load zsh-users/zsh-completions
# good, fast syntax highlighting
zplugin ice silent wait!1 atload"ZPLGM[COMPINIT_OPTS]=-C; zpcompinit"
zplugin $load zdharma/fast-syntax-highlighting

# theme config loading
[ -f "$ZDOTDIR/themes/p10k.zsh" ] && source "$ZDOTDIR/themes/p10k.zsh"