Last active
February 1, 2016 10:51
-
-
Save m4dz/09ff9bfbe8a8f25da24c to your computer and use it in GitHub Desktop.
m4dz ZSH theme
This file contains 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
# Colors | |
autoload colors && colors | |
for COLOR in RED GREEN YELLOW BLUE MAGENTA CYAN BLACK WHITE; do | |
eval $COLOR='%{$fg_no_bold[${(L)COLOR}]%}' #wrap colours between %{ %} to avoid weird gaps in autocomplete | |
eval BOLD_$COLOR='%{$fg_bold[${(L)COLOR}]%}' | |
done | |
eval RESET='%{$reset_color%}' | |
omg_default_color_on=$WHITE | |
omg_default_color_off=$WHITE | |
red=$RED | |
green=$GREEN | |
cyan=$CYAN | |
yellow=$YELLOW | |
reset=$RESET | |
# GIT Prompt | |
ZSH_THEME_GIT_PROMPT_BRANCH="%{$fg_bold[yellow]%}" | |
# Prompts | |
RPROMPT='$(build_rprompt)' | |
PROMPT='$(build_prompt)' | |
function build_prompt { | |
local prompt="%{$fg[cyan]%}[%m/%n][%~]%{$reset_color%}\n" | |
if type git_super_status &> /dev/null; then | |
prompt="${prompt}$(git_super_status)" | |
fi | |
prompt="${prompt}%(?.%{$fg[green]%}.%{$fg[red]%})%B%(!.#.$)%b%{$reset_color%} " | |
echo "${prompt}${reset}" | |
} | |
function build_rprompt { | |
local rprompt="" | |
if hash ndenv &> /dev/null; then | |
local ndenv_version=`ndenv version-name` | |
if [ ${ndenv_version} != "system" ]; then | |
rprompt="${rprompt}${cyan}[${ndenv_version}]" | |
fi | |
fi | |
if hash pyenv &> /dev/null; then | |
local pyenv_version=`pyenv version-name` | |
if [ ${pyenv_version} != "system" ]; then | |
rprompt="${rprompt}${green}[${pyenv_version}]" | |
fi | |
fi | |
if hash rbenv &> /dev/null; then | |
local rbenv_version=`rbenv version-name` | |
if [ ${rbenv_version} != "system" ]; then | |
rprompt="${rprompt}${red}[${rbenv_version}]" | |
fi | |
fi | |
echo "${rprompt}${reset}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment