diff options
author | Ensa <psychoticfervor@tuta.io> | 2019-12-20 00:14:09 -0800 |
---|---|---|
committer | Ensa <psychoticfervor@tuta.io> | 2019-12-20 00:14:09 -0800 |
commit | 4684d80b6271dd775cd23dabf2b91d6ce56fa33a (patch) | |
tree | ddb6c6219e213132b8500e016b1ce238aa71029d /config/zsh/zshrc | |
parent | f733ca7c8041866df27752c8e0c2610e0ecef6a7 (diff) | |
download | cfg-4684d80b6271dd775cd23dabf2b91d6ce56fa33a.tar.gz |
first significant commit
see README.md for information
Diffstat (limited to 'config/zsh/zshrc')
-rw-r--r-- | config/zsh/zshrc | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/config/zsh/zshrc b/config/zsh/zshrc new file mode 100644 index 0000000..559b1ca --- /dev/null +++ b/config/zsh/zshrc @@ -0,0 +1,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" |