Skip to content

Instantly share code, notes, and snippets.

@PiiXiieeS
Forked from egeste/bureau-rvm.zsh-theme
Last active February 1, 2017 06:19
Show Gist options
  • Save PiiXiieeS/5e186ce32b292f608d7c8e61e9603d3c to your computer and use it in GitHub Desktop.
Save PiiXiieeS/5e186ce32b292f608d7c8e61e9603d3c to your computer and use it in GitHub Desktop.
Oh My ZSH NVM, optimized "Bureau" Theme and ZSH configuration
# oh-my-zsh Customized Bureau Theme for PiiXiieeS
### NVM
ZSH_THEME_NVM_PROMPT_PREFIX="%B⬡%b "
ZSH_THEME_NVM_PROMPT_SUFFIX=""
### Git
ZSH_THEME_GIT_PROMPT_PREFIX="[%{$fg_bold[green]%}±%{$reset_color%}%{$fg_bold[white]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}]"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%} ✓%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%} ✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[cyan]%}▴%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg[magenta]%}▾%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_STAGED="%{$fg[green]%}•%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNSTAGED="%{$fg[yellow]%}•%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[red]%}•%{$reset_color%}"
### Prompt
if [[ $EUID -eq 0 ]]; then
_USERNAME="%{$fg_bold[red]%}%n"
_LIBERTY="%{$fg[red]%}⚡ "
else
_USERNAME="%{$fg_bold[white]%}%n"
_LIBERTY="%{$fg[green]%}ᐅ"
fi
_USERNAME="$_USERNAME%{$reset_color%}@%m"
_LIBERTY="$_LIBERTY%{$reset_color%}"
setopt prompt_subst
PROMPT=" %B$_LIBERTY%b "
RPROMPT='$(rvm_prompt_info)$(nvm_prompt_info)'
get_space () {
local STR=$1$2
local zero='%([BSUbfksu]|([FB]|){*})'
local LENGTH=${#${(S%%)STR//$~zero/}}
local SPACES=""
(( LENGTH = ${COLUMNS} - $LENGTH - 1))
for i in {0..$LENGTH}; do SPACES="$SPACES "; done
echo $SPACES
}
bureau_precmd () {
_PATH="%{$fg_bold[white]%}%~%{$reset_color%}"
_1LEFT="$_USERNAME:$_PATH"
_1RIGHT="$(git_prompt_status)$(git_prompt_info)[%*]"
_1SPACES=`get_space $_1LEFT $_1RIGHT`
print
print -rP "${_1LEFT}${_1SPACES}${_1RIGHT}"
}
autoload -U add-zsh-hook
add-zsh-hook precmd bureau_precmd
# See http://geoff.greer.fm/lscolors/
export LSCOLORS="exfxcxdxbxbxbxbxbxbxbx"
export LS_COLORS="di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=31;40:cd=31;40:su=31;40:sg=31;40:tw=31;40:ow=31;40:"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment