Wholesale cleanup of all history plugins

- remove the use of redundant cite
- minor cleanups to history.plugin.bash
- set explicit load orders for history-search and history-substring-search
- add new plugin history-eternal
- replace superfluous trap for managing HISTTIMEFORMAT changes
This commit is contained in:
cornfeedhobo
2021-11-01 22:26:50 -05:00
parent 036cf8ada0
commit bdb5289660
5 changed files with 38 additions and 15 deletions

View File

@@ -0,0 +1,20 @@
# shellcheck shell=bash
about-plugin 'eternal bash history'
# Load after the history plugin
# BASH_IT_LOAD_PRIORITY: 375
# Modify history sizes before changing location to avoid unintentionally
# truncating the history file early.
# "Numeric values less than zero result in every command being saved on the history list (there is no limit)"
export HISTSIZE=-1
# "Non-numeric values and numeric values less than zero inhibit truncation"
export HISTFILESIZE='unlimited'
# Use a custom history file location so history is not truncated
# if the environment ever loses this "eternal" configuration.
HISTDIR="${XDG_STATE_HOME:-${HOME?}/.local/state}/bash"
[[ -d ${HISTDIR?} ]] || mkdir -p "${HISTDIR?}"
export HISTFILE="${HISTDIR?}/history"