Skip to content

Instantly share code, notes, and snippets.

@theoperatore
Last active August 26, 2023 18:53
Show Gist options
  • Save theoperatore/d685b401e01629dded816bd2af45682e to your computer and use it in GitHub Desktop.
Save theoperatore/d685b401e01629dded816bd2af45682e to your computer and use it in GitHub Desktop.
bash_profile, zshrc, and some tips for starting a new computer and installing a good env
export GITAWAREPROMPT=~/.bash/git-aware-prompt
source "${GITAWAREPROMPT}/main.sh"
PS1='\[\033[01;35m\]\u\[\033[01;33m\]:\[\033[01;34m\]\W\[\033[00;31m\]:$git_branch \[\033[00m\]> '
parse_git_branch() {
local ref=$(git symbolic-ref --short HEAD 2> /dev/null)
if [ -n "${ref}" ]; then
if [ -n "$(git status --porcelain)" ]; then
local gitstatuscolor='%F{red}'
else
local gitstatuscolor='%F{green}'
fi
echo "${gitstatuscolor} (${ref})"
else
echo ""
fi
}
setopt PROMPT_SUBST
PROMPT='%F{magenta}%n%F{none}@%F{blue}%~$(parse_git_branch) %F{none}$ '
@theoperatore
Copy link
Author

Use nvm for managing NodeJs versions

Use yarn for package management

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment