News for hackers. Stuff that matters.
Re:Advancing in the Bash Shell by Myrmornis on Tuesday September 13, 2016 @01:55AM (#12485901)
Agreed, but even nicer than control-r are the readline functions `history-search-backward` and `history-search-forward`.

Personally I bind them to up/down which on OS X at least involves:

  # Put this in some file like ~/.readline-bindings
  "\e[A": history-search-backward
  "\e[B": history-search-forward

  # And this in your ~/.bashrc or ~/.zshrc
  bind -f ~/.readline-bindings
That way if you haven't typed any input it behaves like normal up (previous command), but if you've typed some characters it only retrieves matching commands.

http://codeinthehole.com/writing/the-most-important-command-...

Re:Advancing in the Bash Shell by devnonymous on Tuesday September 13, 2016 @12:02PM (#12489516)
Just curious since I don't use a mac, doesn't writing the mappings to .inputrc work? IIRC, putting your readline bindings there makes it available for all readline enabled prompts, not just bash ie: Python, pgsql, mysql,.. Etc
Re:Advancing in the Bash Shell by Myrmornis on Tuesday September 13, 2016 @03:04PM (#12491260)
Yes I think that's a better approach, thanks. I don't know why I started using `bind` in my shell config.
Re:Advancing in the Bash Shell by lolive on Tuesday September 13, 2016 @04:52AM (#12486511)
Mapping these to Up/Down arrows (instead of PgUp-PdDn) is the best idea EVER !!!
Re:Advancing in the Bash Shell by musicmatze on Sunday September 18, 2016 @04:04AM (#12524382)
Is there a way to make this work with `set -o vi`? So I can use j/k to browse the history this way?