bonfire/config/zsh/.zshrc

50 lines
1.5 KiB
Bash
Raw Normal View History

2023-06-06 23:18:09 +05:00
#!/usr/bin/env zsh
source $ZDOTDIR/config.zsh
# NOTE ZGEN_DIR and ZGEN_SOURCE are forward-declared in modules/shell/zsh.nix
# NOTE Using zgenom because zgen is no longer maintained
if [ ! -d "$ZGEN_DIR" ]; then
2023-06-15 11:05:31 +05:00
echo "Installing jandamm/zgenom"
git clone https://github.com/jandamm/zgenom "$ZGEN_DIR"
2023-06-06 23:18:09 +05:00
fi
source $ZGEN_DIR/zgenom.zsh
# Check for plugin and zgenom updates every 7 days
# This does not increase the startup time.
zgenom autoupdate
if ! zgenom saved; then
2023-06-15 11:05:31 +05:00
echo "Initializing zgenom"
rm -f $ZDOTDIR/*.zwc(N) \
$XDG_CACHE_HOME/zsh/*(N) \
$ZGEN_INIT.zwc
# NOTE Be extra careful about plugin load order, or subtle breakage can emerge
zgenom load junegunn/fzf shell
zgenom load zdharma-continuum/fast-syntax-highlighting
zgenom load zsh-users/zsh-completions src
zgenom load zsh-users/zsh-autosuggestions
zgenom load zsh-users/zsh-history-substring-search
zgenom load romkatv/powerlevel10k powerlevel10k
zgenom save
zgenom compile $ZDOTDIR
2023-06-06 23:18:09 +05:00
fi
## Bootstrap interactive sessions
if [[ $TERM != dumb ]]; then
2023-06-15 11:05:31 +05:00
autoload -Uz compinit && compinit -u -d $ZSH_CACHE/zcompdump
2023-06-06 23:18:09 +05:00
2023-06-15 11:05:31 +05:00
source $ZDOTDIR/keybinds.zsh
source $ZDOTDIR/completion.zsh
source $ZDOTDIR/aliases.zsh
source $ZDOTDIR/.p10k.zsh
2023-06-06 23:18:09 +05:00
2023-06-15 11:05:31 +05:00
# Auto-generated by nixos
_source $ZDOTDIR/extra.zshrc
# If you have host-local configuration, put it here
_source $ZDOTDIR/local.zshrc
2023-06-06 23:18:09 +05:00
2023-06-15 11:05:31 +05:00
_cache fasd --init posix-alias zsh-{hook,{c,w}comp{,-install}}
2023-06-06 23:18:09 +05:00
fi