From 857a11e9db894648009e720ec700a9fd6722c00e Mon Sep 17 00:00:00 2001
From: Pascal Zarrad
Date: Fri, 26 Jul 2024 21:02:47 +0200
Subject: [PATCH] feat: improve history to not get lost
---
templates/zsh_better_history.template.zshrc | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 templates/zsh_better_history.template.zshrc
diff --git a/templates/zsh_better_history.template.zshrc b/templates/zsh_better_history.template.zshrc
new file mode 100644
index 0000000..6d857d4
--- /dev/null
+++ b/templates/zsh_better_history.template.zshrc
@@ -0,0 +1,11 @@
+#PSH_TEMPLATE=END
+# History improvements
+# Source: https://jdhao.github.io/2021/03/24/zsh_history_setup/
+export HISTFILE=~/.histfile # history file location
+export HISTSIZE=1000000 # the number of items for the internal history list
+export SAVEHIST=1000000 # maximum number of items for the history file
+setopt HIST_IGNORE_ALL_DUPS # do not put duplicated command into history list
+setopt HIST_SAVE_NO_DUPS # do not save duplicated command
+setopt HIST_REDUCE_BLANKS # remove unnecessary blanks
+setopt INC_APPEND_HISTORY_TIME # append command to history file immediately after execution
+setopt EXTENDED_HISTORY # record command start time