Created
August 28, 2018 15:14
-
-
Save epeters3/98b89bb110d5e3be52a25656083900ca to your computer and use it in GitHub Desktop.
My .bash_profile that I like to use
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
### 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