676fa5
#
676fa5
# /etc/zshrc is sourced in interactive shells.  It
676fa5
# should contain commands to set up aliases, functions,
676fa5
# options, key bindings, etc.
676fa5
#
676fa5
676fa5
## shell functions
676fa5
#setenv() { export $1=$2 }  # csh compatibility
676fa5
676fa5
# Set prompts
1582ce
[[ "$PROMPT" = "%m%# " ]] && PROMPT='[%n@%m]%~%# '    # default prompt
676fa5
#RPROMPT=' %~'     # prompt for right side of screen
676fa5
676fa5
# bindkey -v             # vi key bindings
676fa5
# bindkey -e             # emacs key bindings
676fa5
bindkey ' ' magic-space  # also do history expansion on space
676fa5
676fa5
# Provide pathmunge for /etc/profile.d scripts
676fa5
pathmunge()
676fa5
{
676fa5
    if ! echo $PATH | /bin/grep -qE "(^|:)$1($|:)" ; then
676fa5
        if [ "$2" = "after" ] ; then
676fa5
            PATH=$PATH:$1
676fa5
        else
676fa5
            PATH=$1:$PATH
676fa5
        fi
676fa5
    fi
676fa5
}
676fa5
676fa5
_src_etc_profile_d()
676fa5
{
676fa5
    #  Make the *.sh things happier, and have possible ~/.zshenv options like
676fa5
    # NOMATCH ignored.
676fa5
    emulate -L ksh
676fa5
676fa5
676fa5
    # from bashrc, with zsh fixes
676fa5
    if [[ ! -o login ]]; then # We're not a login shell
676fa5
        for i in /etc/profile.d/*.sh; do
676fa5
	    if [ -r "$i" ]; then
676fa5
	        . $i
676fa5
	    fi
676fa5
        done
676fa5
        unset i
676fa5
    fi
676fa5
}
676fa5
_src_etc_profile_d
676fa5
676fa5
unset -f pathmunge _src_etc_profile_d
676fa5