Skip to content

Instantly share code, notes, and snippets.

@evansolomon
Created April 1, 2012 08:36
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evansolomon/2273494 to your computer and use it in GitHub Desktop.
Save evansolomon/2273494 to your computer and use it in GitHub Desktop.
Bash prompt
PROMPT_COMMAND='DIR=`pwd|sed -e "s!$HOME!~!"`; if [ ${#DIR} -gt 30 ]; then CurDir=${DIR:0:12}...${DIR:${#DIR}-15}; else CurDir=$DIR; fi'
# show git branch name in prompt
PS1='\[\e[1;32m\]\u: $CurDir $(__git_ps1 " (%s)")\$\[\e[0m\] '
# make bash autocomplete with up arrow
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'
# make tab cycle through commands instead of listing
bind '"\t":menu-complete'
bind "set completion-ignore-case on"
# git completion
# uses https://gist.github.com/2273507
source ~/scripts/git-completion.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment