Last active
August 29, 2015 13:55
-
-
Save illuzian/8764264 to your computer and use it in GitHub Desktop.
Python ZSH Theme With Pure Awesome by Luz
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
# ------------------------------------------------------------------------ | |
# Anthony Hawkes who totally ripped off junkfood by | |
# Tyler Cipriani who ripped off | |
# Totally ripped off Dallas theme | |
# Anthony Hawkes - Totally modified the code/variables and layour to make | |
# it more human readable and obvious/less of a fluster cuck. Seperation | |
# of interests and all that. | |
# Also made it more pythonated as it'as better(my opinion, but true) | |
# ------------------------------------------------------------------------ | |
#Make colours easier to read when interpolated with vars | |
RED="%{$fg_bold[red]%}" | |
WHITE="%{$fg_bold[white]%}" | |
YELLOW="%{$fg_bold[yellow]%}" | |
BLUE="%{$fg_bold[blue]%}" | |
GREEN="%{$fg_bold[green]%}" | |
CYAN="%{$fg_bold[cyan]%}" | |
GRAY="%{$fg_bold[grey]%}" | |
# This resets term color | |
RESETCOL="%{$reset_color%}" | |
# Left and right bracket, you could change the [ and ] if you wanted something different | |
LBRACKET="${RESETCOL}${WHITE}[${RESETCOL}" | |
RBRACKET="${RESETCOL}${WHITE}]${RESETCOL}" | |
# This is the bit you see where you enter commands | |
ENDPROMPT="${RESETCOL}>" | |
# Some width calcs for a - seperator that is your terminal size | |
WIDTH=${COLUMNS} | |
LINE=`printf '-%.0s' {1..${WIDTH}}` | |
# Optional seperator that is the size of your term | |
#SEPERATOR=`echo ${GRAY}${LINE}${RESETCOL}` | |
# Optional seperator that is 80 - long | |
#SEPERATOR="${GRAY}`printf '-%.0s' {1..80}` ${RESETCOL}" | |
# Grab the current date (%W) and time (%t) | |
TIME="${YELLOW}%W${RESETCOL}${WHITE}%t" | |
# Grab the current machine name (%m) | |
MACHINE="${BLUE}%m${WHITE}" | |
# Grab the current username (%n) | |
USER="${GREEN}%n${RESETCOL}" | |
#Grab user @ host | |
USER_MACHINE="${USER}@${MACHINE}" | |
# Grab the current filepath, use shortcuts: ~/Desktop | |
# Append the current git branch, if in a git repository: ~aw@master | |
LOCATION="${CYAN} %~\$(git_prompt_info)" | |
# For the git prompt, use a white @ and blue text for the branch name | |
ZSH_THEME_GIT_PROMPT_PREFIX="${WHITE}@${BLUE}" | |
# Close it all off by resetting the color and styles. | |
ZSH_THEME_GIT_PROMPT_SUFFIX="${RESETCOL}" | |
# Do nothing if the branch is clean (no changes). | |
ZSH_THEME_GIT_PROMPT_CLEAN="${GREEN}✔" | |
# Add 3 cyan ✗s if this branch is diiirrrty! Dirty branch! | |
ZSH_THEME_GIT_PROMPT_DIRTY="${RED}✗✗✗" | |
# Get python version and virtual env, py version will change if you activate a virtualenv wit different ver | |
PY_VERSION="${CYAN} Python `python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))'` `echo $VIRTUAL_ENV | rev | cut -d '/' -f 1 | rev`" | |
# This is the red # at the beginning of each line | |
PREFIX="${RESETCOL}${RED}#${RESETCOL}" | |
# The prompt(s) all spacing is changed here | |
PROMPT=" | |
${PREFIX}${LBRACKET} ${USER_MACHINE} ${RBRACKET}${LBRACKET} ${PY_VERSION} ${RBRACKET}${LBRACKET} ${LOCATION} ${RBRACKET} | |
${PREFIX}${ENDPROMPT}" | |
# The prompt that shows on the right and side | |
RPROMPT="${LBRACKET} ${TIME} ${RBRACKET}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment