diff --git a/common/.zshrc b/common/.zshrc index 1ac902c..36187fd 100644 --- a/common/.zshrc +++ b/common/.zshrc @@ -1,11 +1,11 @@ if [[ ! -d "$HOME/.zsh" ]]; then - mkdir -p ~/.zsh + mkdir -p "$HOME/.zsh" fi fpath=(~/.zsh $fpath) if [[ -f "$HOME/.zshcfg" ]]; then - source ~/.zshcfg + source "$HOME/.zshcfg" else CONF_BINARYCLOCK=0 CONF_ENABLEGIT=0 @@ -33,6 +33,24 @@ if [[ $CONF_ENABLESH -eq 1 ]]; then fi fi +download() { + if [[ -x "$(command -v wget)" ]]; then + wget -qO "$2" "$1" + return $? + elif [[ -x "$(command -v curl)" ]]; then + curl -fsSL "$1" -o "$2" + return $? + fi + echo "Failed to download $1. curl or wget not installed" + return 1 +} + + +if [[ ! -f "$HOME/.zsh/z.sh" ]]; then + download "https://raw.githubusercontent.com/rupa/z/master/z.sh" "$HOME/.zsh/z.sh" +fi +. "$HOME/.zsh/z.sh" + # Lines configured by zsh-newuser-install HISTFILE=~/.zsh_history HISTSIZE=10000 @@ -241,7 +259,7 @@ remindperms () { #### if [[ -f "$HOME/.zshenv" ]]; then - source ~/.zshenv + source "$HOME/.zshenv" fi if [[ $CONF_FORTUNE -eq 1 ]]; then @@ -249,4 +267,4 @@ if [[ $CONF_FORTUNE -eq 1 ]]; then echo fi -[[ $CONF_ENABLESH -eq 1 ]] && source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +[[ $CONF_ENABLESH -eq 1 ]] && source "$HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"