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

> ^R is more powerful, though; it matches at any point in previous commands, not just at the beginning.

That's how it works in Fish as well.

    user@system ~> echo wow
    wow
    user@system ~> echo something
    something
    user@system ~> wow█
...press the up arrow and the current line becomes...

    user@system ~> echo wow█


In bash, you hit Ctrl-R on the empty prompt and type "w":

    (reverse-i-search)`w': echo wow
Hit return to execute, or any motion keys to start editing. It was the first thing I missed in Fish.


In fish, you type "w" on the empty prompt and hit Up:

    > echo w̲ow
Hit return to execute, or any motion keys to start editing. As long as you don't move sideways, you can repeatedly press up or down to navigate history. The underline is actually a highlight hinting at the substring match in the line.

The difference is that typing an additional character after having moved in the history will start editing, appending the character to the line, instead of appending to the criteria.

What I miss in all of them is looking for a fuzzy match instead of a substring match.


I'm not sure how that is functionally different to mintplant's example?

In fish you just type 'w' hit the up arrow and then hit enter to execute or any motion keys to edit. The same number of keypresses as well.

Am I misunderstanding?


Discoverability. With fish i would have to type something that would be a good match to the command i want to re-run before pressing up. With bash i type ctrl+r and start typing and i can continue to type until it's narrowed down to the correct command.




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

Search: