summaryrefslogtreecommitdiff
path: root/.bashrc.d
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-07-02 23:30:59 (GMT)
committerMichele Bini <michele.bini@gmail.com>2023-11-27 22:37:18 (GMT)
commit9586d66735d881256e85e70f1b77fef4adbb0fc0 (patch)
tree210629b5dcc465f73141a16811b659564ddd6d18 /.bashrc.d
.bashrc .bashrc.d
Diffstat (limited to '.bashrc.d')
-rw-r--r--.bashrc.d/hist-smenu9
1 files changed, 9 insertions, 0 deletions
diff --git a/.bashrc.d/hist-smenu b/.bashrc.d/hist-smenu
new file mode 100644
index 0000000..786d1d2
--- /dev/null
+++ b/.bashrc.d/hist-smenu
@@ -0,0 +1,9 @@
+histmenu() {
+ READLINE_LINE="$(
+
+ HISTTIMEFORMAT="" history|tail -n1000|tac|sed "s/^ *[0-9][0-9]* *//; s/[\"\']/\\\\\0/g"| smenu -r -W $'\n' -n"$(( "$LINES" / 3 ))" -t1 -d -s "$READLINE_LINE"
+
+)"
+ READLINE_POINT=0
+}
+bind -x '"\C-t":histmenu'