aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.config/zsh/.zshrc3
1 files changed, 2 insertions, 1 deletions
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc
index 3d3542a..b9fcc75 100644
--- a/.config/zsh/.zshrc
+++ b/.config/zsh/.zshrc
@@ -185,7 +185,8 @@ unset key{,map,bindings}
# History
#
# The path to the history file
-HISTFILE="$HOME/.local/state/zsh/history"
+[[ ! -d "${XDG_STATE_HOME:-$HOME/.local/state}/zsh/" ]] && mkdir -p "${XDG_STATE_HOME:-$HOME/.local/state}/zsh/"
+HISTFILE="${XDG_STATE_HOME:-$HOME/.local/state}/zsh/history"
# The maximum number of events to save in the internal history.
HISTSIZE=10000
# The maximum number of events to save in the history file.