Skip to content

Instantly share code, notes, and snippets.

@aurelienroux
Last active October 23, 2023 23:27
Show Gist options
  • Save aurelienroux/86be61e17e7e2bb86fdb79b8e2ee893f to your computer and use it in GitHub Desktop.
Save aurelienroux/86be61e17e7e2bb86fdb79b8e2ee893f to your computer and use it in GitHub Desktop.
Robby Russel with Node & Git
function node_prompt_version {
if which node &> /dev/null; then
echo "%{$fg_bold[green]%}node:(%{$fg[red]%}$(node -v)%{$fg[green]%})%{$reset_color%}"
fi
}
PROMPT="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT+=' %{$fg[cyan]%}%c%{$reset_color%} $(node_prompt_version) $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment