How do I reload ZSH config files without replacing the current shell?
This is a bit older, but you can always add a function to your .zshrc that sources all config files for you.
function reload(){
source ~/.zshrc
source ~/.zshenv
...
}
So all you'd have to do is to reload
in your shell.
Usually a source ~/.zshrc
should do it.
You can enable the option INC_APPEND_HISTORY
. From the manpage:
INC_APPEND_HISTORY
This options works like APPEND_HISTORY except that new history lines are added to the $HISTFILE incrementally (as soon as they are entered), rather than waiting until the shell exits. The file will still be periodically re-written to trim it when the number of lines grows 20% beyond the value specified by $SAVEHIST (see also the HIST_SAVE_BY_COPY option).
This way you can then do exec zsh
without losing history.