From 8e2c9918aba3b4a781f9f5c855b92e1e17e6ddb6 Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Sun, 20 Aug 2023 17:20:10 +0200 Subject: [PATCH] Add .inputrc and readline macros in bashrc --- .bashrc.d/10_common_aliases.sh | 6 ++++++ .inputrc | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .inputrc diff --git a/.bashrc.d/10_common_aliases.sh b/.bashrc.d/10_common_aliases.sh index 5fbb3f3..bd7f43e 100644 --- a/.bashrc.d/10_common_aliases.sh +++ b/.bashrc.d/10_common_aliases.sh @@ -108,3 +108,9 @@ function b64dec() { # Shortcuts for dig with less output alias digs='dig +short' alias digrr='dig +noall +answer' + +# Readline macro Ctrl-Alt-L: Append "| less" to current command +bind '"\e\C-l": "\C-e | less"' + +# Readline macro Ctrl-Alt-B: Append ">/dev/null 2>&1 &" to current command +bind '"\e\C-b": "\C-e >/dev/null 2>&1 &"' diff --git a/.inputrc b/.inputrc new file mode 100644 index 0000000..a5bd70f --- /dev/null +++ b/.inputrc @@ -0,0 +1,24 @@ +# Include system defaults +$include /etc/inputrc + +# Disable terminal bell +set bell-style none + +# Enable colors for completion listings +set colored-completion-prefix on +set colored-stats on + +# Enable case-insensitive completion +set completion-ignore-case on + +# Show completion listing without double-Tab +set show-all-if-ambiguous on + +# Don't keep changes to history lines +set revert-all-at-newline on + +# Keybinding Alt-W: Like Ctrl-w but allowing slashes as word boundaries +"\ew": unix-filename-rubout + +# Keybinding Alt-Tab: Cycle through completions +"\e\C-i": menu-complete