Skip to content

Instantly share code, notes, and snippets.

@syamn
Last active November 30, 2016 11:55
Show Gist options
  • Save syamn/dd53c561abd600d756c8969ef7ab88f0 to your computer and use it in GitHub Desktop.
Save syamn/dd53c561abd600d756c8969ef7ab88f0 to your computer and use it in GitHub Desktop.
kawaii prompt
# #####
# ##### Prompt
# #####
autoload -Uz colors; colors
setopt prompt_subst
# ref: http://d.hatena.ne.jp/uasi/20091017/1255712789
function prompt-git-current-branch {
local name st color
if [[ "$PWD" =~ '/\.git(/.*)?$' ]]; then
return
fi
name=$(basename "`git symbolic-ref HEAD 2> /dev/null`")
if [[ -z $name ]]; then
return
fi
st=`git status 2> /dev/null`
if [[ -n `echo "$st" | grep "^nothing to"` ]]; then
color=${fg[green]}
elif [[ -n `echo "$st" | grep "^nothing added"` ]]; then
color=${fg[yellow]}
elif [[ -n `echo "$st" | grep "^# Untracked"` ]]; then
color=${fg_bold[red]}
else
color=${fg[red]}
fi
echo "%f[%{$color%}$name%{$reset_color%}]"
}
PROMPT='
%F{226}>%F{227}>%F{228}>%F{229}>%F{230}> %F{212}%n %F{yellow} %~ `prompt-git-current-branch`%f
%(?.%F{121}.%F{164})%(?!(๑•﹏•!(。ŏ﹏ŏ))%{%f%} %F{209}%#%f '
RPROMPT='%F{240}^ %D{%H:%M:%S}%f'
SPROMPT='%F{209}%{$suggest%}(๑•̀ᴗ•́๑) umm, typo for %F{230}%r %F{209}? %F{white}[y,n,a,e]%F{209}:%f'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment