Files
dotfiles/zshrc
Paul Walker 730253d1fd Add zsh
2021-04-27 11:27:56 +01:00

34 lines
769 B
Bash

# Add an entry to PATH, iff it's not already there.
addpath() {
wanted_path=$1
at_end=$2
FOUND=$(echo $PATH | grep $wanted_path)
if [ $? -ne 0 ] ; then
if [ "$at_end" == "" ] ; then
export PATH=$wanted_path:$PATH
else
export PATH=$PATH:$wanted_path
fi
fi
}
autoload -Uz compinit && compinit
addpath $HOME/bin
# Not version controlled, it's system specific.
if [ -r $HOME/.cargo/env ] ; then
source $HOME/.cargo/env
fi
# Load any supplementary scripts
if [ -d "$HOME"/.zshrc.d ] ; then
for config in "$HOME"/.zshrc.d/*.zsh ; do
source "$config"
done
unset -v config
fi
if [ -f ${HOME}/.zsh.d/local/${HOSTNAME}.zsh ] ; then
source ${HOME}/.zsh.d/local/${HOSTNAME}.zsh
fi