Skip to content

Instantly share code, notes, and snippets.

@muzso
muzso / .zshrc_with_monthly_history_archives
Last active March 4, 2023 00:36
Zsh history with monthly archives
# Set these as you see fit.
# Neither of them can be set to an "infinite"/unlimited value, but you can
# set them to a "high enough" value that you'll never reach.
HISTSIZE=110000000
SAVEHIST=100000000
export HISTSIZE SAVEHIST
# The following function sets up history management in a way that each shell's
# history is saved into separate files and they are archived into monthly files.
# This prevents accidental loss of history entries.