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