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