feat(zinit): integrate zinit for improved shell configuration #1

Merged
vokhactri merged 17 commits from feat/zinit into main 2025-04-18 20:50:42 +07:00
2 changed files with 36 additions and 45 deletions
Showing only changes of commit 885a795aa5 - Show all commits

No files matched your search

+30 -45
View File
@@ -1,49 +1,34 @@
ZAP_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/zap" # install zinit
ZAP_SCRIPT="$ZAP_DIR/zap.zsh" source $ZDOTDIR/zinit.zsh
ZAP_BRANCH=release-v1
if [ ! -f $ZAP_SCRIPT ]; then # load remote plugins
git clone -b "$ZAP_BRANCH" https://github.com/zap-zsh/zap.git "$ZAP_DIR" zinit wait lucid light-mode for \
fi wintermi/zsh-brew \
zap-zsh/supercharge \
wintermi/zsh-fnm \
hlissner/zsh-autopair \
atinit"zicompinit; zicdreplay -q" \
zdharma-continuum/fast-syntax-highlighting \
atload"_zsh_autosuggest_start" \
zsh-users/zsh-autosuggestions \
blockf atpull'zinit creinstall -q .' \
zsh-users/zsh-completions
source "$ZAP_SCRIPT" # load local snippets
zinit snippet $ZDOTDIR/exports.zsh
zinit snippet $ZDOTDIR/aliases.zsh
remote_plugins=( # load prompt theme
zap-zsh/supercharge zinit ice as"command" from"gh-r" \
zap-zsh/fzf atclone"./starship init zsh > init.zsh; ./starship completions zsh > _starship" \
wintermi/zsh-lsd atpull"%atclone" src"init.zsh"
wintermi/zsh-fnm zinit light starship/starship
zsh-users/zsh-autosuggestions
zsh-users/zsh-completions
zdharma-continuum/fast-syntax-highlighting
hlissner/zsh-autopair
)
plugins=("${remote_plugins[@]}" "$ZDOTDIR/*")
mac_plugins=(wintermi/zsh-brew)
case "$(uname -s)" in # load binaries
Darwin) zinit as"command" wait lucid light-mode from"gh-r" for \
# echo 'Mac OS X' pick"bat-*/bat" atclone'cd $(ls -d */|head -n 1); cp autocomplete/bat.zsh _bat' atpull"%atclone" @sharkdp/bat \
plugins=("${mac_plugins[@]}" "${plugins[@]}") pick"lsd-*/lsd" lsd-rs/lsd \
;; atclone"./zoxide init zsh > init.zsh" atpull"%atclone" src"init.zsh" \
Linux) ajeetdsouza/zoxide \
# echo 'Linux' atclone"./fzf --zsh > init.zsh" atpull="%atclone" src"init.zsh" \
;; junegunn/fzf
CYGWIN* | MINGW32* | MSYS* | MINGW*)
# echo 'MS Windows'
;;
*)
# echo 'Other OS'
;;
esac
for plugin in $plugins; do plug $plugin; done
# Clean startup prompt
[ ! -f ~/.hushlogin ] && touch ~/.hushlogin
unsetopt PROMPT_SP
# Load and initialise completion system
autoload -Uz compinit
compinit
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env zsh
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
[ ! -d $ZINIT_HOME ] && mkdir -p "$(dirname $ZINIT_HOME)"
[ ! -d $ZINIT_HOME/.git ] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
source "${ZINIT_HOME}/zinit.zsh"