How do I convert inputrc settings to bashrc ones?

Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
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?
bash readline
add a comment |
up vote
3
down vote
favorite
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?
bash readline
1
One reason to use.inputrchere, though, is so that the key bindings are available in any program that usesreadline, not justbash.
– chepner
Sep 25 '15 at 13:43
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
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?
bash readline
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?
bash readline
bash readline
edited Apr 13 '17 at 12:37
Community♦
1
1
asked Sep 24 '15 at 4:49
muru
34.7k580153
34.7k580153
1
One reason to use.inputrchere, though, is so that the key bindings are available in any program that usesreadline, not justbash.
– chepner
Sep 25 '15 at 13:43
add a comment |
1
One reason to use.inputrchere, though, is so that the key bindings are available in any program that usesreadline, not justbash.
– chepner
Sep 25 '15 at 13:43
1
1
One reason to use
.inputrc here, though, is so that the key bindings are available in any program that uses readline, not just bash.– chepner
Sep 25 '15 at 13:43
One reason to use
.inputrc here, though, is so that the key bindings are available in any program that uses readline, not just bash.– chepner
Sep 25 '15 at 13:43
add a comment |
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
According to what I have in my .bashrc you need something like
bind '"e[6~": history-search-forward'
... and now I feel like an idiot. I stopped trying afterbind 'e[6~': history-search-forwardfailed.
– muru
Sep 24 '15 at 6:21
1
I think I had trouble getting there too, as I noted it as non-obvious in my personal "help on bash" file.
– meuh
Sep 24 '15 at 6:27
add a comment |
up vote
1
down vote
For anyone else searching, this works for all inputrc commands: just wrap them in quotes, shove a bind in front, and you're good (make sure you have different types of quotes if the actual inputrc command itself requires quotes).
For example, set show-all-if-ambiguous on is the inputrc config to have tab-completion immediately return multiple options, instead of first ringing the bell and then the next tab return the multiple options. To put it in your bashrc, it's just
bind "set show-all-if-ambiguous on"
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
According to what I have in my .bashrc you need something like
bind '"e[6~": history-search-forward'
... and now I feel like an idiot. I stopped trying afterbind 'e[6~': history-search-forwardfailed.
– muru
Sep 24 '15 at 6:21
1
I think I had trouble getting there too, as I noted it as non-obvious in my personal "help on bash" file.
– meuh
Sep 24 '15 at 6:27
add a comment |
up vote
2
down vote
accepted
According to what I have in my .bashrc you need something like
bind '"e[6~": history-search-forward'
... and now I feel like an idiot. I stopped trying afterbind 'e[6~': history-search-forwardfailed.
– muru
Sep 24 '15 at 6:21
1
I think I had trouble getting there too, as I noted it as non-obvious in my personal "help on bash" file.
– meuh
Sep 24 '15 at 6:27
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
According to what I have in my .bashrc you need something like
bind '"e[6~": history-search-forward'
According to what I have in my .bashrc you need something like
bind '"e[6~": history-search-forward'
answered Sep 24 '15 at 6:14
meuh
31k11754
31k11754
... and now I feel like an idiot. I stopped trying afterbind 'e[6~': history-search-forwardfailed.
– muru
Sep 24 '15 at 6:21
1
I think I had trouble getting there too, as I noted it as non-obvious in my personal "help on bash" file.
– meuh
Sep 24 '15 at 6:27
add a comment |
... and now I feel like an idiot. I stopped trying afterbind 'e[6~': history-search-forwardfailed.
– muru
Sep 24 '15 at 6:21
1
I think I had trouble getting there too, as I noted it as non-obvious in my personal "help on bash" file.
– meuh
Sep 24 '15 at 6:27
... and now I feel like an idiot. I stopped trying after
bind 'e[6~': history-search-forward failed.– muru
Sep 24 '15 at 6:21
... and now I feel like an idiot. I stopped trying after
bind 'e[6~': history-search-forward failed.– muru
Sep 24 '15 at 6:21
1
1
I think I had trouble getting there too, as I noted it as non-obvious in my personal "help on bash" file.
– meuh
Sep 24 '15 at 6:27
I think I had trouble getting there too, as I noted it as non-obvious in my personal "help on bash" file.
– meuh
Sep 24 '15 at 6:27
add a comment |
up vote
1
down vote
For anyone else searching, this works for all inputrc commands: just wrap them in quotes, shove a bind in front, and you're good (make sure you have different types of quotes if the actual inputrc command itself requires quotes).
For example, set show-all-if-ambiguous on is the inputrc config to have tab-completion immediately return multiple options, instead of first ringing the bell and then the next tab return the multiple options. To put it in your bashrc, it's just
bind "set show-all-if-ambiguous on"
add a comment |
up vote
1
down vote
For anyone else searching, this works for all inputrc commands: just wrap them in quotes, shove a bind in front, and you're good (make sure you have different types of quotes if the actual inputrc command itself requires quotes).
For example, set show-all-if-ambiguous on is the inputrc config to have tab-completion immediately return multiple options, instead of first ringing the bell and then the next tab return the multiple options. To put it in your bashrc, it's just
bind "set show-all-if-ambiguous on"
add a comment |
up vote
1
down vote
up vote
1
down vote
For anyone else searching, this works for all inputrc commands: just wrap them in quotes, shove a bind in front, and you're good (make sure you have different types of quotes if the actual inputrc command itself requires quotes).
For example, set show-all-if-ambiguous on is the inputrc config to have tab-completion immediately return multiple options, instead of first ringing the bell and then the next tab return the multiple options. To put it in your bashrc, it's just
bind "set show-all-if-ambiguous on"
For anyone else searching, this works for all inputrc commands: just wrap them in quotes, shove a bind in front, and you're good (make sure you have different types of quotes if the actual inputrc command itself requires quotes).
For example, set show-all-if-ambiguous on is the inputrc config to have tab-completion immediately return multiple options, instead of first ringing the bell and then the next tab return the multiple options. To put it in your bashrc, it's just
bind "set show-all-if-ambiguous on"
answered yesterday
jeremysprofile
231111
231111
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f231726%2fhow-do-i-convert-inputrc-settings-to-bashrc-ones%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
One reason to use
.inputrchere, though, is so that the key bindings are available in any program that usesreadline, not justbash.– chepner
Sep 25 '15 at 13:43