aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorLucas Burns <burnsac@me.com>2022-02-27 05:27:19 +0300
committerLucas Burns <burnsac@me.com>2022-02-27 05:27:19 +0300
commitb898d1de150c1dd26da2d0b0376ae7b517b9665f (patch)
tree4e7bf369890c81c73632c1577c4dfd1f302be410 /internal/p10k.zsh
parent123136c0e7566a2a12385f3836e3e92df6b42be1 (diff)
feature: added perlbrew
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh20
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index cc36eb0d..9f5b4de9 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -3116,6 +3116,26 @@ _p9k_prompt_plenv_init() {
}
################################################################
+# Segment to display perlbrew information
+# https://github.com/gugod/App-perlbrew
+
+prompt_perlbrew() {
+ [[ -n $PERLBREW_PERL && ( -v commands[perlbrew] || -v functions[perlbrew] ) ]] || return
+ if (( _POWERLEVEL9K_PERLBREW_PROJECT_ONLY )); then
+ _p9k_upglob 'cpanfile|(MY|)META.(yml|json)|.perltidyrc|(Makefile|Build).PL|*.(pl|pm|t|pod)' && return
+ fi
+
+ local v=$PERLBREW_PERL
+ (( _POWERLEVEL9K_PERLBREW_SHOW_PREFIX )) || v=${v#*-}
+ [[ -n $v ]] || return
+ _p9k_prompt_segment "$0" "blue" "$_p9k_color1" 'PERL_ICON' 0 '' "${v//\%/%%}"
+}
+
+_p9k_prompt_perlbrew_init() {
+ typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${commands[perlbrew]:-${${+functions[perlbrew]}:#0}}'
+}
+
+################################################################
# Segment to display chruby information
# see https://github.com/postmodern/chruby/issues/245 for chruby_auto issue with ZSH
prompt_chruby() {