-
Notifications
You must be signed in to change notification settings - Fork 1
/
.bash_prompt
41 lines (37 loc) · 1.09 KB
/
.bash_prompt
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
40
41
# Colors
COLOR_DEFAULT='\[\e[39m\]'
COLOR_RESET='\[\e[0m\]'
COLOR_RED='\[\e[31m\]'
COLOR_GREEN='\[\e[32m\]'
COLOR_YELLOW='\[\e[33m\]'
COLOR_BLUE='\[\e[34m\]'
COLOR_MAGENTA='\[\e[35m\]'
COLOR_CYAN='\[\e[36m\]'
COLOR_GRAY='\[\e[90m\]'
COLOR_LIGHT_RED='\[\e[91m\]'
COLOR_LIGHT_GREEN='\[\e[92m\]'
COLOR_LIGHT_YELLOW='\[\e[93m\]'
COLOR_LIGHT_BLUE='\[\e[94m\]'
COLOR_LIGHT_MAGENTA='\[\e[95m\]'
COLOR_LIGHT_CYAN='\[\e[96m\]'
COLOR_LIGHT_GRAY='\[\e[37m\]'
COLOR_WHITE='\[\e[97m\]'
# Git PS1 settings:
GIT_PS1_SHOWDIRTYSTATE=1
# git mob
function __git_mob_initials {
[ ! -z "${_DISABLE_GIT_MOB_INITIALS}" ] && return 0;
[ -z "$(git config --global git-mob.co-author)" ] && return 0;
local initials=$(git mob-print --initials)
if [[ -n "${initials}" ]]; then
echo "[${initials}]"
fi
}
# Prompt
_SET_WINDOW_TITLE='\[\033]0;${PWD//[^[:ascii:]]/?}\007\]'
_TIME="${COLOR_GREEN}\t"
_PATH="${COLOR_YELLOW}\w"
_GIT_INFO="${COLOR_CYAN}\$(__git_ps1)"
_GIT_MOB="${COLOR_MAGENTA}\$(__git_mob_initials)"
_PROMPT="${COLOR_RESET}$ "
export PS1="${_SET_WINDOW_TITLE}\n${_TIME} ${_PATH}${_GIT_INFO} ${_GIT_MOB}\n${_PROMPT}"