| @@ -31,6 +31,17 @@ null ls --version && alias with_coreutils=true | |||||
| ( ismsys || iscygwin ) && alias iswindows=true | ( ismsys || iscygwin ) && alias iswindows=true | ||||
| alias inbash=false | |||||
| alias inzsh=false | |||||
| if test -n "$BASH_VERSION" | |||||
| then | |||||
| alias inbash=true | |||||
| elif test -n "$ZSH_VERSION" | |||||
| then | |||||
| alias inzsh=true | |||||
| fi | |||||
| ################################# | ################################# | ||||
| if echo $PATH | grep "$HOME" >/dev/null 2>&1 | if echo $PATH | grep "$HOME" >/dev/null 2>&1 | ||||
| @@ -80,8 +91,6 @@ mkdir -p "$TMP" | |||||
| } | } | ||||
| if iswindows; then | if iswindows; then | ||||
| # export PS1=" \[\e[32m\]\u@\H \[\e[33m\]\w\[\e[0m\] \d \t\n\s \# \j \$ " | |||||
| # export PS1=" [\[\e[33m\]\w\[\e[0m\]]\n\[\e[32m\]\u@\H\[\e[0m\] \d \t \s.\v\nhist:\# jobs:\j \$ " | |||||
| export USER=$USERNAME | export USER=$USERNAME | ||||
| fi | fi | ||||
| @@ -117,7 +126,7 @@ fi | |||||
| ################################### | ################################### | ||||
| # some aliases and functions | # some aliases and functions | ||||
| ( ! with_coreutils && isdarwin ) || test "$TERM" == dumb || \ | |||||
| ( ! with_coreutils && isdarwin ) || test "$TERM" = dumb || \ | |||||
| _coloroption=" --color=auto" | _coloroption=" --color=auto" | ||||
| ( ! with_coreutils && isdarwin ) || iswindows || \ | ( ! with_coreutils && isdarwin ) || iswindows || \ | ||||
| _timeoption=" --time-style=long-iso" | _timeoption=" --time-style=long-iso" | ||||
| @@ -253,7 +262,7 @@ g(){ | |||||
| git "$@" | git "$@" | ||||
| fi | fi | ||||
| } | } | ||||
| if null type _git | |||||
| if null type _git && inbash | |||||
| then | then | ||||
| # enable programmable completion for g | # enable programmable completion for g | ||||
| complete -o bashdefault -o default -o nospace -F _git g 2>/dev/null \ | complete -o bashdefault -o default -o nospace -F _git g 2>/dev/null \ | ||||
| @@ -586,29 +595,6 @@ convmv-sjis2utf8-notest(){ | |||||
| convmv -r -f sjis -t utf8 * --notest | convmv -r -f sjis -t utf8 * --notest | ||||
| } | } | ||||
| #Change ANSI Colors | |||||
| _chengecolors(){ | |||||
| echo -e \ | |||||
| "\e]P0000000" \ | |||||
| "\e]P1cd0000" \ | |||||
| "\e]P200cd00" \ | |||||
| "\e]P3cdcd00" \ | |||||
| "\e]P41e90ff" \ | |||||
| "\e]P5cd00cd" \ | |||||
| "\e]P600cdcd" \ | |||||
| "\e]P7353535" \ | |||||
| "\e]P8666666" \ | |||||
| "\e]P9ff9999" \ | |||||
| "\e]Pa99ff99" \ | |||||
| "\e]Pbffff99" \ | |||||
| "\e]Pc9999ff" \ | |||||
| "\e]Pdff99ff" \ | |||||
| "\e]Pe99ffff" \ | |||||
| "\e]Pfffffff" | |||||
| } | |||||
| # printf "\e]P7353535" \ | |||||
| _colors(){ | _colors(){ | ||||
| echo -e \ | echo -e \ | ||||
| "\e[30mBlack" \ | "\e[30mBlack" \ | ||||
| @@ -649,7 +635,7 @@ winln(){ | |||||
| __my_moc_state(){ | __my_moc_state(){ | ||||
| type mocp >/dev/null 2>&1 || return | type mocp >/dev/null 2>&1 || return | ||||
| test "`mocp -Q %state 2>/dev/null`" == PLAY || return | |||||
| test "`mocp -Q %state 2>/dev/null`" = PLAY || return | |||||
| printf "$1" "`mocp -Q %title 2>/dev/null`" | printf "$1" "`mocp -Q %title 2>/dev/null`" | ||||
| } | } | ||||
| @@ -782,10 +768,10 @@ __my_export_last_status(){ | |||||
| return $_LAST_STATUS | return $_LAST_STATUS | ||||
| } | } | ||||
| _PS1="\ | |||||
| _ps1_bash="\ | |||||
| ${__my_c4}:: ${__my_cdef}[${__my_c2}\u@\H${__my_cdef}:${__my_c1}\w/${__my_cdef}]\$(__my_ps1_git)\$(__my_ps1_bttry)\$(__my_ps1_ipaddr)\$(__my_ps1_moc)\n\ | ${__my_c4}:: ${__my_cdef}[${__my_c2}\u@\H${__my_cdef}:${__my_c1}\w/${__my_cdef}]\$(__my_ps1_git)\$(__my_ps1_bttry)\$(__my_ps1_ipaddr)\$(__my_ps1_moc)\n\ | ||||
| ${__my_c4}:: ${__my_cdef}l${SHLVL}n\#j\js\$? $(__my_ps1_scale) \D{%T} $(__my_ps1_script)\$ " | ${__my_c4}:: ${__my_cdef}l${SHLVL}n\#j\js\$? $(__my_ps1_scale) \D{%T} $(__my_ps1_script)\$ " | ||||
| PS1=$_PS1 | |||||
| inbash && PS1=$_ps1_bash | |||||
| __my_set_screen_title(){ | __my_set_screen_title(){ | ||||
| if test -n "$TMUX" && test -z "$INSIDE_EMACS" | if test -n "$TMUX" && test -z "$INSIDE_EMACS" | ||||
| @@ -807,4 +793,3 @@ __my_set_title(){ | |||||
| } | } | ||||
| PROMPT_COMMAND="__my_set_title \${USER}@\${HOSTNAME}\:\${PWD}; | PROMPT_COMMAND="__my_set_title \${USER}@\${HOSTNAME}\:\${PWD}; | ||||
| __my_set_screen_title \$(basename \"\$PWD\")/" | __my_set_screen_title \$(basename \"\$PWD\")/" | ||||