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