Skip to content

Instantly share code, notes, and snippets.

@n8io
Last active August 29, 2015 14:17
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 n8io/003431e5c9549d10f2ac to your computer and use it in GitHub Desktop.
Save n8io/003431e5c9549d10f2ac to your computer and use it in GitHub Desktop.
Enhanced termial
#PROMPT STUFF
GREEN=$(tput setaf 2);
YELLOW=$(tput setaf 3);
WHITE=$(tput setaf 7)
function git_branch {
# Shows the current branch if in a git repository
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \(\1\)/';
}
# More info at http://code-worrier.com/blog/autocomplete-git/
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
# Colorize for git dirs
PS1="${YELLOW}\w${GREEN}\$(git_branch)${WHITE}\n$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment