Skip to content

Instantly share code, notes, and snippets.

@charlesfranciscodev
Created September 6, 2024 23:58
Show Gist options
  • Save charlesfranciscodev/573e54fcad141ec948a1f017e47a6de4 to your computer and use it in GitHub Desktop.
Save charlesfranciscodev/573e54fcad141ec948a1f017e47a6de4 to your computer and use it in GitHub Desktop.
.bashrc
# default editor
export EDITOR=nano
export VISUAL="$EDITOR"
# CDPATH
export CDPATH=.\
:${HOME}\
:${HOME}/code\
function parse_git_branch() {
git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'
}
# current directory
DIR="\[\e[38;5;197m\]\W"
# current git branch
BRANCH="\[\e[38;5;39m\]\$(parse_git_branch)"
# default color
DEFAULT_COLOR="\[\e[00m\]"
# custom prompt
export PS1="${DIR} ${BRANCH} ${DEFAULT_COLOR}$ "
@charlesfranciscodev
Copy link
Author

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