forked from APraxx/bash-git-prompt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit-prompt-colors.sh
50 lines (40 loc) · 2.44 KB
/
git-prompt-colors.sh
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
42
43
44
45
46
47
48
49
50
# These are the color definitions used by gitprompt.sh
define_git_prompt_colors() {
local LCyan="\[\033[0;96m\]"
local White='\[\033[00m\]'
local BoldGreen="\[\033[1;32m\]" # Green
local BoldBlue="\[\033[1;34m\]" # Blue
local Yellow="\[\033[0;33m\]"
Time12a="\$(date +%H:%M)"
PathShort="\w"
# These are the color definitions used by gitprompt.sh
GIT_PROMPT_PREFIX="[" # start of the git info string
GIT_PROMPT_SUFFIX="]" # the end of the git info string
GIT_PROMPT_SEPARATOR="|" # separates each item
GIT_PROMPT_BRANCH="${LCyan}" # the git branch that is active in the current directory
GIT_PROMPT_STAGED="${Red}●" # the number of staged files/directories
GIT_PROMPT_CONFLICTS="${Red}✖ " # the number of files in conflict
GIT_PROMPT_CHANGED="${Blue}✚ " # the number of changed files
GIT_PROMPT_REMOTE=" " # the remote branch name (if any) and the symbols for ahead and behind
GIT_PROMPT_UNTRACKED="${Magenta}…" # the number of untracked files/dirs
GIT_PROMPT_STASHED="${BoldBlue}⚑ " # the number of stashed files/dir
GIT_PROMPT_CLEAN="${BoldGreen}✔" # a colored flag indicating a "clean" repo
# For the command indicator, the placeholder _LAST_COMMAND_STATE_
# will be replaced with the exit code of the last command
# e.g.
# GIT_PROMPT_COMMAND_OK="${Green}✔-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of 0
# GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of other than 0
GIT_PROMPT_COMMAND_OK="${Green}✔ " # indicator if the last command returned with an exit code of 0
GIT_PROMPT_COMMAND_FAIL="${Red}✘ " # indicator if the last command returned with an exit code of other than 0
GIT_PROMPT_START_USER="${White}${PathShort}${ResetColor}"
GIT_PROMPT_START_ROOT="${Yellow}${PathShort}${ResetColor}"
GIT_PROMPT_END_USER="$ "
GIT_PROMPT_END_ROOT="# "
# Please do not add colors to these symbols
GIT_PROMPT_SYMBOLS_AHEAD="↑·" # The symbol for "n versions ahead of origin"
GIT_PROMPT_SYMBOLS_BEHIND="↓·" # The symbol for "n versions behind of origin"
GIT_PROMPT_SYMBOLS_PREHASH=":" # Written before hash of commit, if no name could be found
}
if [[ -z "$GIT_PROMPT_SEPARATOR" || -z "$GIT_PROMPT_COMMAND_OK" ]]; then
define_git_prompt_colors
fi