3 ms·
One of my favorite bash shortcuts is binding the up arrow to history-search-backward. This is the first page I found that concisely explains how; the variant in
by andrewflnr 15y ago
One of my favorite bash shortcuts is binding the up arrow to history-search-backward. This is the first page I found that concisely explains how; the variant in the second comment is the one actually in my .bashrc:
http://hints.macworld.com/article.php?story=20031026174236860 http://hints.macworld.com/article.php?story=2003102617423686...
So if you've typed `verylongcommand` some indeterminate time in the past, you can probably just type "ver<up>", and you'll have it. Very convenient.
- irahul 15y agoA quick look at the article shows it's binding history search. It's already bind to ctrl-r - you can do a ctrl-r, type a few letters of the long commands, and keep doing a ctrl-r till you find the right match. Apart from additional bind your setup requires, arrow keys are near impossible to touch type. Even if you can touch type them, that means taking your hands off the home row, and positioning them again.
- bostonvaulter2 15y agoI think with the parent's setup you can do ver<C-p> to get the same effect.
- graywh 15y agoI use ctrl-P/N for history-beginning-search-{backward,forward} in Zsh. Type the start of a previous command and cycle through the matches.