Created
April 1, 2012 08:36
-
-
Save evansolomon/2273494 to your computer and use it in GitHub Desktop.
Bash prompt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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