Skip to content

Instantly share code, notes, and snippets.

@samuraijane
Last active June 20, 2020 23:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samuraijane/26dbc299147fdc1d54c7b5f05b0e6579 to your computer and use it in GitHub Desktop.
Save samuraijane/26dbc299147fdc1d54c7b5f05b0e6579 to your computer and use it in GitHub Desktop.
# --------------------------------------------------------------
# IMPORT ALIAS COMMANDS
# --------------------------------------------------------------
. ~/.alias
# --------------------------------------------------------------
# NODE VERSION MANAGER
# --------------------------------------------------------------
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion" ] && . "/usr/local/opt/nvm/etc/bash_completion"
# --------------------------------------------------------------
# LOAD RBENV AUTOMATICALLY
# Be sure to fire `rbenv hash` after installing new gems in order to generate new shims
# --------------------------------------------------------------
eval "$(rbenv init -)"
# --------------------------------------------------------------
# DEFINE A FUNCTION THAT SHOWS THE CURRENT GIT BRANCH
# --------------------------------------------------------------
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# --------------------------------------------------------------
# CUSTOMIZE THE COMMAND PROMPT AND SHOW ONLY THE CURRENT DIRECTORY
# t is current time
# u is username
# w is current working directory with the full path
# [\033[37m\] is light gray
# [\033[32m\] is green
# [\033[33m\] is yellow
# [\033[00m\] is Terminal's default color, black in this case
# --------------------------------------------------------------
export PS1="\[\033[37m\][\t] \[\033[32m\]\W\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
# --------------------------------------------------------------
# ADD MONGO TO YOUR PATH
# --------------------------------------------------------------
export PATH=$PATH:~/bin:/usr/local/opt/mongodb@3.2/bin:~/.composer/vendor/bin
# --------------------------------------------------------------
# ADD POSTGRESQL TO YOUR PATH
# --------------------------------------------------------------
export PGDATA=/usr/local/var/postgresexport PATH="/usr/local/opt/mysql@5.7/bin:$PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment