Skip to content

Instantly share code, notes, and snippets.

@billcotter
Created August 31, 2013 17:08
Show Gist options
  • Save billcotter/6399499 to your computer and use it in GitHub Desktop.
Save billcotter/6399499 to your computer and use it in GitHub Desktop.
.bashrc
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