Created
March 6, 2013 21:55
-
-
Save axelmagn/5103451 to your computer and use it in GitHub Desktop.
bashrc coloration + git line
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
# 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