dotfiles/lib/prompt.zsh

36 lines
798 B
Bash
Raw Normal View History

2022-08-01 16:34:07 -05:00
#!/usr/bin/env zsh
2021-12-08 09:38:24 -06:00
autoload -Uz compinit
compinit
if is-executable sheldon; then
eval "$(sheldon -q --config-file ~/.config/sheldon/plugins.toml source)"
2022-08-01 16:34:07 -05:00
else
2022-08-05 11:56:55 -05:00
echo "no sheldon = no shell extensions loaded"
fi
2021-12-08 09:38:24 -06:00
2022-08-01 16:17:58 -05:00
is-executable zoxide && eval eval "$(zoxide init zsh --cmd cd)"
2022-08-01 16:17:58 -05:00
if is-executable starship; then
eval "$(starship init zsh)"
else
2022-08-01 16:34:07 -05:00
echo "no starship = dumber prompt"
2022-08-01 16:17:58 -05:00
autoload -Uz vcs_info
2022-08-01 16:34:07 -05:00
precmd() {
vcs_info
}
2022-02-08 09:38:03 -06:00
2022-08-01 16:17:58 -05:00
zstyle ':vcs_info:git:*' formats '%b '
setopt PROMPT_SUBST
PROMPT='%F{green}%*%f %F{blue}%~%f %F{red}${vcs_info_msg_0_}%f$ '
fi
2022-09-02 15:58:02 -05:00
zstyle ':completion::complete:make:*:targets' call-command true
2022-09-08 12:53:46 -05:00
is-executable fzf && source $DOTFILES_DIR/lib/fzf.zsh
# atuin must be loaded after to override zsh's ctrl+R completion
is-executable atuin && eval "$(atuin init zsh)"