Replace individual setopt/unsetopt statements for history options with efficient
array-based loops. Also optimize history substring search key bindings using
the same pattern. Use lib.hm.zsh.define for consistent array formatting and
add unset statements to clean up temporary variables.
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
Warn users when they configure a relative path. We want to encourage
using absolute paths and env variables.
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
Previously, a stateVersion check for 20.03 determined whether or not the input to
`programs.zsh.history.path` would be prepended with `$HOME`. However, this was not
communicated in the documentation, which stated the version check determined whether
the default histfile location would be in `programs.zsh.dotDir` or
`home.homeDirectory`.
The current change simplifies matters and brings path handling in-line with that of
the preceding work on dotDir path handling. If a relative path is provided, it is
parsed as being relative to `home.homeDirectory`. Both absolute and relative paths
are supported, and are cleaned before being passed to other functions.
Tests have been rewritten for the new logic, with case handling for reusability.
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>