4 ms·
> You can arrow-up to go to previous commands just like in bash. But if you start a command (say, ssh) and then arrow-up you will then be cycling back through t
by bretthoerner 14y ago
> You can arrow-up to go to previous commands just like in bash. But if you start a command (say, ssh) and then arrow-up you will then be cycling back through the last ways you entered that command.
Or, if you'd like to do this in Bash, and any program that uses readline: In ~/.inputrc
# Bind the up arrow to history search, instead of history step
"\e[A": history-search-backward
# And the reverse (down)
"\e[B": history-search-forward
- eridius 14y agoI find it easier to just hit ^R when I want to search my history. And since that's a default keybinding, it works on any machine I touch.
- threedaymonk 14y agoI recently moved from tcsh to zsh, and this is one thing that seems to be a bit weird in zsh. For example, given git clone git rebase master git log in my history, if I typed git r<UP> I get 'git log', not 'git rebase master' as I'd expect.
- burgerbrain 14y agoTry: bindkey "^[[A" history-beginning-search-backward
- lawnchair_larry 14y agoAnd that's why no one wants to bother switching.
- burgerbrain 14y agoActually, that's exactly why I switched. (more precisely, this could be said why: http://www.cs.elte.hu/zsh-manual/zsh_14.html http://www.cs.elte.hu/zsh-manual/zsh_14.html) If you don't want to use it, I don't see how that is any of my business. I was just trying to help out somebody who does, so there's hardly any reason to be an ass.
- lawnchair_larry 14y agoTo be honest, I tried it years back and liked it, but forgot about it and didn't miss it. I may try it again sometime. All I'm saying is that most people won't like something that offers no immediate major benefit and has annoying defaults that they have to find an obscure setting to fix. This is probably why so few use emacs, even though it is awesome :)
- pavel_lishin 14y agoEverything has annoying defaults until you either change them or get used to them.