From 62829f3d73f70a90745c8d24779d8631ee1dee92 Mon Sep 17 00:00:00 2001 From: Aaron Johnson Date: Tue, 25 Dec 2018 13:43:27 -0600 Subject: [PATCH] Added IGNORE_SPACE and IGNORE_DUPS options, as well as sanity check for all options --- setopt | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/setopt b/setopt index a45f54c..8215731 100644 --- a/setopt +++ b/setopt @@ -2,12 +2,50 @@ autoload -U compinit promptinit autoload -U colors && colors compinit -d ${HOME}/.cache/.zcompdump promptinit + +#Check sanity of configuration values, and warn user if they are outdated/don't exist +if [ -z ${AUTO_CD+x} ] +then + printf "AUTO_CD is unset! Check example_configs/zsh.conf for the latest options.\nDefaulting $(tput setaf 2)$(tput bold)AUTO_CD$(tput sgr0) to $(tput setaf 3)$(tput bold)true$(tput sgr0).\n\n" + AUTO_CD=true +fi + +if [ -z ${HISTORY_HIDE_SPACE+x} ] +then + printf "HISTORY_HIDE_SPACE is unset! Check example_configs/zsh.conf for the latest options.\nDefaulting $(tput setaf 2)$(tput bold)HISTORY_HIDE_SPACE$(tput sgr0) to $(tput setaf 3)$(tput bold)true$(tput sgr0).\n\n" + HISTORY_HIDE_SPACE=true +fi + +if [ -z ${HISTORY_NO_DUPS+x} ] +then + printf "HISTORY_NO_DUPS is unset! Check example_configs/zsh.conf for the latest options.\nDefaulting $(tput setaf 2)$(tput bold)HISTORY_NO_DUPS$(tput sgr0) to $(tput setaf 3)$(tput bold)true$(tput sgr0).\n\n" + HISTORY_NO_DUPS=true +fi + +if [ -z ${COMPLETION_STYLE+x} ] +then + printf "COMPLETION_STYLE is unset! Check example_configs/zsh.conf for the latest options.\nDefaulting $(tput setaf 2)$(tput bold)COMPLETION_STYLE$(tput sgr0) to $(tput setaf 3)$(tput bold)bash$(tput sgr0).\n\n" + COMPLETION_STYLE=true +fi + + +#Set options if [ $AUTO_CD = true ] then setopt autocd fi + unsetopt beep -setopt HIST_IGNORE_SPACE +if [ $HISTORY_HIDE_SPACE = true ] +then + setopt HIST_IGNORE_SPACE +fi + +if [ $HISTORY_NO_DUPS = true ] +then + setopt HIST_IGNORE_DUPS +fi + if [ $COMPLETION_STYLE = bash ] then setopt noautomenu