2021-12-31 11:54:55 -08:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
# Eryn Wells <eryn@erynwells.me>
|
|
|
|
|
2022-01-22 10:13:05 -08:00
|
|
|
local theme=$1
|
|
|
|
if [[ -z "$1" ]]; then
|
|
|
|
theme=loquacious
|
|
|
|
fi
|
2021-12-31 11:54:55 -08:00
|
|
|
|
2022-01-22 10:13:05 -08:00
|
|
|
autoload -U add-zsh-hook
|
|
|
|
autoload -Uz vcs_info
|
2021-12-31 11:54:55 -08:00
|
|
|
|
2022-01-22 10:13:05 -08:00
|
|
|
zstyle ':vcs_info:*' disable p4 bzr cdv darcs mtn svk tla cvs svn
|
|
|
|
zstyle ':vcs_info:*' enable git
|
|
|
|
zstyle ':vcs_info:git:general:*' formats '%b'
|
2021-12-31 11:54:55 -08:00
|
|
|
|
2022-01-22 10:13:05 -08:00
|
|
|
# Export the current Git branch before every prompt.
|
|
|
|
function export_gitbranch {
|
|
|
|
vcs_info general
|
|
|
|
export gitbranch=${vcs_info_msg_0_}
|
2021-12-31 11:54:55 -08:00
|
|
|
}
|
|
|
|
|
2022-01-22 10:13:05 -08:00
|
|
|
add-zsh-hook precmd export_gitbranch
|
|
|
|
|
|
|
|
autoload -U promptinit
|
|
|
|
promptinit
|
|
|
|
prompt $theme
|