Added personal theme.

This commit is contained in:
Brian Guthrie 2010-12-13 06:45:09 -05:00
commit 56fd856c84

View file

@ -1,16 +1,13 @@
setopt nocorrect
# Found on the ZshWiki # Found on the ZshWiki
# http://zshwiki.org/home/config/prompt # http://zshwiki.org/home/config/prompt
#
# As lifted from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/
function collapse_pwd {
echo $(pwd | sed -e "s,^$HOME,~,")
}
function prompt_char { function prompt_char {
git branch >/dev/null 2>/dev/null && echo 'λ' && return git branch >/dev/null 2>/dev/null && echo "%{$fg[blue]%}λ" && return
hg root >/dev/null 2>/dev/null && echo 'λ' && return # These are slow and have therefore been killed:
svn info >/dev/null 2>/dev/null && echo 'λ' && return # svn info >/dev/null 2>/dev/null && echo 'λ' && return
# hg root >/dev/null 2>/dev/null && echo 'λ' && return
echo '$' echo '$'
} }
@ -20,5 +17,17 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
ZSH_THEME_GIT_PROMPT_CLEAN="" ZSH_THEME_GIT_PROMPT_CLEAN=""
PROMPT='[%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}:%{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info)] # Parsing git dirty status slows down my prompt tremendously without adding much value.
$(prompt_char) ' # This variant of git_prompt_info just grabs the branch.
function git_current_branch() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX%{$fg[blue]%}${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
# PROMPT='[%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}:%{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info)]
# $(prompt_char) '
# PROMPT='[%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}:%{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info)]
# λ '
# PROMPT='[%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}:%{$fg_bold[green]%}%~%{$reset_color%}]
# λ '
PROMPT='[%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}:%{$fg_bold[green]%}%~%{$reset_color%}$(git_current_branch)] $(prompt_char)%{$reset_color%} '