Files
bash-it/plugins/available/history-eternal.plugin.bash
cornfeedhobo bdb5289660 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
2021-12-02 09:13:56 -06:00

21 lines
741 B
Bash

# 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"