diff options
author | Tharre <tharre3@gmail.com> | 2018-08-27 00:32:54 +0200 |
---|---|---|
committer | Tharre <tharre3@gmail.com> | 2018-08-27 01:11:20 +0200 |
commit | 704ad13e3ee607be2d837b9bc250105d85b8c5bf (patch) | |
tree | 99b53fe66c276277c2e25992aa57d2468ae2590f /.zshrc | |
parent | 8b9e816438744b205b686fa360fbca0200852f78 (diff) | |
download | dotfiles-704ad13e3ee607be2d837b9bc250105d85b8c5bf.tar.gz dotfiles-704ad13e3ee607be2d837b9bc250105d85b8c5bf.tar.xz dotfiles-704ad13e3ee607be2d837b9bc250105d85b8c5bf.zip |
zsh: limit history in memory to 10000 lines
10000 lines should suffice in general, no need to waste additional
memory. Additionally hist_expire_dups_first has been removed, because
this causes a lot of additional CPU load, probably loading $HISTFILE
over and over again.
If further history is required, it can be loaded with a function like
the following:
function hist {
local TEMPHISTFILE="$HISTFILE"
local TEMPSIZE=$SAVEHIST
fc -pa
HISTSIZE=$TEMPSIZE
fc -R "$TEMPHISTFILE"
fc -l 0
}
The problem with the above is that it will increase the memory footprint
of the zsh process, up to ~50MiB, that doesn't seem to be freed later.
Just grepping $HISTFILE produces a similar result, without this
drawback.
Diffstat (limited to '.zshrc')
-rw-r--r-- | .zshrc | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -31,13 +31,12 @@ zle -N bracketed-paste bracketed-paste-magic ## history HISTFILE="$ZSH_HOME/.zsh_history" -HISTSIZE=100000000 -SAVEHIST=$HISTSIZE +HISTSIZE=10000 +SAVEHIST=100000000 setopt extended_history setopt hist_ignore_dups setopt inc_append_history setopt share_history -setopt hist_expire_dups_first ## completion zmodload zsh/complist |