Swap from zinit to Zim: much simpler and just as fast

This commit is contained in:
Danielle McLean 2023-11-20 13:41:08 +11:00
parent ddb6433bb9
commit fcb897de80
Signed by: 00dani
GPG key ID: 52C059C3B22A753E
3 changed files with 47 additions and 36 deletions

View file

@ -1,10 +0,0 @@
#! zsh
typeset -A ZINIT
ZINIT[HOME_DIR]=${XDG_CACHE_HOME:-~/.cache}/zinit
ZINIT[BIN_DIR]=${ZINIT[HOME_DIR]}/zinit.git
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

View file

@ -1,30 +1,22 @@
#! zsh
: ${ZIM_HOME:=$XDG_CACHE_HOME/zim}
: ${ZIM_CONFIG_FILE:=$XDG_CONFIG_HOME/zsh/zimrc.zsh}
zstyle :zim:completion dumpfile ${XDG_CACHE_HOME:-~/.cache}/zsh/zcompdump.zsh
[[ ! -d $ZINIT[HOME_DIR] ]] && mkdir -p $ZINIT[HOME_DIR]
if [[ ! -d $ZINIT[BIN_DIR]/.git ]]; then
git clone https://github.com/zdharma-continuum/zinit.git $ZINIT[BIN_DIR]
zcompile $ZINIT[BIN_DIR]/zinit.zsh
# Sure, I typically run MacOS, which uses a case-insensitive filesystem, but
# that doesn't mean I have to like it. ;)
zstyle ':zim:*' case-sensitivity sensitive
zstyle :zim:termtitle hooks preexec precmd
zstyle :zim:termtitle:preexec format '${${(A)=1}[1]}'
zstyle :zim:termtitle:precmd format '%1~'
if [[ ! -e $ZIM_HOME/zimfw.zsh ]]; then
curl -fsSL --create-dirs -o $ZIM_HOME/zimfw.zsh https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh
zcompile $ZIM_HOME/zimfw.zsh
fi
if [[ ! $ZIM_HOME/init.zsh -nt $ZIM_CONFIG_FILE ]]; then
source $ZIM_HOME/zimfw.zsh init -q
fi
source $ZINIT[BIN_DIR]/zinit.zsh
load=light
zinit $load willghatch/zsh-saneopt
zinit $load mafredri/zsh-async
zinit ice depth'1'
zinit $load romkatv/powerlevel10k
vivid_theme=molokai
(( $+commands[vivid] )) && zinit ice atclone'./build.sh' atpull'%atclone' run-atpull
zinit $load ryanccn/vivid-zsh
zinit wait lucid light-mode for \
hlissner/zsh-autopair \
mollifier/cd-gitroot \
atinit"dot-zsh-compinit" \
zdharma-continuum/fast-syntax-highlighting \
atload"_zsh_autosuggest_start" \
zsh-users/zsh-autosuggestions \
blockf atpull'zinit creinstall -q .' \
zsh-users/zsh-completions
source $ZIM_HOME/init.zsh

29
dot-config/zsh/zimrc.zsh Normal file
View file

@ -0,0 +1,29 @@
zmodule willghatch/zsh-saneopt --source saneopt.plugin.zsh
zmodule environment
zmodule mafredri/zsh-async --source async.zsh
zmodule input
zmodule run-help
zmodule magic-enter
zmodule termtitle
zmodule utility
zmodule romkatv/powerlevel10k --use degit
zmodule ryanccn/vivid-zsh --cmd 'vivid_theme=molokai source {}/vivid-zsh.plugin.zsh' --on-pull '(( ${+commands[vivid]} )) && ./build.sh'
zmodule hlissner/zsh-autopair
zmodule mollifier/cd-gitroot --fpath . --autoload cd-gitroot
zmodule kiesman99/zim-zoxide
zmodule zsh-users/zsh-autosuggestions
(( ${+commands[brew]} )) && zmodule homebrew
# Additional completion definitions for Zsh.
zmodule zsh-users/zsh-completions --fpath src
# Enables and configures smart and extensive tab completion.
# completion *must* be sourced after all modules that add completion definitions.
zmodule completion
# Fish-style syntax highlighting as you type, making the Zsh experience much more friendly!
zmodule zdharma-continuum/fast-syntax-highlighting