-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
37 lines (29 loc) · 652 Bytes
/
Copy path.bashrc
File metadata and controls
37 lines (29 loc) · 652 Bytes
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
# .bashrc
# aliases
[[ -f ~/.aliases ]] && source ~/.aliases
RED="\033[0;31m"
BROWN="\033[0;33m"
GREY="\033[0;97m"
GREEN="\033[0;32m"
BLUE="\033[0;34m"
PS_CLEAR="\033[0m"
SCREEN_ESC="\033k\033\134"
COLOR1="${BLUE}"
COLOR2="${BLUE}"
P="\$"
prompt_compact() {
unset PROMPT_COMMAND
PS1="${COLOR1}${P}${PS_CLEAR} "
PS2="> "
}
prompt_color() {
PS1="${GREEN}\W\$(parse_git_branch) → ${GREY}"
PS2="\033[33;1mcontinue \033[0m\033[1m> "
}
parse_git_branch() {
[ -d .git ] || return 1
git symbolic-ref HEAD 2> /dev/null | sed 's#\(.*\)\/\([^\/]*\)$# \2#'
}
# Set default prompt if interactive
test -n "$PS1" &&
prompt_color