Zsh: Move history stuff higher, fix incremental history add
With calling fc -RI as preexec hook it should work. No, I don't know
why. 🤷
This commit is contained in:
parent
d6eb4e3090
commit
6cac28b246
|
@ -11,6 +11,23 @@ setopt AUTO_CD AUTO_PUSHD PUSHD_IGNORE_DUPS PUSHD_MINUS
|
||||||
# Various options
|
# Various options
|
||||||
setopt CORRECT_ALL FLOW_CONTROL INTERACTIVE_COMMENTS LONG_LIST_JOBS
|
setopt CORRECT_ALL FLOW_CONTROL INTERACTIVE_COMMENTS LONG_LIST_JOBS
|
||||||
|
|
||||||
|
############################# History ##########################################
|
||||||
|
export HISTSIZE=50000 # In memory.
|
||||||
|
export SAVEHIST=10000 # On disk.
|
||||||
|
# Write command to history file after it is finished, with time and duration.
|
||||||
|
setopt NO_SHARE_HISTORY EXTENDED_HISTORY INC_APPEND_HISTORY_TIME
|
||||||
|
# setopt NO_INC_APPEND_HISTORY_TIME EXTENDED_HISTORY SHARE_HISTORY
|
||||||
|
setopt HIST_EXPIRE_DUPS_FIRST HIST_IGNORE_DUPS
|
||||||
|
setopt HIST_IGNORE_SPACE HIST_REDUCE_BLANKS HIST_VERIFY
|
||||||
|
|
||||||
|
# Import new commands from the history file
|
||||||
|
function _my_history_prexec()
|
||||||
|
{
|
||||||
|
fc -RI
|
||||||
|
}
|
||||||
|
autoload -Uz add-zsh-hook
|
||||||
|
add-zsh-hook preexec _my_history_prexec
|
||||||
|
|
||||||
############################## Plugins #########################################
|
############################## Plugins #########################################
|
||||||
|
|
||||||
# Hyphen-insensitive completion. Case sensitive completion must be off. _ and -
|
# Hyphen-insensitive completion. Case sensitive completion must be off. _ and -
|
||||||
|
@ -59,23 +76,6 @@ zstyle ':fzf-tab:complete:man:*' fzf-preview 'whatis -l $word | cut -d- -f2,3,4,
|
||||||
|
|
||||||
async_init
|
async_init
|
||||||
|
|
||||||
############################# History ##########################################
|
|
||||||
export HISTSIZE=50000 # In memory.
|
|
||||||
export SAVEHIST=10000 # On disk.
|
|
||||||
# Write command to history file after it is finished, with time and duration.
|
|
||||||
setopt NO_SHARE_HISTORY EXTENDED_HISTORY INC_APPEND_HISTORY_TIME
|
|
||||||
# setopt NO_INC_APPEND_HISTORY_TIME EXTENDED_HISTORY SHARE_HISTORY
|
|
||||||
setopt HIST_EXPIRE_DUPS_FIRST HIST_IGNORE_DUPS
|
|
||||||
setopt HIST_IGNORE_SPACE HIST_REDUCE_BLANKS HIST_VERIFY
|
|
||||||
|
|
||||||
# Import new commands from the history file
|
|
||||||
function _precmd_history
|
|
||||||
{
|
|
||||||
fc -R
|
|
||||||
# fc -RI
|
|
||||||
}
|
|
||||||
precmd_functions+=_precmd_history
|
|
||||||
|
|
||||||
############################## Completion ######################################
|
############################## Completion ######################################
|
||||||
|
|
||||||
setopt ALWAYS_TO_END COMPLETE_IN_WORD
|
setopt ALWAYS_TO_END COMPLETE_IN_WORD
|
||||||
|
|
Loading…
Reference in New Issue
Block a user