Skip to content

Instantly share code, notes, and snippets.

@lissahyacinth
Last active June 4, 2019 13:17
Show Gist options
  • Save lissahyacinth/a5c32d704b8858af58a30365e6b675a8 to your computer and use it in GitHub Desktop.
Save lissahyacinth/a5c32d704b8858af58a30365e6b675a8 to your computer and use it in GitHub Desktop.
Current Bash Profile
# Aliases
alias ls='exa -la --git --header'
alias cat='bat'
alias java_ls='/usr/libexec/java_home -Vq 2>&1 | grep -E "\d\.\d\.\d(_\d+)?.*," | cut -d , -f 1 | cut -c 5-'
# Changing Prompt for Bash
inside_git_repo="\$(git rev-parse --is-inside-work-tree 2>/dev/null)"
#Exports for Ruby Installation
export CC=clang
export CXX=clang++
# Add Current Git Branch to ITerm
parse_git_branch() {
if [ "$inside_git_repo" ]; then
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
else echo ""
fi
}
parse_git_commit() {
if [ "$inside_git_repo" ]; then
git log --pretty=format:'%h' -n 1 2> /dev/null | tr -d '\n'
else echo ""
fi
}
export PS1="\W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] \$(parse_git_commit) \$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment