From 5a7476a7745d7c4bf78cb4e8e615e01d68b58e73 Mon Sep 17 00:00:00 2001 From: Peter Daly-Dickson Date: Thu, 6 Nov 2014 20:55:11 +0000 Subject: [PATCH 1/2] Added ability to enter a few characters at the prompt and then search backwards/forwards through history with up and down arrows --- lib/history.bash | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/history.bash b/lib/history.bash index 92db21f9..f278e598 100644 --- a/lib/history.bash +++ b/lib/history.bash @@ -15,6 +15,11 @@ export HISTSIZE=5000 export AUTOFEATURE=true autotest +# enter a few characters and press UpArrow/DownArrow +# to search backwards/forwards through the history +bind '"":history-search-backward' +bind '"":history-search-forward' + function rh { history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head } From 61e52883f7647a231e46715d9926b57d44078787 Mon Sep 17 00:00:00 2001 From: Peter Daly-Dickson Date: Fri, 7 Nov 2014 13:50:34 +0000 Subject: [PATCH 2/2] Moved arrow-keys-search-history from lib to available plugins --- lib/history.bash | 5 ----- plugins/available/history.plugin.bash | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 plugins/available/history.plugin.bash diff --git a/lib/history.bash b/lib/history.bash index f278e598..92db21f9 100644 --- a/lib/history.bash +++ b/lib/history.bash @@ -15,11 +15,6 @@ export HISTSIZE=5000 export AUTOFEATURE=true autotest -# enter a few characters and press UpArrow/DownArrow -# to search backwards/forwards through the history -bind '"":history-search-backward' -bind '"":history-search-forward' - function rh { history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head } diff --git a/plugins/available/history.plugin.bash b/plugins/available/history.plugin.bash new file mode 100644 index 00000000..512bbf92 --- /dev/null +++ b/plugins/available/history.plugin.bash @@ -0,0 +1,4 @@ +# enter a few characters and press UpArrow/DownArrow +# to search backwards/forwards through the history +bind '"":history-search-backward' +bind '"":history-search-forward'