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