Re:Alias Your Mom, and 4 Other Tips for Productive Development
by gommm on Tuesday September 28, 2010 @04:30PM
(#1737168)
If you're using zsh, you should try adding this to your .zshrc
bindkey '\e[A' history-search-backward bindkey '\e[B' history-search-forward
It tells zsh to search backward and forward in the history for any line starting with the same string as what is currently entered when you press the up and down arrow... Helps saves a lot of time compared to always just using Ctrl-r.
I think there's an equivalent for bash, but I don't know it...
So if I have a complex command I want to run several times, I'll type it out in full the first time. After that, I'll hit Ctrl-r and start typing part of the command until it shows the one I mean, then hit enter to run it.