ctrl-r: search backwards through command history
ctrl-a: go to beginning of line
ctrl-e: go to end of line
If nothing else, it’s a topic to keep us occupied while they hit the left arrow 47 times instead of ctrl-a.Keyboard shortcuts for GNU Readline
11–20 of 174 posts
Re: Keyboard shortcuts for GNU Readline
#12I'm using bash (and thus GNU readline) all day every day at work, and by far the most useful shortcut for me is Ctrl-r (reverse history search). I also sometimes use Ctrl-a (start of line, if the keyboard doesn't have a convenient Home key) and Ctrl-e (end of line, in lieu of End key). Btw the post disses Ctrl-s / Ctrl-q for pausing/resuming terminal output, but it can be useful when you're outputting a lot of text (…
>by far the most useful shortcut for me is Ctrl-r I rarely ever use Ctrl-r since I usually know the starting part of the command I want. So, I type those starting characters and use up/down arrow keys, courtesy these lines in `~/.inputrc` "\e[A": history-search-backward "\e[B": history-search-forward
Re: Keyboard shortcuts for GNU Readline
#13Re: Keyboard shortcuts for GNU Readline
#14Re: Keyboard shortcuts for GNU Readline
#15Because it is really confusing if you are not an emacs user.
Re: Keyboard shortcuts for GNU Readline
#16Just enable vim mode (`set -o vi`) and call it a day.
Can I still use macros with 'q '?
Re: Keyboard shortcuts for GNU Readline
#17[1] https://thevaluable.dev/zsh-line-editor-configuration-mousel...
Re: Keyboard shortcuts for GNU Readline
#18One thing I wish I knew how to do -- presuming it's possible -- is constraining the reverse/forward history search. Say I know I'm looking for a grep command, I'll do `C-r grep`, but then I want to look through that subset of results for another string (e.g., the pattern, or maybe another part of a pipeline that I half-remember). AFAIK, reverse/forward history search is just an exact string match...and remembering ex…
I'd use "history | grep ..." at that point, if I can't remember an old command. Possibly "history | grep ... | less" and finish searching inside less.
Re: Keyboard shortcuts for GNU Readline
#19Just enable vim mode (`set -o vi`) and call it a day.
Re: Keyboard shortcuts for GNU Readline
#20I ended up globally remapping C-w and moving the help prefix, C-h to C-x h and making C-h backspace, because i was pressing it incorrectly that often.