Skip to content

Instantly share code, notes, and snippets.

@leopku
Last active August 29, 2015 14:03
Show Gist options
  • Save leopku/75435e606128443a64f7 to your computer and use it in GitHub Desktop.
Save leopku/75435e606128443a64f7 to your computer and use it in GitHub Desktop.
simplified zsh theme of fino
# fino-simplify.zsh-theme
# simplified [fino](https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/fino.zsh-theme) zsh theme.
# Display current user, host name, current dir, git info & ruby version one line.
function prompt_char {
git branch >/dev/null 2>/dev/null && echo "±" && return
echo '$'
}
function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || hostname -s
}
local ruby_env=''
if which rvm-prompt &> /dev/null; then
ruby_env='rvm ‹$(rvm-prompt i v g)›%{$reset_color%}'
elif which rbenv &> /dev/null; then
ruby_env='rbenv ‹$(rbenv version-name)›%{$reset_color%}'
#fi
else
if which ruby &> /dev/null; then
# ruby_env='system ‹$(ruby --version | awk "{print $2}")›%{$reset_color%}'
ruby_env='system ‹$(ruby --version | cut -d" " -f2)›%{$reset_color%}'
fi
fi
local current_dir='${PWD/#$HOME/~}'
local git_info='$(git_prompt_info)'
local prompt_char='$(prompt_char)'
PROMPT="%{$FG[040]%}%n%{$reset_color%}%{$FG[239]%}@%{$reset_color%}%{$FG[033]%}$(box_name)%{$reset_color%}:%{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info}%{$FG[239]%}%{$reset_color%}[%{$FG[243]%}${ruby_env}%{$reset_color%}]${prompt_char} "
ZSH_THEME_GIT_PROMPT_PREFIX="%{$FG[239]%}%{$reset_color%}(%{$fg[255]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment