Browse Source

shrc: do not set alias inbash and inzsh

pull/1/head
10sr 11 years ago
parent
commit
a8aba4201d
1 changed files with 17 additions and 19 deletions
  1. +17
    -19
      shrc

+ 17
- 19
shrc View File

@@ -85,31 +85,29 @@ fi


########################## ##########################
# system type # system type
# aliases:
# with_coreutils, inbash, inzsh


alias with_coreutils=false # for mac
null ls --version && alias with_coreutils=true
gnu_coreutils=false # for mac
null ls --version && gnu_coreutils=true


alias inbash=false
alias inzsh=false
inbash=false
inzsh=false


if test -n "$BASH_VERSION" if test -n "$BASH_VERSION"
then then
alias inbash=true
inbash=true
elif test -n "$ZSH_VERSION" elif test -n "$ZSH_VERSION"
then then
alias inzsh=true
inzsh=true
fi fi


################################# #################################
# file pathes: # file pathes:
# shrc: Path to this file # shrc: Path to this file


if inbash
if $inbash
then then
__shrc="$BASH_SOURCE" __shrc="$BASH_SOURCE"
elif inzsh
elif $inzsh
then then
__shrc="$0" __shrc="$0"
fi fi
@@ -125,7 +123,7 @@ export TERMCAP="${TERMCAP}:vb="
$ismsys && export HOSTNAME $ismsys && export HOSTNAME
# export ENV=~/.shrc # export ENV=~/.shrc


if ! with_coreutils
if ! $gnu_coreutils
then then
export LSCOLORS=gxfxcxdxbxegedabagacad export LSCOLORS=gxfxcxdxbxegedabagacad
else else
@@ -235,11 +233,11 @@ __safe_alias(){
alias "$1" alias "$1"
} }


( ! with_coreutils && $isdarwin ) || test "$TERM" = dumb || \
( ! $gnu_coreutils && $isdarwin ) || test "$TERM" = dumb || \
_coloroption=" --color=auto" _coloroption=" --color=auto"
( ! with_coreutils && $isdarwin ) || $iswindows || \
( ! $gnu_coreutils && $isdarwin ) || $iswindows || \
_timeoption=" --time-style=long-iso" _timeoption=" --time-style=long-iso"
( ! with_coreutils && $isdarwin ) || _hideoption=" --hide=[A-Z]*" # do not use
( ! $gnu_coreutils && $isdarwin ) || _hideoption=" --hide=[A-Z]*" # do not use


_timeformat_iso="%Y-%m-%dT%H:%M:%S%z" _timeformat_iso="%Y-%m-%dT%H:%M:%S%z"
_timeformat_rfc2822="%a, %d %b %Y %T %z" _timeformat_rfc2822="%a, %d %b %Y %T %z"
@@ -406,7 +404,7 @@ g(){
git -c color.ui=always "$@" git -c color.ui=always "$@"
fi fi
} }
if null type _git && inbash
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 \
@@ -925,7 +923,7 @@ dpaste(){
########################## ##########################
# Zsh specific preferences # Zsh specific preferences


if inzsh
if $inzsh
then then
bindkey -e bindkey -e


@@ -1019,7 +1017,7 @@ for f in /usr/share/git/git-prompt.sh \
/opt/local/share/git-core/git-prompt.sh \ /opt/local/share/git-core/git-prompt.sh \
/opt/local/share/doc/git-core/contrib/completion/git-prompt.sh /opt/local/share/doc/git-core/contrib/completion/git-prompt.sh
do do
test -r "$f" && inbash && . "$f" && break
test -r "$f" && $inbash && . "$f" && break
done done
GIT_PS1_SHOWDIRTYSTATE=t GIT_PS1_SHOWDIRTYSTATE=t
GIT_PS1_SHOWUPSTREAM=t GIT_PS1_SHOWUPSTREAM=t
@@ -1135,8 +1133,8 @@ __my_ps1_info(){
_ps1_bash="\ _ps1_bash="\
${__my_c4}:: ${__my_cdef}[${__my_c2}\u@\H${__my_cdef}:${__my_c1}\w/${__my_cdef}]\$(__my_ps1_info)\n\ ${__my_c4}:: ${__my_cdef}[${__my_c2}\u@\H${__my_cdef}:${__my_c1}\w/${__my_cdef}]\$(__my_ps1_info)\n\
${__my_c4}:: ${__my_cdef}\$(__my_ps1_jobs \j)${__my_ps1_str}\$(__my_alert_fail)\$ " ${__my_c4}:: ${__my_cdef}\$(__my_ps1_jobs \j)${__my_ps1_str}\$(__my_alert_fail)\$ "
inbash && PS1=$_ps1_bash
#inzsh && PS1="$_ps1_zsh"
$inbash && PS1=$_ps1_bash
#$inzsh && PS1="$_ps1_zsh"


__my_set_header_line(){ __my_set_header_line(){
# save current position # save current position


Loading…
Cancel
Save