From 8c82261cc1c15cebb18eb9f2c729e5e9cb127fd0 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Tue, 27 Jun 2023 22:51:12 -0400 Subject: [PATCH] Improve command history --- configs/zsh/autocomplete.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/configs/zsh/autocomplete.sh b/configs/zsh/autocomplete.sh index 868cd3b..62760a0 100644 --- a/configs/zsh/autocomplete.sh +++ b/configs/zsh/autocomplete.sh @@ -1,3 +1,5 @@ +# Make all shells append to history file instantly +setopt INC_APPEND_HISTORY # Handles case-insensitive completion autoload -Uz compinit && compinit @@ -5,8 +7,15 @@ zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' # Configure command history HISTFILE=~/.histfile -HISTSIZE=1000 -SAVEHIST=1000 +HISTSIZE=100000 +SAVEHIST=100000 + +# Ignore duplicates in history search, and dont't write them either +setopt HIST_FIND_NO_DUPS +setopt HIST_IGNORE_ALL_DUPS + +# Ignore commands starting with a space +setopt HIST_IGNORE_SPACE # Allow up arrow to be used to go back in history based on current line contents autoload -U up-line-or-beginning-search @@ -14,4 +23,4 @@ autoload -U down-line-or-beginning-search zle -N up-line-or-beginning-search zle -N down-line-or-beginning-search bindkey "^[[A" up-line-or-beginning-search # Up -bindkey "^[[B" down-line-or-beginning-search # Down \ No newline at end of file +bindkey "^[[B" down-line-or-beginning-search # Down