-
Notifications
You must be signed in to change notification settings - Fork 6
/
verbose.zsh-theme
31 lines (25 loc) · 1.13 KB
/
verbose.zsh-theme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# this is essentially this:
# http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/
# set different prompt characters if working in a git/hg repo
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '±' && return
# hg root >/dev/null 2>/dev/null && echo '☿' && return # i never use hg
echo '○'
}
# start prompt with a newline, then print "$USER at $HOST"
PROMPT='
%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%}'
# display the CWD, collapse $HOME to ~
PROMPT=$PROMPT' in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}'
EXTRA_SPACE=""
if [[ -z ${TMUX} && -e "${HOME}/.iterm2_shell_integration.zsh" ]]; then
EXTRA_SPACE=" "
fi
# add git repo information (current branch, if it's dirty) and the prompt char
PROMPT=$PROMPT'$(git_prompt_info)
'"%{$(iterm2_prompt_mark)%}${EXTRA_SPACE}"'%{$fg[blue]%}$(prompt_char)%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} ☝︎"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" # unsupported in mainline omz
ZSH_THEME_GIT_PROMPT_CLEAN=""