

A redditor explains how to make readline and bash more user friendly - fs111
http://www.reddit.com/r/commandline/comments/kbeoe/you_can_make_readline_and_bash_much_more_user/

======
rmc
Do we need to mention that it's a redditor? This is a useful resource, so it
should be submitted to HN, but the title needs editing.

~~~
ubernostrum
Yes, we do need to mention it, since a lot of HN users have deep, deep biases
against the idea that anything good happens on reddit :)

~~~
skeletonjelly
It's a funny label to apply. Arguably, all that it really takes to become a
redditor is a username, password, and a captcha.

~~~
skeletonjelly
I'm being downvoted. Am I wrong? Please let me know rather than punishing me
for reasons unknown.

~~~
nhoss2
I think you are missing the point in your shallow analysis

~~~
skeletonjelly
Maybe. Was just pointing that fact out though. I've been on reddit for 4 years
now. After the community has grown it just seems a bit naive to refer to it as
a little exclusive club of intellectualism, or from an outsider's perspective,
a meme graveyard. Just an observation.

------
gnubardt
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

~~~
aaronblohowiak
<C-r> searches through entire history backward, with partial match support

~~~
shabble
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)

~~~
pacemkr
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.

~~~
daemianmack
ctrl+c should cancel the search, saving you the line-editing workaround.

------
__rkaup__
A lot of cross-posts from Reddit lately. Could this mean Reddit is improving?

~~~
fs111
No, it's just knowing the right subreddits. I found this one via
<http://redditdirectory.com/856/Programming>

------
StavrosK
Or just use oh-my-zsh with the fish theme and get all of this (and more)
straight away.

~~~
fs111
That might be true, but where ever you go, there is always bash installed. zsh
not so much. Knowing the tools, that you will always find, is a pretty useful
skill.

~~~
graywh
If you're going to use a system enough to copy your readline & bash config, it
would be just as easy to copy your zsh config and install it in the rare case
it's not available.

~~~
idonthack
I don't have root on every box I log in to.

------
drivebyacct2
Wow, I was going to ask for a link to the reddit article before realizing that
the subreddit was simply heavily themed. I had no idea these settings were
flexible and I'm very thankful. Thanks for the cross post and for introducing
me to another nice subreddit.

