Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>Granted, I use zsh, but I think it works pretty much the same in bash.

I also use zsh and I don't even use ctrl+r anymore. I just type a portion of the command I remember and hit the up arrow key. Almost always the command I want is only one to three arrow keys away. zsh matches partial commands really well.



Bash has similar commands available to move up and down by matching commands. However, I find such modal behavior of up/down confusing; I prefer to have up and down always move by one command, and use C-r for reverse isearch.


Agreed, but this only works if you know you are right about the beginning of the command. Ctrl-R is still the best way I know to search for a command that I may not be sure about the first letters of.


I like the incremental searching that using control-r lets you do. That can come in really handy when I don't remember precisely what the command I want is.

I can start typing and then type more once I see some results to hone in more precisely to what I want, or even backspace over some of what I've typed and type some more without having to start all over again.

Also, using control-r instead of the arrow keys doesn't force me to move my wrists and lets me keep my fingers mostly on the home row. I try to use the arrow keys as little as possible.


Not moving your hand away from the home row is a good point!

Now I gotta retrain my muscle memory :)


You should be able to use ctrl-p/n for arrow up/down. That keeps your hand on the homerow. Forget about arrow keys (especially on a typical mac keyboard).


Ctrl-p/n are a quicker way to go up and down the history.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: