@@ -127,7 +127,7 @@ function prompt_garrett_precmd_notification
127
127
128
128
#
129
129
# PROMPT | prompt_garrett_chpwd
130
- # - a function which is executed whenever the directory is changed
130
+ # - a function which is executed whenever the directory is changed
131
131
#
132
132
133
133
function prompt_garrett_chpwd
@@ -136,7 +136,7 @@ function prompt_garrett_chpwd
136
136
if is-callable ' dircolors' ;
137
137
then # GNU flavor ls
138
138
if zstyle -t ' :prezto:module:utility:ls' color
139
- then
139
+ then
140
140
ls --group-directories-first --color=auto
141
141
else
142
142
ls -F
@@ -173,29 +173,29 @@ function prompt_garrett_preexec
173
173
174
174
function prompt_garrett_precmd
175
175
{
176
- setopt LOCAL_OPTIONS
177
- unsetopt XTRACE KSH_ARRAYS
176
+ setopt LOCAL_OPTIONS
177
+ unsetopt XTRACE KSH_ARRAYS
178
178
179
179
# Show number of background jobs
180
180
prompt_garrett_number_jobs=" %(1j.${prompt_garrett_color_prompt} J:${cyan} %j .)"
181
181
182
182
# Format PWD
183
- prompt_garrett_pwd
183
+ prompt_garrett_pwd
184
184
185
185
# Trigger a notification after x time has elapsed
186
186
eval prompt_garrett_precmd_notification
187
187
188
188
# Get ruby info
189
189
if (( $+ functions[ruby- info] ))
190
190
then
191
- ruby-info
192
- fi
191
+ ruby-info
192
+ fi
193
193
194
194
# Get git repository info
195
- if (( $+ functions[git- info] ))
195
+ if (( $+ functions[git- info] ))
196
196
then
197
- git-info
198
- fi
197
+ git-info
198
+ fi
199
199
200
200
#
201
201
# Add a line to prompt for visibility
@@ -226,20 +226,20 @@ function prompt_garrett_precmd
226
226
227
227
#
228
228
# PROMPT | prompt_garrett_setup
229
- # - finally, configure the prompt
229
+ # - finally, configure the prompt
230
230
#
231
231
232
232
function prompt_garrett_setup
233
233
{
234
234
# Load necessary modules
235
- setopt LOCAL_OPTIONS
236
- unsetopt XTRACE KSH_ARRAYS
237
- prompt_opts=(cr percent subst)
235
+ setopt LOCAL_OPTIONS
236
+ unsetopt XTRACE KSH_ARRAYS
237
+ prompt_opts=(cr percent subst)
238
238
239
- # Add hooks for calling preexec, precmd & chpwd
239
+ # Add hooks for calling preexec, precmd & chpwd
240
240
autoload -Uz add-zsh-hook
241
241
add-zsh-hook preexec prompt_garrett_preexec
242
- add-zsh-hook precmd prompt_garrett_precmd
242
+ add-zsh-hook precmd prompt_garrett_precmd
243
243
add-zsh-hook chpwd prompt_garrett_chpwd
244
244
245
245
#
@@ -271,32 +271,32 @@ function prompt_garrett_setup
271
271
# set colors
272
272
eval prompt_garrett_color_user=${3:- ' ${red}' }
273
273
eval prompt_garrett_color_host=${3:- ' ${red}' }
274
- eval prompt_garrett_color_prompt=${3:- ' ${red}' }
274
+ eval prompt_garrett_color_prompt=${3:- ' ${red}' }
275
275
276
276
# set style
277
- eval prompt_garrett_user=' %S${prompt_garrett_color_user}%n%s'
277
+ eval prompt_garrett_user=' %S${prompt_garrett_color_user}%n%s'
278
278
eval prompt_garrett_host=' ${prompt_garrett_color_host}%m' # hostname up to first . (dot) (use %M for full hostname)
279
279
eval prompt_garrett_location=
' ${prompt_garrett_user}${cyan}@${prompt_garrett_host}' # [email protected]
280
280
281
281
elif [[ -n " $SSH_CLIENT " || -n " $SSH2_CLIENT " ]]
282
282
then # on SSH
283
283
284
284
# set colors
285
- eval prompt_garrett_color_user=${3:- ' ${green}' }
286
- eval prompt_garrett_color_host=${3:- ' ${yellow}' }
287
- eval prompt_garrett_color_prompt=${3:- ' ${yellow}' }
285
+ eval prompt_garrett_color_user=${3:- ' ${green}' }
286
+ eval prompt_garrett_color_host=${3:- ' ${yellow}' }
287
+ eval prompt_garrett_color_prompt=${3:- ' ${yellow}' }
288
288
289
289
# set style
290
- eval prompt_garrett_user=' %S${prompt_garrett_color_user}%n%s'
290
+ eval prompt_garrett_user=' %S${prompt_garrett_color_user}%n%s'
291
291
eval prompt_garrett_host=' ${prompt_garrett_color_host}%m' # hostname up to first . (dot) (use %M for full hostname)
292
292
eval prompt_garrett_location=
' ${prompt_garrett_user}${cyan}@${prompt_garrett_host}' # [email protected]
293
293
294
294
else # normal user
295
295
296
296
# set colors
297
297
eval prompt_garrett_color_user=${1:- ' ${green}' }
298
- eval prompt_garrett_color_host=${1:- ' ${green}' }
299
- eval prompt_garrett_color_prompt=${1:- ' ${grey}' }
298
+ eval prompt_garrett_color_host=${1:- ' ${green}' }
299
+ eval prompt_garrett_color_prompt=${1:- ' ${grey}' }
300
300
301
301
# set style
302
302
eval prompt_garrett_user=' '
@@ -353,29 +353,29 @@ function prompt_garrett_setup
353
353
# zstyle ':prezto:module:git:info' verbose 'yes'
354
354
355
355
# Git prompt info
356
- zstyle ' :prezto:module:git:info:branch' format " ${cyan} λ${prompt_garrett_color_prompt} :${green} %b"
357
- zstyle ' :prezto:module:git:info:remote' format " "
358
- zstyle ' :prezto:module:git:info:action' format " ${yellow} %s"
359
- zstyle ' :prezto:module:git:info:position' format " ${red} %p"
356
+ zstyle ' :prezto:module:git:info:branch' format " ${cyan} λ${prompt_garrett_color_prompt} :${green} %b"
357
+ zstyle ' :prezto:module:git:info:remote' format " "
358
+ zstyle ' :prezto:module:git:info:action' format " ${yellow} %s"
359
+ zstyle ' :prezto:module:git:info:position' format " ${red} %p"
360
360
361
361
# Git commit SHA
362
- zstyle ' :prezto:module:git:info:commit' format " ${yellow} %.7c"
362
+ zstyle ' :prezto:module:git:info:commit' format " ${yellow} %.7c"
363
363
364
364
# Git remote status
365
- zstyle ' :prezto:module:git:info:behind' format " ${magenta} ⬇ "
366
- zstyle ' :prezto:module:git:info:ahead' format " ${magenta} ⬆ "
365
+ zstyle ' :prezto:module:git:info:behind' format " ${magenta} ⬇ "
366
+ zstyle ' :prezto:module:git:info:ahead' format " ${magenta} ⬆ "
367
367
zstyle ' :prezto:module:git:info:diverged' format " ${magenta} ⥮"
368
- zstyle ' :prezto:module:git:info:stashed' format " ${cyan} ✭"
368
+ zstyle ' :prezto:module:git:info:stashed' format " ${cyan} ✭"
369
369
370
370
# Git local status
371
- zstyle ' :prezto:module:git:info:clean' format " "
372
- zstyle ' :prezto:module:git:info:dirty' format " ${prompt_garrett_color_prompt} |"
373
- zstyle ' :prezto:module:git:info:added' format " ${green} ✚"
374
- zstyle ' :prezto:module:git:info:deleted' format " ${red} ✗"
375
- zstyle ' :prezto:module:git:info:modified' format " ${blue} ✱"
376
- zstyle ' :prezto:module:git:info:renamed' format " ${magenta} ➜"
377
- zstyle ' :prezto:module:git:info:unmerged' format " ${yellow} ═"
378
- zstyle ' :prezto:module:git:info:untracked' format " ${white} ◼"
371
+ zstyle ' :prezto:module:git:info:clean' format " "
372
+ zstyle ' :prezto:module:git:info:dirty' format " ${prompt_garrett_color_prompt} |"
373
+ zstyle ' :prezto:module:git:info:added' format " ${green} ✚"
374
+ zstyle ' :prezto:module:git:info:deleted' format " ${red} ✗"
375
+ zstyle ' :prezto:module:git:info:modified' format " ${blue} ✱"
376
+ zstyle ' :prezto:module:git:info:renamed' format " ${magenta} ➜"
377
+ zstyle ' :prezto:module:git:info:unmerged' format " ${yellow} ═"
378
+ zstyle ' :prezto:module:git:info:untracked' format " ${white} ◼"
379
379
380
380
# Git prompt styles
381
381
zstyle ' :prezto:module:git:info:keys' format \
@@ -390,7 +390,7 @@ function prompt_garrett_setup
390
390
# %v | ruby version
391
391
#
392
392
393
- zstyle ' :prezto:module:ruby:info:version' format " ${yellow} ruby:%v "
393
+ zstyle ' :prezto:module:ruby:info:version' format " ${yellow} ruby:%v "
394
394
395
395
#
396
396
# Vim mode indicator
@@ -399,23 +399,23 @@ function prompt_garrett_setup
399
399
zstyle ' :prezto:module:editor:info:keymap:primary' format " ${red} ❱%(?.${prompt_garrett_color_prompt} .${red} )❱❱ "
400
400
zstyle ' :prezto:module:editor:info:keymap:alternate' format " ${red} ❰%(?.${prompt_garrett_color_prompt} .${red} )❰❰ "
401
401
# zstyle ':prezto:module:editor:info:keymap:primary:insert' format "${red}I "
402
- zstyle ' :prezto:module:editor:info:keymap:primary:overwrite' format " ${red} ♺ "
403
- zstyle ' :prezto:module:editor:info:completing' format " ${red} ..."
402
+ zstyle ' :prezto:module:editor:info:keymap:primary:overwrite' format " ${red} ♺ "
403
+ zstyle ' :prezto:module:editor:info:completing' format " ${red} ..."
404
404
405
405
#
406
- # Use the extended character set, if available
406
+ # Use the extended character set, if available
407
407
#
408
408
409
- typeset -A altchar
410
- set -A altchar ${(s..)terminfo[acsc]}
411
- prompt_garrett_altchar_enable=" %{$terminfo [enacs]%}"
412
- prompt_garrett_altchar_enter=" %{$terminfo [smacs]%}"
413
- prompt_garrett_altchar_leave=" %{$terminfo [rmacs]%}"
414
- prompt_garrett_altchar_padding=${altchar[q]:- -}
415
- prompt_garrett_upper_left_corner=${prompt_garrett_altchar_enter}${altchar[l]:- -}${altchar[q]:- -}${prompt_garrett_altchar_leave}
416
- prompt_garrett_lower_left_corner=${prompt_garrett_altchar_enter}${altchar[m]:- -}${altchar[q]:- -}${prompt_garrett_altchar_leave}
417
- prompt_garrett_upper_right_corner=${prompt_garrett_altchar_enter}${altchar[q]:- -}${altchar[k]:- -}${prompt_garrett_altchar_leave}
418
- prompt_garrett_lower_right_corner=${prompt_garrett_altchar_enter}${altchar[q]:- -}${altchar[j]:- -}${prompt_garrett_altchar_leave}
409
+ typeset -A altchar
410
+ set -A altchar ${(s..)terminfo[acsc]}
411
+ prompt_garrett_altchar_enable=" %{$terminfo [enacs]%}"
412
+ prompt_garrett_altchar_enter=" %{$terminfo [smacs]%}"
413
+ prompt_garrett_altchar_leave=" %{$terminfo [rmacs]%}"
414
+ prompt_garrett_altchar_padding=${altchar[q]:- -}
415
+ prompt_garrett_upper_left_corner=${prompt_garrett_altchar_enter}${altchar[l]:- -}${altchar[q]:- -}${prompt_garrett_altchar_leave}
416
+ prompt_garrett_lower_left_corner=${prompt_garrett_altchar_enter}${altchar[m]:- -}${altchar[q]:- -}${prompt_garrett_altchar_leave}
417
+ prompt_garrett_upper_right_corner=${prompt_garrett_altchar_enter}${altchar[q]:- -}${altchar[k]:- -}${prompt_garrett_altchar_leave}
418
+ prompt_garrett_lower_right_corner=${prompt_garrett_altchar_enter}${altchar[q]:- -}${altchar[j]:- -}${prompt_garrett_altchar_leave}
419
419
420
420
#
421
421
# Finally!
0 commit comments