From a79e9e988f26cf0eb9a9ac2891044db5bc26005f Mon Sep 17 00:00:00 2001 From: Robert Morrison Date: Sat, 1 Apr 2023 21:54:05 +0100 Subject: [PATCH] fix(history): Change set to setopt Kinda borked the history settings by using set instead of setopt mia culpa Fixed now --- history | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/history b/history index 39286e9..f68a9b2 100644 --- a/history +++ b/history @@ -1,19 +1,25 @@ ## History Configuration +[ ! -d $XDG_STATE_HOME/zsh ] && mkdir -p $XDG_STATE_HOME/zsh + ## Options relating to saving history export HISTSIZE=10000 export SAVEHIST=6000 export HISTFILE=$XDG_STATE_HOME/zsh/history -set hist_ignore_dups ## Don't log the same thing twice -set hist_ignore_space ## Don't log things that start with space -set hist_reduce_blanks ## Compact unnecessary white-space -set hist_expire_dups_first ## Remove duplicates first (if any exist) when compacting history -set hist_save_no_dups ## Remove duplicates from history when writing +setopt extended_history ## Save timestamp in history +setopt inc_append_history_time ## incrementally append to history + ## This option means that the history is updated by all shell sessions + ## However it doesn't load them in like share_history does +setopt hist_ignore_dups ## Don't log the same thing twice +setopt hist_ignore_space ## Don't log things that start with space +setopt hist_reduce_blanks ## Compact unnecessary white-space +setopt hist_expire_dups_first ## Remove duplicates first (if any exist) when compacting history +setopt hist_save_no_dups ## Remove duplicates from history when writing ## Options relating to history use -set hist_find_no_dups ## Don't show duplicates when searching history -set hist_verify ## Dont' immediately execute expanded history `eg: sudo !!` +setopt hist_find_no_dups ## Don't show duplicates when searching history +setopt hist_verify ## Dont' immediately execute expanded history `eg: sudo !!` ## This stops certain commands saving into the history file export HISTORY_IGNORE='(cd(| *)|ls(| *)|pushd(| *)|popd(| *))' @@ -24,3 +30,4 @@ zshaddhistory() { emulate -L zsh [[ ${1%%$'\n'} != ${~HISTORY_IGNORE} ]] } +# vim: ft=zsh