-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbash-profile
39 lines (29 loc) · 1.16 KB
/
bash-profile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Try for the girls.
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="\[\e[34;0m\][\T]\W: \$(parse_git_branch)\n:>\[\e[0m\]"
FROM FLATIRON SCHOOL.
FOR MY OWN REFERENCE ONLY.
# This function is called in your prompt to output your active git branch.
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# This function builds your prompt. It is called below
function prompt {
# Define the prompt character
local CHAR="♥"
local RED="\[\e[0;31m\]"
local BLUE="\[\e[0;34m\]"
local GREEN="\[\e[0;32m\]"
local GRAY_TEXT_BLUE_BACKGROUND="\[\e[37;44;1m\]"
# Define a variable to reset the text color
local RESET="\[\e[0m\]"
# ♥ ☆ - Keeping some cool ASCII Characters for reference
# Here is where we actually export the PS1 Variable which stores the text for your prompt
export PS1="\[\e]2;\u@\h\a[$GRAY_TEXT_BLUE_BACKGROUND\t$RESET]$RED\$(parse_git_branch) $GREEN\W\n$BLUE//$RED $CHAR $RESET"
PS2='> '
PS4='+ '
}
# Finally call the function and our prompt is all pretty
prompt