zsh theme /backup/
2024-08-17 - orzo
Backup zsh témy.
prompt_orzo_help() {
cat <<'EOF'
fpath=(~/.zsh $fpath)
autoload -Uz promptinit
promptinit
prompt orzo
EOF
}
# Get branch name
function get_git_branch () {
if git rev-parse --is-inside-work-tree &>/dev/null; then
echo "[$(git symbolic-ref --short HEAD 2>/dev/null || echo detached)] "
fi
}
# Function to update the prompt before each command
function prompt_orzo_update () {
PS1="%B%1~ %F$(get_git_branch)%f%b%(?..[%?] )> "
}
# Setup zsh prompt
prompt_orzo_setup () {
# Register hook
precmd_functions+=(prompt_orzo_update)
# Print startup prompt - topmost dir and branch name
prompt_orzo_update
# Print cwd
RPS1="%F{${1:-green}}%~%f"
prompt_opts=(cr percent)
}
prompt_orzo_setup "$@"