Last Updated: February 25, 2016
·
671
· Eduardo Martines

ZSH: The most badass config

Simple, powerful and very useful..

On the left side

  • profile name
  • current folder path
  • amazing git info (current branch, changes, etc)

On the right side (take advantage of this forgotten space)

  • current time-stamp (to see how long the command takes to run)
  • machine name

# rest of the code omitted

function collapse_pwd {
    echo $(pwd | sed -e "s,^$HOME,~,")
}

function prompt_char {
    git branch >/dev/null 2>/dev/null && echo '±' && return
    hg root >/dev/null 2>/dev/null && echo '☿' && return
    echo '○'
}

PROMPT='
%{$fg[cyan]%}%n%{$reset_color%} in %{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info) $(prompt_char) '

RPROMPT='%{$fg_bold[green]%}[$(date +%H:%M:%S)]%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%}'

ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[cyan]%}!"
ZSH_THEME_GIT_PROMPT_CLEAN=""

Also you can always change the output colors! ;)