Skip to content

Instantly share code, notes, and snippets.

@yehchge
Forked from duese/.bashrc
Created July 22, 2022 02:37
Show Gist options
  • Save yehchge/db56a93de1919cafa90581312f9001c6 to your computer and use it in GitHub Desktop.
Save yehchge/db56a93de1919cafa90581312f9001c6 to your computer and use it in GitHub Desktop.
Colored prompt with git-prompt enabled
# to get a git prompt:
source /usr/share/git/completion/git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=true
#GIT_PS1_SHOWSTASHSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
GIT_PS1_SHOWCOLORHINTS=true
# colorize bash prompt
# see also http://misc.flogisoft.com/bash/tip_colors_and_formatting
#PS1='[\u@\h \W]\$ ' # To leave the default one
#PS1='[\[\e[1;32m\]\u\[\e[0m\] @ \[\e[1;33m\]\h\[\e[0m\] : \[\e[0;37m\]\w\[\e[0m\]]\$ '
# activate the git promt:
#PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
PS1='[\[\e[1;32m\]\u\[\e[0m\] @ \[\e[1;33m\]\h\[\e[0m\] : \[\e[0;37m\]\w\[\e[0m\]$(__git_ps1 "\[\e[38;5;45m\] «%s»\[\e[0m\]")]\$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment