Created
May 22, 2012 12:04
-
-
Save hilli/2768625 to your computer and use it in GitHub Desktop.
vcpromt for one's bashes
This file contains hidden or 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
# Colors from http://wiki.archlinux.org/index.php/Color_Bash_Prompt | |
# misc | |
NO_COLOR='\e[0m' #disable any colors | |
# regular colors | |
BLACK='\e[0;30m' | |
RED='\e[0;31m' | |
GREEN='\e[0;32m' | |
YELLOW='\e[0;33m' | |
BLUE='\e[0;34m' | |
MAGENTA='\e[0;35m' | |
CYAN='\e[0;36m' | |
WHITE='\e[0;37m' | |
# emphasized (bolded) colors | |
EBLACK='\e[1;30m' | |
ERED='\e[1;31m' | |
EGREEN='\e[1;32m' | |
EYELLOW='\e[1;33m' | |
EBLUE='\e[1;34m' | |
EMAGENTA='\e[1;35m' | |
ECYAN='\e[1;36m' | |
EWHITE='\e[1;37m' | |
# underlined colors | |
UBLACK='\e[4;30m' | |
URED='\e[4;31m' | |
UGREEN='\e[4;32m' | |
UYELLOW='\e[4;33m' | |
UBLUE='\e[4;34m' | |
UMAGENTA='\e[4;35m' | |
UCYAN='\e[4;36m' | |
UWHITE='\e[4;37m' | |
# background colors | |
BBLACK='\e[40m' | |
BRED='\e[41m' | |
BGREEN='\e[42m' | |
BYELLOW='\e[43m' | |
BBLUE='\e[44m' | |
BMAGENTA='\e[45m' | |
BCYAN='\e[46m' | |
BWHITE='\e[47m' | |
# Update the command prompt to be <user>:<current_directory>(git_branch) > | |
# Note that the git branch is given a special color | |
#PS1="\n\u@\h:\w \[$EBLACK\]\$(vcprompt)\[$NO_COLOR\] \n→ " | |
if [ -f "$HOME/bin/vcprompt-${OSTYPE}" ]; then | |
PS1="\[$CYAN\]\u@\h: \[$EBLUE\]\w\[$YELLOW\] \$(vcprompt-${OSTYPE})\[$NO_COLOR\] \n→ " | |
else | |
PS1="\[$CYAN\]\u@\h: \[$EBLUE\]\w\[$YELLOW\] \[$NO_COLOR\]\n→ " | |
fi |
This file contains hidden or 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
#!/bin/sh | |
# Download, compile, and copy the vcprompt command to ~/bin. | |
# | |
# AUTHOR: Geoffrey Grosenbach | |
# July 27 2009 | |
mkdir -p ~/src | |
cd ~/src | |
hg clone http://vc.gerg.ca/hg/vcprompt/ | |
cd vcprompt | |
make | |
cp vcprompt ~/bin/vcprompt-${OSTYPE} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Howto
source bash-prompt-config
run vcprompt-install.sh