5 ms·
I found these two references a long time ago, great intro to readline and how to setup an effective .inputrc: http://www.chemie.fu-berlin.de/chemnet/use/info/o
by thom_nic 11y ago
I found these two references a long time ago, great intro to readline and how to setup an effective .inputrc:
http://www.chemie.fu-berlin.de/chemnet/use/info/octave/octave_34.html http://www.chemie.fu-berlin.de/chemnet/use/info/octave/octav... and
http://www.ukuug.org/events/linux2003/papers/bash_tips/ http://www.ukuug.org/events/linux2003/papers/bash_tips/
Since then, .inputrc has been an indispensable part of my dotfiles! This one alone saves so much headache:
# Incremental search with Up and Down: add to ~/.inputrc
"\e[A": history-search-backward
- zwischenzug 11y agoThose are great resources, thank you!
- sp332 11y agoIsn't this ctrl-r by default? With ctrl-shift-r to search forward?
- knodi123 11y agono, by default ctrl-r searches through your history based on subsequent keystrokes. although if you're good with it, it's just as fast as up/down arrows.
- aidos 11y agoI think it's different. With these ones you can start typing a cmd, say 'dd ' and then hit up and it will got through all of the previous commands that started with 'dd '. "\e[A": history-search-backward "\e[B": history-search-forward I'm on a mac using iTerm so I also have: "\ed": backward-kill-word and have added a shortcut to iTerm to send escape-d when I hit alt-delete. It's like a softer version of ctrl-w, which I've found indispensable since I started using it. It's actually more consistent with the standard Mac alt-delete
- prakashk 11y agoC-r is reverse-search-history. You press C-r and start typing your search pattern to trigger an incremental search. Most recent command matching the pattern anywhere in the command is selected. In contrast, history-search-backword requires you to start typing your pattern followed by the keystroke it was bound to. The most recent command that starts with your search pattern is selected.
- agumonkey 11y agoMade a reddit thread to find .inputrc hacks or nice ideas. No success. I like having custom keybindings in the shell. But ultimately I will miss emacs when doing so.