diff --git a/home/dot_config/sheldon/plugins.toml b/home/dot_config/sheldon/plugins.toml index d535e6b9..623a092a 100644 --- a/home/dot_config/sheldon/plugins.toml +++ b/home/dot_config/sheldon/plugins.toml @@ -72,5 +72,5 @@ apply = ['source'] [plugins.history] local = '~/.local/bin/server' -user = ['history.zsh'] +use = ['history.zsh'] apply = ['source'] diff --git a/home/dot_local/bin/server/history.zsh b/home/dot_local/bin/server/history.zsh index 0de7352d..0d9d14ca 100644 --- a/home/dot_local/bin/server/history.zsh +++ b/home/dot_local/bin/server/history.zsh @@ -1,12 +1,23 @@ #!/usr/bin/env zsh -setopt share_history -setopt append_history -setopt inc_append_history -setopt hist_no_store -setopt hist_ignore_all_dups -setopt hist_ignore_dups - -export HISTFILE=${HISTFILE:-$HOME}/.zsh_history +# Copy from https://github.com/sorin-ionescu/prezto/blob/master/modules/history/init.zsh#L9-L23 + +# +# Options +# + +setopt BANG_HIST # Treat the '!' character specially during expansion. +setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format. +setopt SHARE_HISTORY # Share history between all sessions. +setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history. +setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again. +setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate. +setopt HIST_FIND_NO_DUPS # Do not display a previously found event. +setopt HIST_IGNORE_SPACE # Do not record an event starting with a space. +setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file. +setopt HIST_VERIFY # Do not execute immediately upon history expansion. +setopt HIST_BEEP # Beep when accessing non-existent history. + +export HISTFILE=${HOME}/.zsh_history export HISTSIZE=10000 export SAVEHIST=10000