-
-
Save oerd/11015062 to your computer and use it in GitHub Desktop.
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
# ------------------------------------------------------------------# | |
# FILE: mbriggs.zsh-theme # | |
# BY: Matt Briggs ([email protected]) # | |
# BASED ON: smt by Stephen Tudor ([email protected]) # | |
# ------------------------------------------------------------------# | |
SCM_THEME_PROMPT_DIRTY="${red}⚡${reset_color}" | |
SCM_THEME_PROMPT_AHEAD="${red}!${reset_color}" | |
SCM_THEME_PROMPT_CLEAN="${green}✓${reset_color}" | |
SCM_THEME_PROMPT_PREFIX=" " | |
SCM_THEME_PROMPT_SUFFIX="" | |
GIT_SHA_PREFIX=" ${yellow}" | |
GIT_SHA_SUFFIX="${reset_color}" | |
SCM_GIT_CHAR='${bold_cyan}±${normal}' | |
SCM_SVN_CHAR='${bold_cyan}⑆${normal}' | |
SCM_HG_CHAR='${bold_red}☿${normal}' | |
function virtualenv_prompt() { | |
if [ ! -z "$VIRTUAL_ENV" ] | |
then | |
local env=$(dirname $VIRTUAL_ENV) | |
echo "(${env##*/})" | |
fi | |
} | |
function git_short_sha() { | |
SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$GIT_SHA_PREFIX$SHA$GIT_SHA_SUFFIX" | |
} | |
function prompt() { | |
local return_status="" | |
local ruby="${red}$(ruby_version_prompt)${reset_color}" | |
local user_host="${green}\h${reset_color}" | |
local current_path="\w" | |
local n_commands="\!" | |
local git_branch="$(git_short_sha)$(scm_prompt_info)" | |
local prompt_symbol='λ' | |
local env="${bold_white}$(virtualenv_prompt)${reset_color}" | |
local open='| ' | |
local close=' |' | |
local prompt_char=' \$ ' | |
PS1="\n${n_commands} ${user_host} ${prompt_symbol} ${ruby} ${open}${current_path} ${env}${git_branch}${close}${return_status}\n${prompt_char}" | |
} | |
PROMPT_COMMAND=prompt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment