| 1 | if [ "$TERM" != "dumb" ]; then |
| 2 | if [[ "$OSTYPE" == "darwin"* ]]; then |
| 3 | # For ls colors in Solarized theme |
| 4 | # https://github.com/seebi/dircolors-solarized/issues/10 |
| 5 | export LSCOLORS=gxfxbEaEBxxEhEhBaDaCaD |
| 6 | else |
| 7 | eval "`dircolors -b`" |
| 8 | fi |
| 9 | alias ls='ls --color=auto' |
| 10 | function _git_prompt() { |
| 11 | local git_status="`git status -unormal 2>&1`" |
| 12 | if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then |
| 13 | if [[ "$git_status" =~ nothing\ to\ commit ]]; then |
| 14 | local ansi=32 |
| 15 | elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then |
| 16 | local ansi=34 |
| 17 | else |
| 18 | local ansi=33 |
| 19 | fi |
| 20 | echo -n '\[\e[0;33;'"$ansi"'m\]'"$(__git_ps1)"'\[\e[0m\]' |
| 21 | fi |
| 22 | } |
| 23 | function _prompt_command() { |
| 24 | PS1="${debian_chroot:+($debian_chroot)}\[\033[01;38m\]\u@\h\[\033[00m\]:\[\033[01;33m\]\w\[\033[00m\]`_git_prompt`\$ " |
| 25 | } |
| 26 | PROMPT_COMMAND=_prompt_command |
| 27 | fi |
| 28 |
waja / gist:95b08b55ebdc40998de71dac8919ee1d
Last active 3 months ago
Revision 241c6ac60161ba0ebbb57cfbe0f8d81f87817732