replace zinit with znap (zsh-snap)

This commit is contained in:
Lockszmith (VAST@MacBook) 2025-06-05 11:05:31 -04:00
parent 5abb77dd80
commit cf04e67425
7 changed files with 57 additions and 11 deletions

View file

@ -0,0 +1,10 @@
#!/usr/bin/env -S zsh -c 'echo "Not a user script. source(aka .) only"'
ZNAP_REPO="${XDG_DATA_HOME:-${HOME}/.local/share}/znap/_"
# Download Znap, if it's not there yet.
[[ -r "${ZNAP_REPO}/znap.zsh" ]] ||
git clone --depth 1 -- \
https://github.com/marlonrichert/zsh-snap.git "${ZNAP_REPO}"
source "${ZNAP_REPO}/znap.zsh" # Start Znap

View file

@ -1,7 +1,31 @@
#!/usr/bin/env -S zsh -c 'echo "Not a user script. source(aka .) only"'
zinit light 'marlonrichert/zsh-autocomplete'
zinit light 'zsh-users/zsh-autosuggestions'
if [ -n "$ZI_HOME" ]; then
zinit light 'marlonrichert/zsh-autocomplete'
zinit light 'zsh-users/zsh-autosuggestions'
else
znap source 'marlonrichert/zsh-autocomplete'
znap source 'zsh-users/zsh-autosuggestions'
# Make Tab and ShiftTab cycle completions on the command line
# bindkey '^I' menu-complete
# bindkey "$terminfo[kcbt]" reverse-menu-complete
# Make Tab and ShiftTab go to the menu
bindkey '^I' menu-select
bindkey "$terminfo[kcbt]" menu-select
# Make Tab and ShiftTab change the selection in the menu
bindkey -M menuselect '^I' menu-complete
bindkey -M menuselect "$terminfo[kcbt]" reverse-menu-complete
# Make ← and → always move the cursor on the command line
# bindkey -M menuselect '^[[D' .backward-char '^[OD' .backward-char
# bindkey -M menuselect '^[[C' .forward-char '^[OC' .forward-char
# `znap install` adds new commands and completions.
znap install aureliojargas/clitest zsh-users/zsh-completions
fi
# vim: set ft=sh expandtab tabstop=4 shiftwidth=4:

View file

@ -1,7 +1,11 @@
#!/usr/bin/env -S zsh -c 'echo "Not a user script. source(aka .) only"'
zinit ice depth=1
zinit light jeffreytse/zsh-vi-mode
if [ -n "$ZI_HOME" ]; then
zinit ice depth=1
zinit light jeffreytse/zsh-vi-mode
else
znap source jeffreytse/zsh-vi-mode
fi
[[ -n "${DBG}" ]] && echo "jeffreytse/zsh-vi-mode loaded"

View file

@ -1,10 +1,12 @@
#!/usr/bin/env -S zsh -c 'echo "Not a user script. source(aka .) only"'
autoload -Uz _zi
(( ${+_comps} )) && _comps[zi]=_zi
if [ -n "$ZI_HOME" ]; then
autoload -Uz _zi
(( ${+_comps} )) && _comps[zi]=_zi
autoload -Uz +X compinit bashcompinit && compinit && bashcompinit
[[ -n "${DBG}" ]] && echo "zinit/zi loaded available"
autoload -Uz +X compinit bashcompinit && compinit && bashcompinit
[[ -n "${DBG}" ]] && echo "zinit/zi loaded available"
fi
# vim: set ft=sh expandtab tabstop=4 shiftwidth=4:

View file

@ -2,8 +2,12 @@
if is_cmd atuin; then
# . <( atuin init "${BASE_SHELL}" )
zinit light atuinsh/atuin
if [ -n "$ZI_HOME" ]; then
# . <( atuin init "${BASE_SHELL}" )
zinit light atuinsh/atuin
else
znap source atuinsh/atuin
fi
[[ -n "${DBG}" ]] && echo "atuin loaded."
fi

View file

@ -1,6 +1,8 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
zicompinit
if [ -n "$ZI_HOME" ]; then
zicompinit
fi
# vim: set ft=sh expandtab tabstop=4 shiftwidth=4: