From d48d67affbeef65940878527ad272de22ee93747 Mon Sep 17 00:00:00 2001 From: brunomacedo Date: Mon, 19 Jun 2023 11:08:23 -0300 Subject: [PATCH] feat(zsh): prompt node version --- .oh-my-zsh/eiskaffee.zsh-theme | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.oh-my-zsh/eiskaffee.zsh-theme b/.oh-my-zsh/eiskaffee.zsh-theme index 928bf48..e61b1c1 100644 --- a/.oh-my-zsh/eiskaffee.zsh-theme +++ b/.oh-my-zsh/eiskaffee.zsh-theme @@ -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() { @@ -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%} '