Created
April 27, 2011 01:52
-
-
Save dirkkelly/943585 to your computer and use it in GitHub Desktop.
.bash_profile
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
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" | |
vc_dirty_marker="✘" | |
prompt_designator_symbol="»" | |
prompt_designator_alternate="…" | |
_prompt_colour() { | |
echo -n '\[' | |
if [[ "$1" = default ]]; then | |
echo -n "\\e[0m" | |
else | |
local color_number | |
case "$1" in | |
black) color_number=0; ;; | |
red) color_number=1; ;; | |
green) color_number=2; ;; | |
yellow) color_number=3; ;; | |
blue) color_number=4; ;; | |
magenta) color_number=5; ;; | |
cyan) color_number=6; ;; | |
white) color_number=7; ;; | |
*) color_number=9; ;; | |
esac | |
echo -n "\\e[3${color_number}m" | |
fi | |
echo -n '\]' | |
} | |
__bash_vcprompt_on() { | |
local vcprompt_value="$(vcprompt --format "%b")" | |
[[ -n "$vcprompt_value" ]] && echo -n "on $vcprompt_value " | |
} | |
__bash_vcprompt_dirty() { | |
local vcprompt_status="$(vcprompt --format "%i")" | |
if [[ -n "$vcprompt_status" && "$vcprompt_status" != "clean" ]]; then | |
echo -n "$vc_dirty_marker " | |
fi | |
} | |
__bash_rvm_prompt_additions() { | |
if [[ -x ~/.rvm/bin/rvm-prompt ]]; then | |
local interpreter="$(~/.rvm/bin/rvm-prompt u g)" | |
[[ -n "$interpreter" ]] && echo -n "using $interpreter " | |
fi | |
} | |
# Each part of the prompt. | |
_prompt_pwd="$(_prompt_colour green)\W$(_prompt_colour default)" | |
_prompt_git_branch="$(_prompt_colour blue)\$(__bash_vcprompt_on)$(_prompt_colour default)" | |
_prompt_git_dirty="$(_prompt_colour magenta)\$(__bash_vcprompt_dirty)$(_prompt_colour default)" | |
_prompt_rvm_interpreter="$(_prompt_colour yellow)\$(__bash_rvm_prompt_additions)$(_prompt_colour default)" | |
_prompt_input_designator="\n$(_prompt_colour red)$prompt_designator_symbol$(_prompt_colour default) " | |
_prompt_input_continued="$(_prompt_colour yellow)$prompt_designator_alternate$(_prompt_colour default) " | |
PS1="${_prompt_pwd} ${_prompt_git_branch}${_prompt_rvm_interpreter}${_prompt_git_dirty}${_prompt_input_designator}" | |
PS2="${_prompt_input_continued}" | |
export APP_TLD=tfgloco.local; | |
# Colorize the Terminal | |
export CLICOLOR=1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment