]> arthur.barton.de Git - ax-zsh.git/blobdiff - default_plugins/history/history.zshrc
history: Make sure HISTFILE is set
[ax-zsh.git] / default_plugins / history / history.zshrc
index 49946d476729c992ac17fb54ed0e42b8cd930206..1c2bf378950630e0dea361343097c06b9ff1ab06 100644 (file)
@@ -1,13 +1,13 @@
 # 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
+}
+
+[[ -n "$HISTFILE" ]] || HISTFILE="${ZDOTDIR:-$HOME}/.zsh_history"
 
 HISTSIZE=10000
 SAVEHIST=10000