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