News for hackers. Stuff that matters.
Re:A redditor explains how to make readline and bash more us... by gnubardt on Sunday September 11, 2011 @04:02PM (#2984649)
Those are great, here are a couple more i find very useful:

  # Search for partial matches in bash history
  # so $ <C-p> goes to the previous command but
  #  $ s<C-p> searches through history entries that start with s
  "\C-p":history-search-backward
  "\C-n":history-search-forward

  # add a trailing '/' when tab completing a symlink
  set mark-symlinked-directories on
Re:A redditor explains how to make readline and bash more us... by sltkr on Sunday September 11, 2011 @06:45PM (#2985105)
Personally I've bound history searches to the up/down arrow to make bash behave more like the C-shell in this regard:

    "\e[A": history-search-backward
    "\e[B": history-search-forward
(This was really the only thing I disliked about bash compared to csh, so imagine my delight when I found out this option existed in readline.)
Re:A redditor explains how to make readline and bash more us... by aaronblohowiak on Sunday September 11, 2011 @05:33PM (#2984920)
<C-r> searches through entire history backward, with partial match support
Re:A redditor explains how to make readline and bash more us... by shabble on Sunday September 11, 2011 @07:33PM (#2985196)
It seems to have an annoying habit of preserving the index of the last partial match, even if you cancel it. So when you realise you were searching for the wrong substring, cancel and start over, it won't find it because you've now gone past it in the history list.

I'm still not sure of a decent solution to it (apart from using C-s to search history forward instead)

Re:A redditor explains how to make readline and bash more us... by pacemkr on Sunday September 11, 2011 @08:23PM (#2985310)
It is annoying. Generally happens to me when I "miss" the thing I was searching for and go too far. This is what I do:

    Ctrl + a, Ctrl + k (move to beginning, delete to end), Enter
Going to a new line, resets that index.

I'm sure there is a better way, but its muscle memory for me.

Re:A redditor explains how to make readline and bash more us... by daemianmack on Monday September 12, 2011 @08:39AM (#2986980)
ctrl+c should cancel the search, saving you the line-editing workaround.
Re:A redditor explains how to make readline and bash more us... by daemianmack on Sunday September 11, 2011 @07:37PM (#2985202)
I hit the Enter key.