Re:Control-R, my favorite Unix shell command
by nitrogen on Sunday May 18, 2014 @01:30PM
(#7763637)
I have history-search-backward and its reverse mapped to page up and page down. A rare few Linux distributions enable them by default, but the rest frequently have a commented example in /etc/inputrc that can be copied to your ~/.inputrc (note that programs using editline instead of readline will need additional configuration).
[ Parent
| on HN ]
Why not arrow up? That's what I use and it is very natural.
Me too. And not entering anything gives normal arrow up, so there's no loss.
BTW: ^r is a little more powerful: it is /string/ while this one is /^string/
BTW ^r annoyance: you can't type and then hit ^r. You have to hit ^r first. Seems easy to fix...
BTW tip: if you like readline features, consider rlwrap: it wraps its argument (which is your command) in readline. e.g. rlwrap python. Especially nice to wrap your own interactive cmdline tool.
Thanks for the tip on rlwrap, that looks really useful!