DEV Community

Discussion on: Why I am not switching to ZSH

Collapse
 
thomasjunkos profile image
Thomas Junkツ

Fish is a nice and decent shell.
But if I made the switch I had to unlearn && and have to give up niceties like !-3.
At that point, I was done with fish. It's not fish's fault, but I am too lazy 😎

Collapse
 
flrnd profile image
Florian Rand • Edited

Fish history recall is very simple yet effective:

As in any modern shell, the Up arrow, ↑ recalls whole lines, starting from the last line executed. A single press replaces "!!", later presses replace "!-3" and the like.
If the line you want is far back in the history, type any part of the line and then press Up one or more times. This will constrain the recall to lines that include this text, and you will get to the line you want much faster. This replaces "!vi", "!?bar.c" and the like.

Fish docs

Collapse
 
thomasjunkos profile image
Thomas Junkツ

Thank you for your kind advice and hint to the docs.

Thread Thread
 
flrnd profile image
Florian Rand

No problem! I should thank you because I didn't know about !-3 before reading your comment. I was just sharing my findings :D

Collapse
 
jrop profile image
Jonathan Apodaca

The equivalent of && is ; and. However, for !-3, I never use that anyway, so I'm not sure what the equivalent is :D

Collapse
 
mt3o profile image
mt3o

; breaks if the call on the left ends with error?

Thread Thread
 
memphizzz profile image
MemphiZ

Then it's simply "; or" instead of "; and" in fish.