Skip to content

Instantly share code, notes, and snippets.

@axelmagn
Created March 6, 2013 21:55
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 axelmagn/5103451 to your computer and use it in GitHub Desktop.
Save axelmagn/5103451 to your computer and use it in GitHub Desktop.
bashrc coloration + git line
# with git line
set_prompt() {
local OPEN="\[";
local CLOSE="\]";
local BGREEN="${OPEN}$(tput setaf 2 ; tput bold)${CLOSE}"
local BBLUE="${OPEN}$(tput setaf 4 ; tput bold)${CLOSE}"
local BRED="${OPEN}$(tput setaf 1 ; tput bold)${CLOSE}"
local COLOROFF="${OPEN}$(tput sgr0)${CLOSE}"
export PS1='${debian_chroot:+($debian_chroot)}'"${BRED}"'$(__git_ps1 "{%s} ")'"${BGREEN}"'\u@\h'"${BBLUE}"' \W \$ '"${COLOROFF}"
}
set_prompt
# w/o git line
set_prompt() {
local OPEN="\[";
local CLOSE="\]";
local BGREEN="${OPEN}$(tput setaf 2 ; tput bold)${CLOSE}"
local BBLUE="${OPEN}$(tput setaf 4 ; tput bold)${CLOSE}"
local BRED="${OPEN}$(tput setaf 1 ; tput bold)${CLOSE}"
local COLOROFF="${OPEN}$(tput sgr0)${CLOSE}"
export PS1='${debian_chroot:+($debian_chroot)}'"${BGREEN}"'\u@\h'"${BBLUE}"' \W \$ '"${COLOROFF}"
}
set_prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment