From 299d557ecf564b98b45a90c239020550af6b94aa Mon Sep 17 00:00:00 2001 From: Nathan Stilwell Date: Sun, 1 May 2016 17:01:07 -0400 Subject: [PATCH] a new minimal theme --- themes/ace-of-spades.zsh-theme | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 themes/ace-of-spades.zsh-theme diff --git a/themes/ace-of-spades.zsh-theme b/themes/ace-of-spades.zsh-theme new file mode 100644 index 000000000..816f18d91 --- /dev/null +++ b/themes/ace-of-spades.zsh-theme @@ -0,0 +1,56 @@ +# +# The Ace of Spades +# +# ♤ ♠︎ ♤ ♠︎ +# + +function collapse_pwd { + echo $(pwd | sed -e "s,^$HOME,~,") +} + +function ace_prompt () { + # colors + local red="\033[0;31m"; + local blue="\033[0;34m"; + local stop="\033[0m"; + + local spade="♤ "; + local fill_spade="♠︎ "; + + ref=$(git symbolic-ref HEAD 2> /dev/null); + branch=${ref#refs/heads/}; + + if [[ ! -z $branch ]]; then + if [[ $branch == "master" ]]; then + if [[ ! -z "$(git status --porcelain)" ]]; then + local prompt="${red}$fill_spade${stop}"; + else + local prompt="${red}$spade${stop}"; + fi + else + if [[ ! -z "$(git status --porcelain)" ]]; then + local prompt="${blue}$fill_spade${stop}"; + else + local prompt="${blue}$spade${stop}"; + fi + fi + else + local prompt="$spade"; + fi + + echo "$prompt"; + + unset spade; + unset prompt; + unset red; + unset blue; + unset stop; +} + +function directory () { + echo $(basename `pwd`); +} + +PROMPT=' $(ace_prompt) $(collapse_pwd) + > ' +