Skip to content

Instantly share code, notes, and snippets.

@Axiol
Last active December 23, 2015 12:39
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 Axiol/6636695 to your computer and use it in GitHub Desktop.
Save Axiol/6636695 to your computer and use it in GitHub Desktop.
My bash config
alias ls="ls -G"
alias please="sudo"
alias reload_profile=". ~/.bash_profile"
alias gits="git status"
alias gita="git add ."
alias gitc="git commit -am"
alias fuck="sudo $(history -p \!\!)"
# ANSI color codes
RS="\[\033[0m\]" # reset
HC="\[\033[1m\]" # hicolor
UL="\[\033[4m\]" # underline
INV="\[\033[7m\]" # inverse background and foreground
FBLK="\[\033[30m\]" # foreground black
FRED="\[\033[31m\]" # foreground red
FGRN="\[\033[32m\]" # foreground green
FYEL="\[\033[33m\]" # foreground yellow
FBLE="\[\033[34m\]" # foreground blue
FMAG="\[\033[35m\]" # foreground magenta
FCYN="\[\033[36m\]" # foreground cyan
FWHT="\[\033[37m\]" # foreground white
BBLK="\[\033[40m\]" # background black
BRED="\[\033[41m\]" # background red
BGRN="\[\033[42m\]" # background green
BYEL="\[\033[43m\]" # background yellow
BBLE="\[\033[44m\]" # background blue
BMAG="\[\033[45m\]" # background magenta
BCYN="\[\033[46m\]" # background cyan
BWHT="\[\033[47m\]" # background white
# Check Git branch
parse_git_branch () {
if git rev-parse --git-dir >/dev/null 2>&1
then
echo -e "{ \033[33m"$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')"\033[0m }"
else
echo ""
fi
}
# Prompt modification
export PS1="$FMAG\n\t$RS::$FRED\u$RS { $FBLE\w$RS } \$(parse_git_branch)\n↳ \$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment