51 lines
1.7 KiB
Text
51 lines
1.7 KiB
Text
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.config/zsh/.zshrc.
|
|
# Initialization code that may require console input (password prompts, [y/n]
|
|
# confirmations, etc.) must go above this block; everything else may go below.
|
|
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
|
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
|
fi
|
|
|
|
#!/usr/bin/env zsh
|
|
|
|
# Load zprof first if we need to profile.
|
|
[[ ${ZPROFRC:-0} -eq 0 ]] || zmodload zsh/zprof
|
|
alias zprofrc="ZPROFRC=1 zsh"
|
|
|
|
setopt extended_glob
|
|
|
|
# Autoload functions directory and its subdirs.
|
|
for funcdir in $ZDOTDIR/functions $ZDOTDIR/functions/*(N/); do
|
|
fpath=($funcdir $fpath)
|
|
autoload -Uz $fpath[1]/*(.:t)
|
|
done
|
|
unset funcdir
|
|
|
|
# Be sure to set any supplemental completions directories before compinit is run.
|
|
fpath=(${ZDOTDIR}/completions(-/FN) $fpath)
|
|
|
|
[[ -d ${ZDOTDIR:-~}/.antidote ]] ||
|
|
git clone https://github.com/mattmc3/antidote ${ZDOTDIR:-~}/.antidote
|
|
|
|
# Set the name of the static .zsh plugins file antidote will generate.
|
|
zsh_plugins=${ZDOTDIR:-~}/.zplugins.zsh
|
|
|
|
# Ensure you have a .zplugins file where you can add plugins.
|
|
[[ -f ${zsh_plugins:r} ]] || touch ${zsh_plugins:r}
|
|
|
|
# Lazy-load antidote.
|
|
fpath+=(${ZDOTDIR:-~}/.antidote/functions)
|
|
autoload -Uz $fpath[-1]/antidote
|
|
|
|
# Generate static file in a subshell when .zplugins is updated.
|
|
if [[ ! $zsh_plugins -nt ${zsh_plugins:r} ]]; then
|
|
(antidote bundle <${zsh_plugins:r} >|$zsh_plugins)
|
|
fi
|
|
|
|
# Source your static plugins file.
|
|
source $zsh_plugins
|
|
|
|
if zmodload zsh/terminfo && (( terminfo[colors] >= 256 )); then
|
|
[[ ! -f $ZDOTDIR/.p10k.zsh ]] || source $ZDOTDIR/.p10k.zsh
|
|
else
|
|
[[ ! -f $ZDOTDIR/.p10k-ascii.zsh ]] || source $ZDOTDIR/.p10k-ascii.zsh
|
|
fi
|