public
Created

My ZSH Theme

  • Download Gist
olly.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 32 33 34 35 36 37 38 39 40 41 42 43 44
# ------------------------------------------------------------------------------
# FILE: olly.zsh-theme
# DESCRIPTION: oh-my-zsh theme file.
# AUTHOR: Olly Legg (olly@51degrees.net)
# ------------------------------------------------------------------------------
 
 
if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then
if [ "$SSH_CONNECTION" ]; then
HOSTNAME="%{$fg_bold[red]%}%n@%m %{$reset_color%}"
else
HOSTNAME=""
fi
 
PROMPT='$HOSTNAME%{$fg_bold[magenta]%}%c %(!.%{$fg[red]%}#.%{$fg_bold[green]%}❯)%{$reset_color%} '
 
ZSH_THEME_GIT_PROMPT_PREFIX=" [%{$fg[blue]%}git%{$reset_color%}:%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}]"
ZSH_THEME_GIT_PROMPT_DIRTY=""
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_RVM_PROMPT_PREFIX=" [%{$fg[blue]%}rvm%{$reset_color%}:%{$fg[red]%}"
ZSH_THEME_RVM_PROMPT_SUFFIX="%{$reset_color%}]"
RPROMPT='$(git_prompt_info)$(rvm_prompt_info)$(git_prompt_status)%{$reset_color%}'
else
if [ "$SSH_CONNECTION" ]; then
HOSTNAME="%n@%m"
else
HOSTNAME=""
fi
 
PROMPT='$HOSTNAME%c %(!.#.❯) '
 
ZSH_THEME_GIT_PROMPT_PREFIX=" [git:"
ZSH_THEME_GIT_PROMPT_SUFFIX="]"
ZSH_THEME_GIT_PROMPT_DIRTY=""
ZSH_THEME_GIT_PROMPT_CLEAN=""
 
ZSH_THEME_RVM_PROMPT_PREFIX=" [rvm:"
ZSH_THEME_RVM_PROMPT_SUFFIX="]"
 
RPROMPT='$(git_prompt_info)$(rvm_prompt_info)$(git_prompt_status)'
fi
rvm.zsh
Shell
1 2 3 4 5 6 7
# get the name of the branch we are on
function rvm_prompt_info() {
ruby_version=$(~/.rvm/bin/rvm-prompt i v 2> /dev/null) || return
if [ -n "$ruby_version" ]; then
echo "$ZSH_THEME_RVM_PROMPT_PREFIX$ruby_version$ZSH_THEME_RVM_PROMPT_SUFFIX"
fi
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.