Skip to content

Instantly share code, notes, and snippets.

@epeters3
Created August 28, 2018 15:14
Show Gist options
  • Save epeters3/98b89bb110d5e3be52a25656083900ca to your computer and use it in GitHub Desktop.
Save epeters3/98b89bb110d5e3be52a25656083900ca to your computer and use it in GitHub Desktop.
My .bash_profile that I like to use
### VISUAL TERMINAL SETTINGS
############################
# Configure prompt
EMOJIS=("🌮" "🍍" "🎉" "🚀")
DEFAULT_EMOJI=${EMOJIS[$RANDOM % ${#EMOJIS[@]} ]}
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# Format the terminal prompt as:
# "<username> - <current_directory> (<current_git_branch>) <random_favorite_emoji> "
export PS1="\u - \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $DEFAULT_EMOJI "
# Terminal syntax highlighting
export CLICOLOR=1
### SET PATH
############
export # etc.
export # etc.
### FUNCTIONS
#############
# List all processes running on a given port (e.g. "ps-by-port 3000")
ps-by-port() {
lsof -n -i4TCP:"$1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment