Skip to content

Instantly share code, notes, and snippets.

@jeroenvisser101
Created March 4, 2016 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeroenvisser101/8687e310a35fc1f1bc3f to your computer and use it in GitHub Desktop.
Save jeroenvisser101/8687e310a35fc1f1bc3f to your computer and use it in GitHub Desktop.
My ZSH Theme
# PROMPT="[%*] %n:%c $(git_prompt_info)%(!.#.$) "
_utheme_collapsed_wd() {
echo $(pwd | perl -pe '
BEGIN {
binmode STDIN, ":encoding(UTF-8)";
binmode STDOUT, ":encoding(UTF-8)";
}; s|^$ENV{HOME}|~|g; s|/([^/.])[^/]*(?=/)|/$1|g; s|/\.([^/])[^/]*(?=/)|/.$1|g
')
}
local ret_status="%(?:%{$reset_color%}:%{$fg_bold[red]%})%(!.#.$)%{$reset_color%}"
PROMPT='[%*] %{$fg[cyan]%}%n%{$reset_color%}:%{$fg[green]%}$(_utheme_collapsed_wd)%{$reset_color%} ${ret_status} '
RPROMPT='$(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[yellow]%}git:("
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment