Skip to content

Instantly share code, notes, and snippets.

@ernsy
Last active May 14, 2019 10:32
Show Gist options
  • Save ernsy/41f8ed5715a4d06d9598c98dc639a83f to your computer and use it in GitHub Desktop.
Save ernsy/41f8ed5715a4d06d9598c98dc639a83f to your computer and use it in GitHub Desktop.
bash_profile
export PATH=/usr/local/sbin/:$PATH
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
#bash prefix
#export PS1="\W \$"
#PS1='\[\e[1;32m\][\W]\[\033[32m\]\$(parse_git_branch)\[\033[00m\]$\[\e[0m\]'
export CLICOLOR=1
export ERL_AFLAGS="-kernel shell_history enabled"
alias make=gmake
alias g=git
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
function_exists() {
declare -f -F $1 > /dev/null
return $?
}
__git_aliases ()
{
__git_get_config_variables "alias"
}
for al in `__git_aliases`; do
alias g$al="git $al"
complete_func=_git_$(__git_aliased_command $al)
function_exists $complete_fnc && __git_complete g$al $complete_func
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment