mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-04-24 04:29:25 +02:00
Agnoster: add current node version if .nvmrc is present
Useful with nvm autoswitcher upon directory change (as described in nvm package)
This commit is contained in:
parent
7fabc8bca4
commit
d4064cdc66
1 changed files with 8 additions and 0 deletions
|
|
@ -167,6 +167,13 @@ prompt_dir() {
|
|||
prompt_segment blue black '%~'
|
||||
}
|
||||
|
||||
# Nvm: current node version if nvmrc is present.
|
||||
prompt_nvm() {
|
||||
if [[ -f .nvmrc && -r .nvmrc ]]; then
|
||||
prompt_segment black green "⬡ $(nvm_prompt_info)"
|
||||
fi
|
||||
}
|
||||
|
||||
# Virtualenv: current working virtualenv
|
||||
prompt_virtualenv() {
|
||||
local virtualenv_path="$VIRTUAL_ENV"
|
||||
|
|
@ -194,6 +201,7 @@ build_prompt() {
|
|||
RETVAL=$?
|
||||
prompt_status
|
||||
prompt_virtualenv
|
||||
prompt_nvm
|
||||
prompt_context
|
||||
prompt_dir
|
||||
prompt_git
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue