Last active
August 26, 2023 18:53
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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\]> ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}$ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use nvm for managing NodeJs versions
Use yarn for package management