by mattgreenrocks · 3y ago · 0 comments
zsh felt like it fought me every step of trying to configure it to be halfway decent. And a lot of zsh scripts out there aren’t exactly bulletproof. It shouldn’t matter, except for the fact that if you use the shell with any regularity you will inevitably bump into edge cases that weren’t handled well by a mishmash of user scripts whose provenance is mostly copy/paste with little understanding of why it is all needed.
Here’s my fish dotfiles:
https://github.com/mattgreen/dotfiles/tree/master/fish
It has a submodule based plugin system (loader in conf.d), an async git prompt, my aliases, and a few env vars set. It needs no maintenance because fish provides almost everything already.
The only thing I want from fish at this point is to make async prompts first-class. They are best handled by the shell, not user code, due to the state tracking.
your commands to help not working in fish? that is rather surprising. i would think that fish users should be aware that shell specific things in fish are different, so they should have been able to cope and translate as needed.
and it's not what you can do in fish that makes it special. it's how you do it. the syntax coloring, the completions, the syntax itself...
the key thing for me is how it handles searching history and autosuggestions. i just learned how to somehow recreate this setup in zsh, and i am very curious if bash can do that too: https://news.ycombinator.com/item?id=37274207
btw i believe bash got a lot better at command completion after fish popularized the idea.
Most of the remainder of my zsh config are prompt utilities and other things I've added over the years. I don't use or really need any plugins, though if I needed, last time I tried zplug it was really easy to set up and use.
[1]: https://github.com/mid-kid/config/blob/master/shell/.zshrc#L...
oh-my-zsh is a lifesaver here. I have a very small dotfile that delegates most of the config to omz, which I have in a bare repo that I clone onto each new machine. It took maybe an hour a few years ago to settle on the plugins I wanted and put the repo together, and each new machine now takes 5-10 minutes to get up and running.
Really feels like OMZ doesn’t know its place when it is configured by default to do that. Tools should be quiet and keep to themselves.
For example, compare this in zsh:
``` case $input in "foo") echo "Input is foo" ;; "bar") echo "Input is bar" ;; ) echo "Input does not match any case" ;; esac ```
with this in Fish shell:
``` switch $input case "foo" echo "Input is foo" case "bar" echo "Input is bar" case "
" echo "Input does not match any case" end ```And it was a really small example. Fish can do much more with "simpler" and not arcane syntax.
Fish also has `string` to work with string much much easier [0].
You miss `oh-my-zsh`? Fish has `oh-my-zsh` [1].
You miss integration with `fzf`? Fish also has it.
One caveat is Fish is not POSIX-compatible. But I don't find it a compelling reason to not using it.
Personally, I use Fish as my main shell. I do use zsh/Bash in my company though since they're more ubiquitous.