]> arthur.barton.de Git - ax-zsh.git/blobdiff - default_plugins/history/history.zshrc
history: Introduce the clear_history() function
[ax-zsh.git] / default_plugins / history / history.zshrc
index a70d304269ab03a4c75253a8ff244677490831a0..579d6713c15929cc1769d2522bffea104a49c106 100644 (file)
@@ -1,13 +1,11 @@
 # AX-ZSH: Alex' Modular ZSH Configuration
 # history.zshrc: Setup ZSH history
 
-if [[ -z "$HISTFILE" ]]; then
-       # Save history file in cache directory, if not already present
-       # in $ZDOTDIR/$HOME:
-       [ -r "${ZDOTDIR:-$HOME}/.zsh_history" ] \
-               && HISTFILE="${ZDOTDIR:-$HOME}/.zsh_history" \
-               || HISTFILE="$ZSH_CACHE_DIR/history"
-fi
+function clear_history {
+       local HISTSIZE=0
+       cat /dev/null >"$HISTFILE"
+       fc -R
+}
 
 HISTSIZE=10000
 SAVEHIST=10000
@@ -18,6 +16,8 @@ setopt hist_expire_dups_first
 setopt hist_ignore_dups
 setopt hist_ignore_space
 setopt hist_verify
+setopt histignorealldups
+setopt histignorespace
 setopt inc_append_history
 setopt share_history