106 lines
2.6 KiB
Text
106 lines
2.6 KiB
Text
if [ -n "${ZSH_DEBUG_STARTUP+1}" ]; then
|
|
zmodload zsh/zprof
|
|
fi
|
|
|
|
HISTFILE=~/.histfile
|
|
HISTSIZE=10000
|
|
SAVEHIST=10000
|
|
setopt INC_APPEND_HISTORY
|
|
|
|
export EDITOR=nvim
|
|
export MANPAGER='nvim +Man!'
|
|
|
|
PROMPT="
|
|
[%n@%m %~]%(?..%F{red})>%f "
|
|
|
|
zstyle :compinstall filename '/home/wekuz/.zshrc'
|
|
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
|
|
zstyle ':completion:*' menu select
|
|
autoload -Uz compinit
|
|
compinit
|
|
autoload -Uz bashcompinit
|
|
bashcompinit
|
|
|
|
export PATH="$PATH:/home/wekuz/.local/bin"
|
|
export PATH="$PATH:$HOME/.cargo/bin"
|
|
|
|
QMK_LOCATION="/home/wekuz/qmk"
|
|
|
|
ZSH_CONFIG_FILES=(
|
|
fixkeys
|
|
options
|
|
aliases
|
|
completions
|
|
autostart
|
|
)
|
|
|
|
for filename in "${ZSH_CONFIG_FILES[@]}"; do
|
|
[ -r "$XDG_CONFIG_HOME/zsh/config/$filename.zsh" ] && source "$XDG_CONFIG_HOME/zsh/config/$filename.zsh"
|
|
done
|
|
|
|
function plugin-compile {
|
|
ZPLUGINDIR=${ZPLUGINDIR:-$HOME/.config/zsh/plugins}
|
|
autoload -U zrecompile
|
|
local f
|
|
for f in $ZPLUGINDIR/**/*.zsh{,-theme}(N); do
|
|
zrecompile -pq "$f"
|
|
done
|
|
}
|
|
|
|
function plugin-clone {
|
|
local repo plugdir initfile initfiles=()
|
|
ZPLUGINDIR=${ZPLUGINDIR:-${ZDOTDIR:-$HOME/.config/zsh}/plugins}
|
|
for repo in $@; do
|
|
plugdir=$ZPLUGINDIR/${repo:t}
|
|
initfile=$plugdir/${repo:t}.plugin.zsh
|
|
if [[ ! -d $plugdir ]]; then
|
|
echo "Cloning $repo..."
|
|
git clone -q --depth 1 --recursive --shallow-submodules \
|
|
https://github.com/$repo $plugdir
|
|
fi
|
|
if [[ ! -e $initfile ]]; then
|
|
initfiles=($plugdir/*.{plugin.zsh,zsh-theme,zsh,sh}(N))
|
|
(( $#initfiles )) && ln -sf $initfiles[1] $initfile
|
|
fi
|
|
done
|
|
plugin-compile
|
|
}
|
|
|
|
function plugin-source {
|
|
local plugdir
|
|
ZPLUGINDIR=${ZPLUGINDIR:-${ZDOTDIR:-$HOME/.config/zsh}/plugins}
|
|
for plugdir in $@; do
|
|
[[ $plugdir = /* ]] || plugdir=$ZPLUGINDIR/$plugdir
|
|
fpath+=$plugdir
|
|
local initfile=$plugdir/${plugdir:t}.plugin.zsh
|
|
(( $+functions[zsh-defer] )) && zsh-defer . $initfile || . $initfile
|
|
done
|
|
}
|
|
|
|
function plugin-update {
|
|
ZPLUGINDIR=${ZPLUGINDIR:-$HOME/.config/zsh/plugins}
|
|
for d in $ZPLUGINDIR/*/.git(/); do
|
|
echo "Updating ${d:h:t}..."
|
|
command git -C "${d:h}" pull --ff --recurse-submodules --depth 1 --rebase --autostash
|
|
done
|
|
plugin-compile
|
|
echo "Plugins updated"
|
|
}
|
|
|
|
ZSH_PLUGIN_REPOS=(
|
|
hlissner/zsh-autopair
|
|
zsh-users/zsh-syntax-highlighting
|
|
zsh-users/zsh-autosuggestions
|
|
)
|
|
ZSH_PLUGINS=(
|
|
zsh-autopair
|
|
zsh-syntax-highlighting
|
|
zsh-autosuggestions
|
|
)
|
|
|
|
# plugin-clone $ZSH_PLUGIN_REPOS
|
|
plugin-source $ZSH_PLUGINS
|
|
|
|
if [ -n "${ZSH_DEBUG_STARTUP+1}" ]; then
|
|
zprof
|
|
fi
|