Skip to content

Instantly share code, notes, and snippets.

@guemidiborhane
Created July 21, 2015 14:31
Show Gist options
  • Save guemidiborhane/77f6346d7600b4d23642 to your computer and use it in GitHub Desktop.
Save guemidiborhane/77f6346d7600b4d23642 to your computer and use it in GitHub Desktop.
if [[ -z $ZSH_THEME_CLOUD_PREFIX ]]; then
ZSH_THEME_CLOUD_PREFIX='☁'
fi
function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || echo $HOST
}
prompt_prefix() {
echo -n "%{$fg_bold[cyan]%}$ZSH_THEME_CLOUD_PREFIX "
}
prompt_dir() {
echo -n "%{$fg_bold[green]%}%p %{$fg[green]%}%c "
}
prompt_status() {
local symbols
symbols=()
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘"
[[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡"
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙"
[[ -n "$symbols" ]] && echo -n "$symbols "
}
prompt_end() {
echo -n "%{$reset_color%}"
}
build_prompt() {
RETVAL=$?
prompt_prefix
prompt_dir
prompt_status
prompt_end
}
PROMPT='%{%f%b%k%}$(build_prompt) '
RPROMPT='${time} at %{$fg[green]%}$(box_name)%{$fg[magenta]%}$(git_prompt_info)%{$reset_color%}$(git_prompt_status)%{$reset_color%}$(git_prompt_ahead)%{$reset_color%}'
time_enabled="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}"
time_disabled="%{$fg[green]%}%*%{$reset_color%}"
time=$time_enabled
ZSH_THEME_GIT_PROMPT_PREFIX=" | %{$fg[magenta]$terminfo[bold]%}git:%{$fg[yellow]%}" # 
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%} ☂" # Ⓓ
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" # ⓣ
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ☀" # Ⓞ
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✚" # ⓐ ⑃
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ⚡" # ⓜ ⑁
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" # ⓧ ⑂
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➜" # ⓡ ⑄
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ♒" # ⓤ ⑊
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[blue]%} 𝝙"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment