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

agree, there is (obviously) some key combination that does the same thing without changing the usual behaviour of up/down which I prefer a lot


To be fair, if your prompt is empty, up/down behavior doesn't change.

I guess I re-run commands fairly often, so for me the history-search-backward thing is very useful; when I just need to use the default up/down binding, I just hit Ctrl-E Ctrl-U (go to end of line, erase everything to beginning of line) and I'm good to go.


> To be fair, if your prompt is empty, up/down behavior doesn't change.

Ok, but what if your prompt is empty and you press up once? Will it still continue to maintain the old behaviour?


Yes.

To expand on this, it searches based on what's on the left side of your cursor. So if your cursor is all the way on the left side, it acts as it did before. You lose nothing!


This is indeed very nice.


Unfortunately history-search-(forward|backward) is not mapped to a combination in most common configurations.

I prefer to map it to esc-p which coincides with the setting in tcsh. Like that:

"\M-p": history-search-backward

So you basically type something and then press esc p to have the shell complete it.




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

Search: