mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-04-17 04:29:14 +02:00
Adds node version to prompt
This commit is contained in:
parent
ee343814b7
commit
54e867e392
1 changed files with 12 additions and 2 deletions
|
|
@ -118,7 +118,7 @@ prompt_git() {
|
|||
zstyle ':vcs_info:*' get-revision true
|
||||
zstyle ':vcs_info:*' check-for-changes true
|
||||
zstyle ':vcs_info:*' stagedstr '✚'
|
||||
zstyle ':vcs_info:*' unstagedstr '●'
|
||||
zstyle ':vcs_info:git:*' unstagedstr '●'
|
||||
zstyle ':vcs_info:*' formats ' %u%c'
|
||||
zstyle ':vcs_info:*' actionformats ' %u%c'
|
||||
vcs_info
|
||||
|
|
@ -188,6 +188,15 @@ prompt_status() {
|
|||
[[ -n "$symbols" ]] && prompt_segment black default "$symbols"
|
||||
}
|
||||
|
||||
# Node version
|
||||
prompt_nvm() {
|
||||
local nvm_node=''
|
||||
if which node &> /dev/null; then
|
||||
nvm_node="$(node -v)"
|
||||
fi
|
||||
prompt_segment green black "$nvm_node"
|
||||
}
|
||||
|
||||
## Main prompt
|
||||
build_prompt() {
|
||||
RETVAL=$?
|
||||
|
|
@ -195,6 +204,7 @@ build_prompt() {
|
|||
prompt_virtualenv
|
||||
prompt_context
|
||||
prompt_dir
|
||||
prompt_nvm
|
||||
prompt_git
|
||||
prompt_hg
|
||||
prompt_end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue