最終更新 6 months ago

修正履歴 241c6ac60161ba0ebbb57cfbe0f8d81f87817732

.bashrc Raw
1if [ "$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
27fi
28