Compare commits

...

9 commits

5 changed files with 1757 additions and 38 deletions

View file

@ -1,6 +1,10 @@
#! zsh #! zsh
ZINIT_HOME=${XDG_CACHE_HOME:-~/.cache}/zsh/zinit typeset -A ZINIT
if [[ -e $ZINIT_HOME/bin/zmodules/Src/zdharma/zplugin.so ]]; then ZINIT[HOME_DIR]=${XDG_CACHE_HOME:-~/.cache}/zinit
module_path+=( $ZINIT_HOME/bin/zmodules/Src ) ZINIT[BIN_DIR]=${ZINIT[HOME_DIR]}/zinit.git
zmodload zdharma/zplugin ZINIT[ZCOMPDUMP_PATH]=${XDG_CACHE_HOME:-~/.cache}/zsh/zcompdump.zsh
if [[ -e ${ZINIT[HOME_DIR]}/module/Src/zdharma_continuum/zinit.so ]]; then
module_path+=( ${ZINIT[HOME_DIR]}/module/Src )
zmodload zdharma_continuum/zinit
fi fi

View file

@ -1,6 +0,0 @@
#! zsh
(( $+commands[fortune] )) || return
for say in ponysay cowsay cat; (( $+commands[$say] )) && break
[[ $say = cowsay ]] && say=(cowsay -n)
[[ $say = ponysay ]] && say=(ponysay -W $(( COLUMNS - 1 )) -b unicode)
fortune $XDG_CACHE_HOME/sav-quotes/quotes | $say

1712
dot-config/zsh/p10k.zsh Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,13 +1,11 @@
#! zsh #! zsh
typeset -A ZINIT
ZINIT[HOME_DIR]=$ZINIT_HOME
ZINIT[ZCOMPDUMP_PATH]=$XDG_CACHE_HOME/zsh/zcompdump
if [[ ! -f $ZINIT_HOME/bin/zinit.zsh ]]; then [[ ! -d $ZINIT[HOME_DIR] ]] && mkdir -p $ZINIT[HOME_DIR]
git clone https://github.com/zdharma-continuum/zinit $ZINIT_HOME/bin if [[ ! -d $ZINIT[BIN_DIR]/.git ]]; then
zcompile $ZINIT_HOME/bin/zinit.zsh git clone https://github.com/zdharma-continuum/zinit.git $ZINIT[BIN_DIR]
zcompile $ZINIT[BIN_DIR]/zinit.zsh
fi fi
source $ZINIT_HOME/bin/zinit.zsh source $ZINIT[BIN_DIR]/zinit.zsh
load=light load=light
zinit $load willghatch/zsh-saneopt zinit $load willghatch/zsh-saneopt
@ -15,14 +13,8 @@ zinit $load willghatch/zsh-saneopt
zinit $load mafredri/zsh-async zinit $load mafredri/zsh-async
zinit $load rupa/z zinit $load rupa/z
if (( $+commands[starship] )); then zinit ice depth'1'
source <(starship init zsh --print-full-init) zinit $load romkatv/powerlevel10k
autoload starship_pure_title_precmd starship_pure_title_preexec
precmd_functions+=(starship_pure_title_precmd)
preexec_functions+=(starship_pure_title_preexec)
else
zinit $load sindresorhus/pure
fi
if (( $+commands[vivid] )); then if (( $+commands[vivid] )); then
export LS_COLORS=$(vivid generate molokai) export LS_COLORS=$(vivid generate molokai)
@ -30,13 +22,11 @@ else
zinit pack:no-dir-color-swap for ls_colors zinit pack:no-dir-color-swap for ls_colors
fi fi
zinit ice silent wait:1 atload:_zsh_autosuggest_start zinit wait lucid light-mode for \
zinit $load zsh-users/zsh-autosuggestions mollifier/cd-gitroot \
atinit"dot-zsh-compinit" \
zinit ice blockf; zinit $load zsh-users/zsh-completions zdharma-continuum/fast-syntax-highlighting \
atload"_zsh_autosuggest_start" \
zinit ice silent wait:1; zinit $load mollifier/cd-gitroot zsh-users/zsh-autosuggestions \
zinit ice silent wait:1; zinit $load micha/resty blockf atpull'zinit creinstall -q .' \
zinit ice silent wait:1; zinit $load supercrabtree/k zsh-users/zsh-completions
zinit ice silent wait!1; zinit $load zdharma-continuum/fast-syntax-highlighting

View file

@ -1,11 +1,30 @@
# Enable Powerlevel10k instant prompt. Should stay close to the top of 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
# Optimised compinit taking advantage of zinit's completion handling, as well
# as compiling the resulting zcompdump file. Have zinit call this once
# everything is loaded using an atload ice.
dot-zsh-compinit() {
[[ -d $ZINIT[ZCOMPDUMP_PATH] ]] || mkdir -p ${ZINIT[ZCOMPDUMP_PATH]:h}
zicompinit || return $?
zicdreplay || return $?
([[ $ZINIT[ZCOMPDUMP_PATH].zwc -nt $ZINIT[ZCOMPDUMP_PATH] ]] || zcompile $ZINIT[ZCOMPDUMP_PATH]) &!
return 0
}
source $ZDOTDIR/zinit source $ZDOTDIR/zinit
for f in $ZDOTDIR/interactive/^*.zwc(N); source $f for f in $ZDOTDIR/interactive/^*.zwc(N); source $f
zpcompinit && zpcdreplay
([[ $ZINIT[ZCOMPDUMP_PATH].zwc -nt $ZINIT[ZCOMPDUMP_PATH] ]] || zcompile $ZINIT[ZCOMPDUMP_PATH]) &!
[[ -o login ]] && for f in $ZDOTDIR/interactive+login/^*.zwc(N); source $f [[ -o login ]] && for f in $ZDOTDIR/interactive+login/^*.zwc(N); source $f
export POWERLEVEL9K_CONFIG_FILE=${ZDOTDIR}/p10k.zsh
# To customize prompt, run `p10k configure` or edit ~/.config/zsh/p10k.zsh
[[ ! -f $POWERLEVEL9K_CONFIG_FILE ]] || source $POWERLEVEL9K_CONFIG_FILE
# If zsh init ends with a failing command (like a conditional) the prompt will # If zsh init ends with a failing command (like a conditional) the prompt will
# show the "error" colour on first launch. To avoid this, we simply end with a # show the "error" colour on first launch. To avoid this, we simply end with a
# true command: # true command: