Skip to content

Instantly share code, notes, and snippets.

@keithcelt
Created October 15, 2012 22:15
Show Gist options
  • Save keithcelt/3895962 to your computer and use it in GitHub Desktop.
Save keithcelt/3895962 to your computer and use it in GitHub Desktop.
My ZSH Theme
function ruby_version() {
if [[ -s ~/.rvm/scripts/rvm ]] ; then
echo $(~/.rvm/bin/rvm-prompt)
fi
}
function show_git_branch() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
function git_fun() {
if [ -n "$(current_branch)" ]; then
echo "%{$fg[yellow]%}%{$reset_color%}$(parse_git_dirty)"
fi
}
RPS1="%{$fg[yellow]%}\$(ruby_version)%{$reset_color%} $EPS1"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}|%{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%} ⚡%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
PROMPT='%{$fg[green]%}%1~%{$reset_color%}$(show_git_branch)$(git_fun)
%B$%b '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment