1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-21 20:00:07 +00:00

nvm: implement POWERLEVEL9K_NVM_SHOW_SYSTEM and default to true

This commit is contained in:
Zaidhaan Hussain 2023-05-06 15:52:08 +08:00 committed by Roman Perepelitsa
parent 0af598cbed
commit 5d16c106ed
5 changed files with 12 additions and 0 deletions

View file

@ -1007,6 +1007,8 @@
##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]###############
# Nvm color. # Nvm color.
typeset -g POWERLEVEL9K_NVM_FOREGROUND=70 typeset -g POWERLEVEL9K_NVM_FOREGROUND=70
# If set to false, hide node version if it's equal to "system".
typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true
# Custom icon. # Custom icon.
# typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐'

View file

@ -988,6 +988,8 @@
##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]###############
# Nvm color. # Nvm color.
typeset -g POWERLEVEL9K_NVM_FOREGROUND=2 typeset -g POWERLEVEL9K_NVM_FOREGROUND=2
# If set to false, hide node version if it's equal to "system".
typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true
# Custom icon. # Custom icon.
# typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐'

View file

@ -984,6 +984,8 @@
##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]###############
# Nvm color. # Nvm color.
typeset -g POWERLEVEL9K_NVM_FOREGROUND=70 typeset -g POWERLEVEL9K_NVM_FOREGROUND=70
# If set to false, hide node version if it's equal to "system".
typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true
# Custom icon. # Custom icon.
# typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐'

View file

@ -1053,6 +1053,8 @@
# Nvm color. # Nvm color.
typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 typeset -g POWERLEVEL9K_NVM_FOREGROUND=0
typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 typeset -g POWERLEVEL9K_NVM_BACKGROUND=5
# If set to false, hide node version if it's equal to "system".
typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true
# Custom icon. # Custom icon.
# typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐'

View file

@ -2568,6 +2568,9 @@ prompt_nvm() {
[[ -n $NVM_DIR ]] && _p9k_nvm_ls_current || return [[ -n $NVM_DIR ]] && _p9k_nvm_ls_current || return
local current=$_p9k__ret local current=$_p9k__ret
! _p9k_nvm_ls_default || [[ $_p9k__ret != $current ]] || return ! _p9k_nvm_ls_default || [[ $_p9k__ret != $current ]] || return
if (( !_POWERLEVEL9K_NVM_SHOW_SYSTEM )); then
[[ $current == system ]] && return
fi
_p9k_prompt_segment "$0" "magenta" "black" 'NODE_ICON' 0 '' "${${current#v}//\%/%%}" _p9k_prompt_segment "$0" "magenta" "black" 'NODE_ICON' 0 '' "${${current#v}//\%/%%}"
} }
@ -7530,6 +7533,7 @@ _p9k_init_params() {
_p9k_declare -b POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -b POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW 0
_p9k_declare -a POWERLEVEL9K_NODENV_SOURCES -- shell local global _p9k_declare -a POWERLEVEL9K_NODENV_SOURCES -- shell local global
_p9k_declare -b POWERLEVEL9K_NODENV_SHOW_SYSTEM 1 _p9k_declare -b POWERLEVEL9K_NODENV_SHOW_SYSTEM 1
_p9k_declare -b POWERLEVEL9K_NVM_SHOW_SYSTEM 1
_p9k_declare -b POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -b POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW 0
_p9k_declare -a POWERLEVEL9K_RBENV_SOURCES -- shell local global _p9k_declare -a POWERLEVEL9K_RBENV_SOURCES -- shell local global
_p9k_declare -b POWERLEVEL9K_RBENV_SHOW_SYSTEM 1 _p9k_declare -b POWERLEVEL9K_RBENV_SHOW_SYSTEM 1