Skip to content

Instantly share code, notes, and snippets.

View gangelo's full-sized avatar
:octocat:
Got codez?

Gene M. Angelo, Jr. gangelo

:octocat:
Got codez?
View GitHub Profile
@gangelo
gangelo / auto-set-node-version.sh
Created October 10, 2025 18:49
Auto set node version - add to ~/.zshrc
# Goes in .zshrc
# Automatically switch Node version when entering a directory with .nvmrc
autoload -U add-zsh-hook
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
# This should be cloned to your .oh-my-zsh/custom/themes folder.
ARROW=%{$fg_bold[red]%}>$reset_color
RETURN=%{$fg[red]%}⮐$reset_color
PROMPT=$'\
$ARROW%{$fg_bold[yellow]%}%D{%a %b %d, %Y %-I:%M:%S %p}%{$reset_color%}\
$ARROW%{$fg_bold[cyan]%}%~%{$reset_color%}$(git_prompt_info)%{$reset_color%}\
\
%n@%m $ARROW%{$reset_color%}'