You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if [[ -z ${GIT_PROMPT_THEME_NAME} ]]; then GIT_PROMPT_THEME_NAME="Single_line"; fi
38
-
39
-
# These are the color definitions used by gitprompt.sh
40
-
if [[ -z ${GIT_PROMPT_PREFIX} ]]; then GIT_PROMPT_PREFIX="["; fi # start of the git info string
41
-
if [[ -z ${GIT_PROMPT_SUFFIX} ]]; then GIT_PROMPT_SUFFIX="]"; fi # the end of the git info string
42
-
if [[ -z ${GIT_PROMPT_SEPARATOR} ]]; then GIT_PROMPT_SEPARATOR="|"; fi # separates each item
43
-
44
-
if [[ -z ${GIT_PROMPT_BRANCH} ]]; then GIT_PROMPT_BRANCH="${Magenta}"; fi # the git branch that is active in the current directory
45
-
if [[ -z ${GIT_PROMPT_STAGED} ]]; then GIT_PROMPT_STAGED="${Red}●"; fi # the number of staged files/directories
46
-
if [[ -z ${GIT_PROMPT_CONFLICTS} ]]; then GIT_PROMPT_CONFLICTS="${Red}✖ "; fi # the number of files in conflict
47
-
if [[ -z ${GIT_PROMPT_CHANGED} ]]; then GIT_PROMPT_CHANGED="${Blue}✚ "; fi # the number of changed files
48
-
49
-
if [[ -z ${GIT_PROMPT_REMOTE} ]]; then GIT_PROMPT_REMOTE=" "; fi # the remote branch name (if any) and the symbols for ahead and behind
50
-
if [[ -z ${GIT_PROMPT_UNTRACKED} ]]; then GIT_PROMPT_UNTRACKED="${Cyan}…"; fi # the number of untracked files/dirs
51
-
if [[ -z ${GIT_PROMPT_STASHED} ]]; then GIT_PROMPT_STASHED="${BoldBlue}⚑ "; fi # the number of stashed files/dir
52
-
if [[ -z ${GIT_PROMPT_CLEAN} ]]; then GIT_PROMPT_CLEAN="${BoldGreen}✔"; fi # a colored flag indicating a "clean" repo
53
-
54
-
# For the command indicator, the placeholder _LAST_COMMAND_STATE_
55
-
# will be replaced with the exit code of the last command
56
-
# e.g.
57
-
# GIT_PROMPT_COMMAND_OK="${Green}✔-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of 0
58
-
# GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of other than 0
59
-
60
-
if [[ -z ${GIT_PROMPT_COMMAND_OK} ]]; then GIT_PROMPT_COMMAND_OK="${Green}✔"; fi # indicator if the last command returned with an exit code of 0
61
-
if [[ -z ${GIT_PROMPT_COMMAND_FAIL} ]]; then GIT_PROMPT_COMMAND_FAIL="${Red}✘"; fi # indicator if the last command returned with an exit code of other than 0
62
-
63
-
# Possible to change which command is used to create git status information
# 2) gitstatus_pre-1.7.10.sh (Uses a variety of git commands and pipes - slower, works with older git clients)
67
-
# 3) gitstatus.py (Unsupported, lack features found in the bash versions)
68
-
if [[ -z ${GIT_PROMPT_STATUS_COMMAND} ]]; then GIT_PROMPT_STATUS_COMMAND="gitstatus.sh"; fi # Point out the command to get the git status from
69
-
70
-
# template for displaying the current virtual environment
71
-
# use the placeholder _VIRTUALENV_ will be replaced with
72
-
# the name of the current virtual environment (currently CONDA and VIRTUAL_ENV)
73
-
if [[ -z ${GIT_PROMPT_VIRTUALENV} ]]; then GIT_PROMPT_VIRTUALENV="(${Blue}_VIRTUALENV_${ResetColor}) "; fi
74
-
75
-
# template for displaying the current remote tracking branch
76
-
# use the placeholder _UPSTREAM_ will be replaced with
77
-
# the name of the current remote tracking branch
78
-
if [[ -z ${GIT_PROMPT_UPSTREAM} ]]; then GIT_PROMPT_UPSTREAM=" {${Blue}_UPSTREAM_${ResetColor}}"; fi
79
-
80
-
# _LAST_COMMAND_INDICATOR_ will be replaced by the appropriate GIT_PROMPT_COMMAND_OK OR GIT_PROMPT_COMMAND_FAIL
81
-
if [[ -z ${GIT_PROMPT_START_USER} ]]; then GIT_PROMPT_START_USER="_LAST_COMMAND_INDICATOR_ ${White}${Time12a}${ResetColor} ${BoldYellow}${PathShort}${ResetColor}"; fi
82
-
if [[ -z ${GIT_PROMPT_START_ROOT} ]]; then GIT_PROMPT_START_ROOT="${GIT_PROMPT_START_USER}"; fi
83
-
if [[ -z ${GIT_PROMPT_END_USER} ]]; then GIT_PROMPT_END_USER="${ResetColor} $ "; fi
84
-
if [[ -z ${GIT_PROMPT_END_ROOT} ]]; then GIT_PROMPT_END_ROOT="${BoldRed} # "; fi
85
-
86
-
# Please do not add colors to these symbols
87
-
if [[ -z ${GIT_PROMPT_SYMBOLS_AHEAD} ]]; then GIT_PROMPT_SYMBOLS_AHEAD="↑·"; fi # The symbol for "n versions ahead of origin"
88
-
if [[ -z ${GIT_PROMPT_SYMBOLS_BEHIND} ]]; then GIT_PROMPT_SYMBOLS_BEHIND="↓·"; fi # The symbol for "n versions behind of origin"
89
-
if [[ -z ${GIT_PROMPT_SYMBOLS_PREHASH} ]]; then GIT_PROMPT_SYMBOLS_PREHASH=":"; fi # Written before hash of commit, if no name could be found
90
-
if [[ -z ${GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING} ]]; then GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING="L"; fi # This symbol is written after the branch, if the branch is not tracked
91
-
}
92
-
93
-
# call only from theme file
94
-
reload_git_prompt_colors() {
95
-
if [[ "${GIT_PROMPT_THEME_NAME}" != $1 ]]; then
96
-
unset_git_prompt_colors
97
-
define_helpers
98
-
override_git_prompt_colors
99
-
define_undefined_git_prompt_colors
100
-
fi
101
-
}
10
+
reload_git_prompt_colors "Single_line"
102
11
103
-
if [[ "${GIT_PROMPT_THEME}" == "Single_line" && "${GIT_PROMPT_THEME_NAME}" != "Single_line" ]]; then
Copy file name to clipboardExpand all lines: themes/Single_line_Solarized.bgptheme
+17-97
Original file line number
Diff line number
Diff line change
@@ -4,111 +4,31 @@
4
4
# without the indicator of the last command state
5
5
# tweaked for Ubuntu terminal fonts
6
6
7
-
unset_git_prompt_colors() {
8
-
unset Time12a
9
-
unset PathShort
10
-
unset GIT_PROMPT_PREFIX
11
-
unset GIT_PROMPT_SUFFIX
12
-
unset GIT_PROMPT_SEPARATOR
13
-
unset GIT_PROMPT_BRANCH
14
-
unset GIT_PROMPT_STAGED
15
-
unset GIT_PROMPT_CONFLICTS
16
-
unset GIT_PROMPT_CHANGED
17
-
unset GIT_PROMPT_REMOTE
18
-
unset GIT_PROMPT_UNTRACKED
19
-
unset GIT_PROMPT_STASHED
20
-
unset GIT_PROMPT_CLEAN
21
-
unset GIT_PROMPT_COMMAND_OK
22
-
unset GIT_PROMPT_COMMAND_FAIL
23
-
unset GIT_PROMPT_VIRTUALENV
24
-
unset GIT_PROMPT_UPSTREAM
25
-
unset GIT_PROMPT_START_USER
26
-
unset GIT_PROMPT_START_ROOT
27
-
unset GIT_PROMPT_END_USER
28
-
unset GIT_PROMPT_END_ROOT
29
-
unset GIT_PROMPT_SYMBOLS_AHEAD
30
-
unset GIT_PROMPT_SYMBOLS_BEHIND
31
-
unset GIT_PROMPT_SYMBOLS_PREHASH
32
-
unset GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING
33
-
}
34
-
35
7
define_helpers() {
36
8
PathShort="${BoldBlue}\u:${Cyan}\W"
37
9
}
38
10
39
-
define_undefined_git_prompt_colors() {
40
-
if [[ -z ${GIT_PROMPT_THEME_NAME} ]]; then GIT_PROMPT_THEME_NAME="Single_line_Solarized"; fi
41
-
42
-
# These are the color definitions used by gitprompt.sh
43
-
if [[ -z ${GIT_PROMPT_PREFIX} ]]; then GIT_PROMPT_PREFIX="[ "; fi # start of the git info string
44
-
if [[ -z ${GIT_PROMPT_SUFFIX} ]]; then GIT_PROMPT_SUFFIX=" ]"; fi # the end of the git info string
45
-
if [[ -z ${GIT_PROMPT_SEPARATOR} ]]; then GIT_PROMPT_SEPARATOR=" |"; fi # separates each item
46
-
47
-
if [[ -z ${GIT_PROMPT_BRANCH} ]]; then GIT_PROMPT_BRANCH="${Magenta}"; fi # the git branch that is active in the current directory
48
-
if [[ -z ${GIT_PROMPT_STAGED} ]]; then GIT_PROMPT_STAGED=" ${Yellow}●${ResetColor}"; fi # the number of staged files/directories
49
-
if [[ -z ${GIT_PROMPT_CONFLICTS} ]]; then GIT_PROMPT_CONFLICTS=" ${Red}✖ ${ResetColor}"; fi # the number of files in conflict
50
-
if [[ -z ${GIT_PROMPT_CHANGED} ]]; then GIT_PROMPT_CHANGED=" ${Blue}✚ ${ResetColor}"; fi # the number of changed files
51
-
52
-
if [[ -z ${GIT_PROMPT_REMOTE} ]]; then GIT_PROMPT_REMOTE=" "; fi # the remote branch name (if any) and the symbols for ahead and behind
53
-
if [[ -z ${GIT_PROMPT_UNTRACKED} ]]; then GIT_PROMPT_UNTRACKED=" ${Cyan}…${ResetColor}"; fi # the number of untracked files/dirs
54
-
if [[ -z ${GIT_PROMPT_STASHED} ]]; then GIT_PROMPT_STASHED=" ${BoldMagenta}⚑ ${ResetColor}"; fi # the number of stashed files/dir
55
-
if [[ -z ${GIT_PROMPT_CLEAN} ]]; then GIT_PROMPT_CLEAN=" ${Green}✔ ${ResetColor}"; fi # a colored flag indicating a "clean" repo
56
-
57
-
# For the command indicator, the placeholder _LAST_COMMAND_STATE_
58
-
# will be replaced with the exit code of the last command
59
-
# e.g.
60
-
# GIT_PROMPT_COMMAND_OK="${Green}✔-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of 0
61
-
# GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of other than 0
62
-
63
-
if [[ -z ${GIT_PROMPT_COMMAND_OK} ]]; then GIT_PROMPT_COMMAND_OK="${Green}✔"; fi # indicator if the last command returned with an exit code of 0
64
-
if [[ -z ${GIT_PROMPT_COMMAND_FAIL} ]]; then GIT_PROMPT_COMMAND_FAIL="${Red}✘"; fi # indicator if the last command returned with an exit code of other than 0
11
+
override_git_prompt_colors() {
12
+
GIT_PROMPT_THEME_NAME="Single_line_Solarized"
65
13
66
-
# Possible to change which command is used to create git status information
if [[ -z ${GIT_PROMPT_START_ROOT} ]]; then GIT_PROMPT_START_ROOT="${GIT_PROMPT_START_USER}"; fi
87
-
if [[ -z ${GIT_PROMPT_END_USER} ]]; then GIT_PROMPT_END_USER="${BoldBlue} ➭ ${ResetColor}"; fi # Reset color for user
88
-
if [[ -z ${GIT_PROMPT_END_ROOT} ]]; then GIT_PROMPT_END_ROOT="${BoldRed} # "; fi # Bright red for Root
89
-
90
-
# Please do not add colors to these symbols
91
-
if [[ -z ${GIT_PROMPT_SYMBOLS_AHEAD} ]]; then GIT_PROMPT_SYMBOLS_AHEAD="↑·"; fi # The symbol for "n versions ahead of origin"
92
-
if [[ -z ${GIT_PROMPT_SYMBOLS_BEHIND} ]]; then GIT_PROMPT_SYMBOLS_BEHIND="↓·"; fi # The symbol for "n versions behind of origin"
93
-
if [[ -z ${GIT_PROMPT_SYMBOLS_PREHASH} ]]; then GIT_PROMPT_SYMBOLS_PREHASH=":"; fi # Written before hash of commit, if no name could be found
94
-
if [[ -z ${GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING} ]]; then GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING="✭"; fi # This symbol is written after the branch, if the branch is not tracked
95
-
}
96
-
97
-
# call only from theme file
98
-
reload_git_prompt_colors() {
99
-
if [[ "${GIT_PROMPT_THEME_NAME}" != $1 ]]; then
100
-
unset_git_prompt_colors
101
-
define_helpers
102
-
override_git_prompt_colors
103
-
define_undefined_git_prompt_colors
104
-
fi
31
+
GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING="✭"
105
32
}
106
33
107
-
if [[ "${GIT_PROMPT_THEME}" == "Single_line_Solarized" && "${GIT_PROMPT_THEME_NAME}" != "Single_line_Solarized" ]]; then
0 commit comments