Bash – How to Convert inputrc Settings to bashrc

bashreadline

I'd like to keep my modifications to as few files as possible, so I don't want to touch .inputrc unless I absolutely have to. So, given .inputrc lines like:

"\e[5~": history-search-backward
"\e[6~": history-search-forward

How can I apply them only using bash?

This SU post indicated that bind could read from .inputrc, and bind's help says:

$ help bind
bind: bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:shell-command] [keyseq:readline-function or readline-command]

history-search-* look like readline functions, so I tried:

bind "\e[6~":history-search-forward
bind "\e[5~":history-search-backward

Page Up now triggers a bell, Page Down printed a ~.

Is there a general way for me to use inputrc lines in bash?

Best Answer

According to what I have in my .bashrc you need something like

bind '"\e[6~": history-search-forward'
Related Question