From fed4dc8d388ca9ae9c0ee3f924a062992506f6a1 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 25 Jul 2020 11:45:08 +0200 Subject: [PATCH] Move custom bash keybindings to separate inputrc When bash is started without readline support, redefining bindings in .bashrc yields warnings. This is the case when starting bash as in Emacs' shell-mode, among others. Moving the keybindings to inputrc fixes this, and should make the bindings available to all programs using readline. --- bashrc | 4 ---- inputrc | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 inputrc diff --git a/bashrc b/bashrc index bbe5994..5db9bbf 100644 --- a/bashrc +++ b/bashrc @@ -26,10 +26,6 @@ shopt -s extglob # Update the values of LINES and COLUMNS. shopt -s checkwinsize -# Enable Emacs-style M-p and M-n behavior -bind '"\ep": history-search-backward' -bind '"\en": history-search-forward' - # make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" diff --git a/inputrc b/inputrc new file mode 100644 index 0000000..fee3a46 --- /dev/null +++ b/inputrc @@ -0,0 +1,4 @@ +# Enable Emacs-style M-p and M-n behavior +"\ep": history-search-backward +"\en": history-search-forward +