This is zsh specific, but here's something I've been burned by enough times that I specifically wanted to mention it: save your history in a file other than the default one. Why? Because if you increase the history limit, and your profile isn't sourced for any reason, the shell will read your history file and use the default history size, clobbering everything that's there. If you use a non-default history file this…
HISTFILE The file to save the history in when an interactive shell exits. If unset, the history is not saved.
0. https://web.archive.org/web/20221012011928id_/zsh.sourceforg...