lib/history: new functions _bash-it-history-auto-*()
Two new functions `_bash-it-history-auto-save()` and `_bash-it-history-auto-load()`, which append new history to disk and load new history from disk, respectively. See bash-it/bash-it#1595 for discussion.
This commit is contained in:
@@ -5,15 +5,14 @@ about-plugin 'improve history handling with sane defaults'
|
||||
# variable when the shell exits, rather than overwriting the file.
|
||||
shopt -s histappend
|
||||
|
||||
# erase duplicates; alternative option: HISTCONTROL=ignoredups
|
||||
: "${HISTCONTROL:=ignorespace:erasedups}"
|
||||
# 'ignorespace': don't save command lines which begin with a space to history
|
||||
# 'erasedups' (alternative 'ignoredups'): don't save duplicates to history
|
||||
# 'autoshare': automatically share history between multiple running shells
|
||||
: "${HISTCONTROL:=ignorespace:erasedups:autoshare}"
|
||||
|
||||
# resize history to 100x the default (500)
|
||||
: "${HISTSIZE:=50000}"
|
||||
|
||||
# Flush history to disk after each command.
|
||||
export PROMPT_COMMAND="history -a;${PROMPT_COMMAND}"
|
||||
|
||||
function top-history() {
|
||||
about 'print the name and count of the most commonly run tools'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user