Skip to content

Instantly share code, notes, and snippets.

@VGonPa
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VGonPa/7662c89ce11e18df6f00 to your computer and use it in GitHub Desktop.
Save VGonPa/7662c89ce11e18df6f00 to your computer and use it in GitHub Desktop.
A pretty format for your bash prompt
# Prompt Colors
BGREEN='\[\033[1;32m\]'
GREEN='\[\033[0;32m\]'
BRED='\[\033[1;31m\]'
RED='\[\033[0;31m\]'
BYELLOW='\[\033[1;33m\]'
YELLOW='\[\033[0;33m\]'
BBLUE='\[\033[1;34m\]'
BLUE='\[\033[0;34m\]'
BBLACK='\[\033[1;30m\]'
BLACK='\[\033[0;30m\]'
BPURPLE='\[\033[1;35m\]'
PURPLE='\[\033[0;35m\]'
BCYAN='\[\033[1;36m\]'
CYAN='\[\033[0;36m\]'
BWHITE='\[\033[1;37m\]'
WHITE='\[\033[0;37m\]'
NORMAL='\[\033[00m\]'
# Improved PS1 by Víctor González:
PROMPT_COMMAND='DIR=`pwd|sed -e "s!$HOME!~!"`; if [ ${#DIR} -gt 30 ]; then CurDir=${DIR:0:12}...${DIR:${#DIR}-15}; else CurDir=$DIR; fi'
CURDIR="[\$CurDir]\$ "
PS1="${BGREEN}\u${BYELLOW}@${BYELLOW}\h:${BBLUE}${CURDIR}${NORMAL}"
Copy link

ghost commented Jan 30, 2015

More possible colours:

BBLACK='\[\033[1;30m\]'
BLACK='\[\033[0;30m\]'
BPURPLE='\[\033[1;35m\]'
PURPLE='\[\033[0;35m\]'
BCYAN='\[\033[1;36m\]'
CYAN='\[\033[0;36m\]'
BWHITE='\[\033[1;37m\]'
WHITE='\[\033[0;37m\]'

@VGonPa
Copy link
Author

VGonPa commented Jan 30, 2015

Thanks @IrenePEncinar!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment