psss / rpms / zsh

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