-
Notifications
You must be signed in to change notification settings - Fork 0
/
starship.toml
188 lines (159 loc) · 6.51 KB
/
starship.toml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# DOCS https://starship.rs/config/
#───────────────────────────────────────────────────────────────────────────────
format = """[\
${custom.location_indicator}$directory${custom.folder_number}\
${custom.main_branch}$git_branch\
$git_status$git_metrics$git_commit$git_state\
$sudo $status\
](bg:black)\
$character\
"""
right_format = """\
$jobs\
$cmd_duration\
${custom.tokei_loc}\
${custom.alfred}\
${custom.venv_on}${custom.venv_off}\
$python$nodejs\
$time\
"""
add_newline = false
#───────────────────────────────────────────────────────────────────────────────
[character] # ▓▒░
success_symbol = "[ ](fg:black)"
error_symbol = "[ ](fg:red)"
vimcmd_symbol = "[ ](fg:cyan)"
[status] # exit code
disabled = false
format = "[ $status ]($style)"
style = "fg:bold 255 bg:red" # 255 as ansi enforces white regardless of terminal theme
[sudo]
disabled = false
style = 'fg:208 bg:black'
symbol = " "
format = "[ $symbol]($style)"
[directory]
truncation_length = 2
truncation_symbol = "/"
read_only = " "
read_only_style = "fg:red bg:black"
style = "fg:cyan bg:black bold"
format = "[$path]($style) [$read_only]($read_only_style)"
[directory.substitutions]
# General
"Library/Mobile Documents/com~apple~CloudDocs" = " "
"~/Desktop" = "/ "
"~" = "/ "
# my perma-repos
".config" = " "
"main-vault" = " "
"phd-data-analysis" = " "
"writing-vault" = " "
".password-store" = " "
[custom.folder_number]
when = "true" # always show
description = "Number of files (and folders) in the current working directory"
command = "find . -mindepth 1 -maxdepth 1 -not -name '.git' -not -name '.DS_Store' -not -name '.localized' -not -name 'Icon?' | wc -l"
symbol = " "
format = '[$symbol$output ]($style)'
style = "fg:yellow bg:black"
# Indicate if in a subfolder of my local repo folder. Helps differentiating
# between my local Alfred workflows and their respective repos.
[custom.location_indicator]
when = '[[ $PWD == $HOME/Developer/* ]]'
style = "fg:cyan bg:black bold"
command = 'echo ""'
format = '[ $output ]($style)'
#───────────────────────────────────────────────────────────────────────────────
# GIT
[git_state] # conflicts or rebasing
style = 'fg:yellow bold bg:black'
[git_commit] # checkout
style = "fg:purple bg:black bold"
only_detached = true
format = " [ $hash]($style)"
[git_branch] # branch
only_attached = true
style = "fg:purple bg:black bold"
format = " [ $branch]($style)"
ignore_branches = ["main"]
# since "ignore_branches" fully hides the git_branch component, still showing the symbol
[custom.main_branch]
when = "[[ $(git branch --show-current) == 'main' ]]"
format = '[ ](fg:purple bg:black bold)'
[git_status] # files
stashed = '[ $count](fg:cyan bg:black)'
untracked = '[ +$count](fg:green bg:black)'
deleted = '[ -$count](fg:red bg:black)' # these are unstaged as well as stage deletion
modified = '[ ~$count](fg:208 bg:black)' # 208 = orange
renamed = '[ $count](fg:blue bg:black)'
staged = '[ $count](fg:green bg:black)'
conflicted = '[ $count](fg:red bg:black)'
diverged = '[ $count](fg:red bg:black bold)'
ahead = '[ $count](fg:cyan bg:black)'
behind = '[ $count](fg:yellow bg:black)'
style = 'bg:black'
format = '[($ahead_behind$conflicted$stashed$staged$untracked$renamed$modified$deleted )]($style)'
# INFO putting a variable into round bracket ensures that the bracket content is
# only shown when the variable is set. `bright-black` is effectively gray.
[git_metrics] # changed lines
disabled = false
format = """\
([\\(](fg:bright-black bg:black)\
[(+$added)](fg:green bg:black)\
[/](fg:bright-black bg:black)\
[(-$deleted)](fg:red bg:black)\
[\\)](fg:bright-black bg:black))\
"""
#───────────────────────────────────────────────────────────────────────────────
# RIGHT SIDE
[jobs]
symbol = " "
format = "[+$number $symbol]($style)"
style = "fg:bold purple"
symbol_threshold = 1
number_threshold = 1
[custom.tokei_loc]
description = "Number of lines of code in the current project using tokei (for performance)."
command = "tokei --compact --exclude='*.txt' --exclude='*.json' | tail -n2 | awk 'NR==1 {print $3}'"
when = '[[ "$(dirname $PWD)" == "$HOME/Developer" ]]' # only in my local repos folder
format = ' [$output ]($style)'
style = "blue"
[cmd_duration]
min_time = 2500
format = "[ $duration](bold cyan)"
[time]
disabled = false
format = " [$time]($style)"
time_format = "%H:%M"
style = "fg:247" # grey
[custom.alfred]
description = "Version number of Alfred Workflow"
when = "[[ -f info.plist ]] || [[ -f ../info.plist ]]"
command = "if [[ -f ../info.plist ]] ; then ; plist=$(plutil -extract version xml1 -o - ../info.plist) ; else ; plist=$(plutil -extract version xml1 -o - info.plist) ; fi ; echo \"$plist\" | sed -n 4p | cut -d'>' -f2 | cut -d'<' -f1"
os = "macos"
format = ' [ $output]($style)'
style = "bold yellow"
[python]
format = ' [${symbol}${pyenv_prefix}($version)]($style)'
version_format = "$major.$minor"
symbol = " "
style = "bold yellow"
[custom.venv_on]
format = '[ $output ]($style)' # extra space for proper nerdfont sizing
when = '[[ -n "$VIRTUAL_ENV" ]]'
command = 'echo ""' # output is trimmed, so spaces must be added at `format`
style = "bold yellow"
[custom.venv_off]
format = '[ $output ]($style)'
when = '[[ -z "$VIRTUAL_ENV" ]] && [[ -d ".venv" ]]'
command = 'echo ""'
style = "bold red"
[nodejs]
style = "bold yellow"
format = ' [$symbol$version]($style)'
version_format = "$major.$minor"
# disabled detecting via extensions; detect only via `package.json` or
# `node_modules` to avoid false positives for stuff like Alfred workflows
detect_extensions = []
not_capable_style = "ft:white bg:red"