Skip to content

Commit

Permalink
feat(zsh): prompt node version
Browse files Browse the repository at this point in the history
  • Loading branch information
brunomacedo committed Jun 19, 2023
1 parent 5be11c5 commit d48d67a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .oh-my-zsh/eiskaffee.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ zstyle ':vcs_info:*' stagedstr "${FMT_STAGED}"
zstyle ':vcs_info:*' actionformats "${FMT_VCS_STATUS} ${FMT_ACTION}"
zstyle ':vcs_info:*' formats "${FMT_VCS_STATUS}"
zstyle ':vcs_info:*' nvcsformats ""
zstyle ':vcs_info:git*+set-message:*' hooks git-untracked
zstyle ':vcs_info:git*+set-message:*' hooks git-untracked node-version

# Check for untracked files.
+vi-git-untracked() {
Expand All @@ -63,8 +63,15 @@ zstyle ':vcs_info:git*+set-message:*' hooks git-untracked
fi
}

# Show nodejs version
+vi-node-version() {
if which node &> /dev/null; then
hook_com[staged]+=" %{$fg_reset_color%}($(node -v))"
fi
}

# Executed before each prompt.
add-zsh-hook precmd vcs_info

# Oxide prompt style.
# Prompt style.
PROMPT=$'\n%{$fg_green%}%~%{$fg_reset_color%} ${vcs_info_msg_0_}\n%(?.%{%F{white}%}.%{$fg_red%})%(!.#.$)%{$fg_reset_color%} '

0 comments on commit d48d67a

Please sign in to comment.