Created
April 10, 2012 14:06
-
-
Save rvanzee/2351611 to your computer and use it in GitHub Desktop.
Bash prompt customization
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
#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 | |
source ~/scripts/git-completion.sh | |
# set keyword shortcuts for common commands | |
alias update="sudo aptitude update" | |
alias install="sudo aptitude install" | |
alias upgrade="sudo aptitude safe-upgrade" | |
alias remove="sudo aptitude remove" |
Author
rvanzee
commented
Apr 10, 2012
- Add the git branch name to the prompt (if you’re in a git repo)
- Enable up and down arrows to search your bash history using whatever you’ve already entered as a search prefix
- Enable tab key to cycle through available commands
- Use the "alias" keyword to set a shortcut for another command.
- Add tab-completion for git commands
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment