feat(zsh): configure history

This commit is contained in:
Oscar Wallberg
2024-07-27 18:21:26 +02:00
parent 7fa1a88560
commit 534308fa26
2 changed files with 16 additions and 17 deletions
-1
View File
@@ -1,5 +1,4 @@
zsh-users/zsh-completions
belak/zsh-utils path:completion
belak/zsh-utils path:history
belak/zsh-utils path:utility
zsh-users/zsh-autosuggestions
+16 -16
View File
@@ -7,8 +7,19 @@ _here="$(dirname -- "$(readlink -f -- "${HOME}/.zshrc")")"
# Ref: https://zsh.sourceforge.io/Doc/Release/Options.html
setopt CORRECT
setopt NONOMATCH
setopt INTERACTIVECOMMENTS
setopt INTERACTIVE_COMMENTS
unsetopt NOMATCH
# History
setopt BANG_HIST
setopt EXTENDED_HISTORY
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_NO_STORE
setopt HIST_REDUCE_BLANKS
setopt HIST_VERIFY
setopt INC_APPEND_HISTORY_TIME
###################
# Shell Variables #
@@ -20,6 +31,9 @@ fpath=("${_here}/.zsh_functions" "${fpath[@]}")
export PATH
export MAIL="/var/spool/mail/$USER"
export MAILCHECK=60
export HISTFILE="${HOME}/.zsh_history"
export HISTSIZE=100100
export SAVEHIST=100000
###################
# Other Variables #
@@ -31,20 +45,6 @@ export DIFFPROG="nvim -d"
export NNN_TRASH=2
export NNN_PLUG=''
##################
# History search #
##################
autoload -U history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
# Fix for buggy behaviour of history search
# See https://github.com/zsh-users/zsh-autosuggestions/issues/619#issuecomment-904193190
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(history-beginning-search-backward-end history-beginning-search-forward-end)
zstyle ':autocomplete:tab:*' completion select
############
# Keybinds #
############