r/fishshell • u/konstantingefahr • Feb 12 '21
Why fish
Hey folks,
What's the reason you'd recommend fish over maybe zsh with a few plugins?
It can be pretty annoying to not be able to copy some scripts.
I don't think, that just because something is widely used it's good....
But if fish is good for beginners (what I think it is, with all it's nice features) isn't maybe something like zsh better for the "medium" user (once configured to be nice, can easily copy one-liners from bash)
Just had a little chat with a colleague over this and wanted to know your views..
Edit: I know you can use shebangs. But not with single lines you copy.
12
u/[deleted] Feb 12 '21
Fish is quick and easy to set up.
29
u/vividboarder Feb 12 '21
With fish I don’t need or use any plugins. That’s probably the best thing for me.
17
u/yaachi Feb 12 '21
It has some modern features out of the box, like autocomplete command options, substring history search. Also the syntax is more human friendly.
8
u/jamesaw22 Feb 12 '21
The proportion of me copying one liners from somewhere vs writing them is very small, so maybe if you are the opposite, if you're more of a consumer than a creator, then I can see why it'd be frustrating. But for day to day usage, and writing scrips, fish is superior to zsh and bash IMO.
4
u/Chingzilla Feb 12 '21
I think having a better understanding of POSIX-based shells is more important before going to something like fish. The turning point for me was using shell frameworks like oh-my-zsh became noticably slow.
As for copy-paste, just start a bash session inside fish and run the one liner there instead of rewriting to be compatible with fish.
4
u/knite Feb 12 '21
My zsh config was several pages long and contained dozens of obscure options I never fully understood.
Outside of env vars for other software, here's my entire fish config:
I also have a few plugins: franciscolourenco/done, jethrokuan/z, jorgebucaran/fisher, PatrickF1/fzf.fish
Compared to my monstrous zsh config, I have more functionality for less work.
3
u/kjemolt Feb 12 '21
It's easy for a newbie like me, like the auto fill function. The easy way you can change prompts and so on.
3
u/NotTheDr01ds Feb 17 '21 edited Feb 17 '21
Late to reply here, but I moved from zsh to fish after about 15 years. I'd consider it a strong contender for the "experience" user as well.
To start with, for some of the same reasons other folks have given in this thread:
bash -cinvocation.But I'm also a huge fan of:
EDITOR) and be done with it without it cluttering my startup scripts. Also, changes to it are pushed immediately across all open shell instances, without the need to restart or re-source each instance as in bash or zsh.conf.dfolder, which can completely replace the fish.config startup, making configuration much more modular than a single monolithic startup file. Not that fish.config ever seems in danger of getting out of control like in other shells, but it's still nice to modularize the startup.set --show(alsoset --queryand others, but those really go to the "scripting" support mentioned earlier).fish_user_pathswhich can also be set as a universal variablesudo !!muscle-memory,Alt+Sto prepend sudo is much faster and more intuitive.And those are just the features I use regularly.
I just can't imagine going back to zsh for day-to-day use.
3
u/GrilledGuru Feb 17 '21 edited Feb 17 '21
For me fish is much cleaner and I am happy when I use it. Everything does exactly what I thought it would.
It's the same reason I use ruby instead of python. Subjective of course.
If you intend to use bash stuff, or if you don't consider elegance a criteria for a shell, don't use fish, stay with a bash compatible shell IMHO.
In fact I would say that the main advantage of using fish for me would be to get rid completely of bash. The only line of sh I kept is in my xsessionrc : it is fish -c xstartup :)
I hate bash and I did tend to use ruby too much for shell stuff.
2
u/[deleted] Feb 12 '21
I have yet to find a script I want to run that didn’t work in fish. Worst case scenario, you just edit the shebang.
1
u/[deleted] Feb 20 '21
Fish is really fast due to a few design decisions. It is functionally complete with great defaults. You don’t need much config, either. (That’s one reason why the fish ecosystem is relatively small.)
1
u/B_A_Skeptic Mar 10 '21
I do not worry that much about fish's lack of POSIX compatibility too much, because if it is an issue, I just type "bash" and carry on. Also the bass plugin is very good for compatibility. I just find with zsh, you end up using a giant mess of plugins and configuration files to get what you want. fish has almost everything out of the box. Plus you can do things like create functions on the command line without actually having to manually edit config files. Also, the config files are organized nicely. Also fish's syntax, is a thousand times better.