forked from Bash-it/bash-it
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor all history modifications into discrete plugins
- Loading branch information
1 parent
5e667ed
commit 61f727f
Showing
5 changed files
with
34 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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} |