Skip to content

Instantly share code, notes, and snippets.

@nibocn
Created February 13, 2016 11:26
Show Gist options
  • Save nibocn/d7c8c642ce75f4ef7f92 to your computer and use it in GitHub Desktop.
Save nibocn/d7c8c642ce75f4ef7f92 to your computer and use it in GitHub Desktop.
# Grab the current date (%D) and time (%T) wrapped in {}: {%D %T}
DALLAS_CURRENT_TIME_="%{$fg[white]%}[%{$fg[yellow]%}%T%{$fg[white]%}]%{$reset_color%}"
# Grab the current machine name: muscato
DALLAS_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}"
# Grab the current filepath, use shortcuts: ~/Desktop
# Append the current git branch, if in a git repository: ~aw@master
DALLAS_CURRENT_LOCA_="%{$fg[cyan]%}%~\$(git_prompt_info)%{$reset_color%}"
# Grab the current username: dallas
DALLAS_CURRENT_USER_="%{$fg[green]%}%n%{$fg[white]%}: %{$reset_color%}"
#Grab the current username and machine name
DALLAS_CURRENT_USER_MACH_="%{$fg_bold[green]%}%n%{$fg[white]%}@%{$fg[blue]%}%m "
# Use a % for normal users and a # for privelaged (root) users.
DALLAS_PROMPT_CHAR_="%{$fg_bold[red]%}%(!.#.»)%{$reset_color%}"
# For the git prompt, use a white @ and blue text for the branch name
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg_bold[yellow]%}‹"
# Close it all off by resetting the color and styles.
ZSH_THEME_GIT_PROMPT_SUFFIX="›%{$reset_color%}"
# Do nothing if the branch is clean (no changes).
ZSH_THEME_GIT_PROMPT_CLEAN=""
# Add 3 cyan ✗s if this branch is diiirrrty! Dirty branch!
# ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[yellow]%}*%{$fg_bold[red]%}]"
# Put it all together!
PROMPT="$DALLAS_CURRENT_TIME_$DALLAS_CURRENT_USER_MACH_$DALLAS_CURRENT_LOCA_ $DALLAS_PROMPT_CHAR_%{$reset_color%} "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment