refactor all history modifications into discrete plugins
This commit is contained in:
9
plugins/available/history-search.plugin.bash
Normal file
9
plugins/available/history-search.plugin.bash
Normal file
@@ -0,0 +1,9 @@
|
||||
cite about-plugin
|
||||
about-plugin 'search history using the prefix already entered'
|
||||
|
||||
# enter a few characters and press UpArrow/DownArrow
|
||||
# to search backwards/forwards through the history
|
||||
if [[ ${SHELLOPTS} =~ (vi|emacs) ]]; then
|
||||
bind '"\e[A":history-search-backward'
|
||||
bind '"\e[B":history-search-forward'
|
||||
fi
|
||||
9
plugins/available/history-substring-search.plugin.bash
Normal file
9
plugins/available/history-substring-search.plugin.bash
Normal file
@@ -0,0 +1,9 @@
|
||||
cite about-plugin
|
||||
about-plugin 'search history using the substring already entered'
|
||||
|
||||
# enter a few characters and press UpArrow/DownArrow
|
||||
# to search backwards/forwards through the history
|
||||
if [[ ${SHELLOPTS} =~ (vi|emacs) ]]; then
|
||||
bind '"\e[A":history-substring-search-backward'
|
||||
bind '"\e[B":history-substring-search-forward'
|
||||
fi
|
||||
@@ -1,9 +1,11 @@
|
||||
cite about-plugin
|
||||
about-plugin 'history manipulation'
|
||||
# enter a few characters and press UpArrow/DownArrow
|
||||
# to search backwards/forwards through the history
|
||||
if [[ ${SHELLOPTS} =~ (vi|emacs) ]]
|
||||
then
|
||||
bind '"[A":history-search-backward'
|
||||
bind '"[B":history-search-forward'
|
||||
fi
|
||||
about-plugin 'improve history handling with sane defaults'
|
||||
|
||||
# append to bash_history if Terminal.app quits
|
||||
shopt -s histappend
|
||||
|
||||
# erase duplicates; alternative option: export HISTCONTROL=ignoredups
|
||||
export HISTCONTROL=${HISTCONTROL:-ignorespace:erasedups}
|
||||
|
||||
# resize history to 100x the default (500)
|
||||
export HISTSIZE=${HISTSIZE:-50000}
|
||||
|
||||
Reference in New Issue
Block a user