Created
January 18, 2015 18:08
-
-
Save catvec/dcec26620529b0bd46e4 to your computer and use it in GitHub Desktop.
Extends the default Babun ZSH theme. Removes the location on the right prompt and replaces it with most recent return code. On the left prompt it will shorten the location if the user is in a "home". If the user is in a Cygwin home the shortended text will be red to signifiy a Cygwin home
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local return_code="%(?..%{$fg[red]%}%? %{$reset_color%})" | |
function collapse_pwd { | |
BABUN_ZSH_CUSTOM_THEME_REAL_HOME="/cygdrive/c/Users/noahh_000" | |
BABUN_ZSH_CUSTOM_THEME_CYGWIN_HOME="/home/Noah Huppert" | |
echo $(pwd | sed -e "s,^$BABUN_ZSH_CUSTOM_THEME_REAL_HOME,~," | sed -e "s,^$BABUN_ZSH_CUSTOM_THEME_CYGWIN_HOME,%{$fg[red]%}~%{$fg[blue]%}," ) | |
} | |
PROMPT='%{$fg[blue]%}{ $(collapse_pwd) } \ | |
%{$fg[green]%}$( git rev-parse --abbrev-ref HEAD 2> /dev/null || echo "" )%{$reset_color%} \ | |
%{$fg[red]%}%(!.#.»)%{$reset_color%} ' | |
PROMPT2='%{$fg[red]%}\ %{$reset_color%}' | |
RPS1='${return_code} ' | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}:: %{$fg[yellow]%}(" | |
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%} " | |
ZSH_THEME_GIT_PROMPT_CLEAN="" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$fg[yellow]%}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment