For scripting I still stick to bash because it's more portable and I already know how to cope with its warts. And sometimes when I can't remember the fish syntax by heart, I just launch a bash from inside fish to run my command and then Ctrl-D :-)
Omz has so much compatibility code that you end up with way more than you need and a lot of what it ads can be shimmed to lazy load.
Nvm is just fucking trash. I had to rewrite large parts of it to not be total garbage. It still is. Go look at how it's installed and how it loads itself its fuckin insane.
If it didn't quite stick the first time, I think it's worth trying again.
I usually heavily tweak the settings of the applications I use, make my own custom themes etc, but the defaults of fish are so good that I hardly changed anything.
I only installed 3 plugins (z,fzf,and virtualfish) and that's it, it's super productive.
Completion from history, persistently setting enviroment variables, defining functions, the syntax, everything is much more ergonomic and sane than in bash.
I'm sure you can tweak zsh or even bash to achieve something similar, but why bother?
Also, i don't mind the incompatibility with bash: the fish language is much more sane, and you can easily use bash if needed.
No need to install and configure oh-my-$shell or other huge monstrosities. Most of my stuff comes from a simple homeshick[1] sync with a few files in it.
So easy to use.
It seems like such a missed opportunity, especially at a time when Linux Gaming is on the rise. There's a whole audience that would have the activation energy of getting into shell scripting lowered by being slightly more friendly and approachable than bash.
I feel like fish is the python of shells, and python has more than proved that a language being 'easy' and approachable makes it much more appealing to a wider audience.
For example, you couldn't set environment variables for one command in fish like you could in other shells until the last minor version (3.1).
I'm glad fish is becoming more like other more standard shells while maintaining its user-friendliness.
There is actually python for shell. Check out https://xon.sh
Edit: the point is that I should try fish too. Great user friendly tooling isn't just for beginners.
This is buried down in the Completion section but this is a big deal if you’ve upgraded to MacOS Big Sur: completing a command could hang the shell for 10-15 seconds making it nearly unusable. Thanks for fixing this!
As an example, type anything(for instance, '.conf') + up arrow, and there you see all the completions (for instance, 'less /etc/postgresql/10/main/pg_hba.conf' shows for me) based on the shell history. You can then cycle through them with up/down arrows. It is the same as ctrl+R in bash, but so discoverable and plain. I found tons of similar details in fish.
Edit: typos
and if you want to configure stuff it actually also has a neat ui built in with fish_config
Fun anecdote: my school's crappy homebrew distribution had a bash plugin that did exactly that (it was the distro's one redeeming feature, honestly).
After I moved to other distros, I missed that feature for years (I hate Ctrl+R).
Looking for plugins that implemented it was how I found fish, and I never looked back.
I kept a fork of fish for that purpose for some time, but that was really too much hassle and I went back to zsh.
Which is pretty sad, because otherwise fish is amazing.
fish_add_path will solve one of the few annoying things about Fish.
I've been looking at trying Oil as a Bash replacement though, I think Oil for scripting + Fish for interaction might be a best-of-both-worlds setup.
Ultimately, I got tired of having to translate snippets for my use and went back to zsh for the bash compatibility. Zsh becoming the Mac default also gave me an incentive, because I prefer to use system native if it's anywhere near up to date.
But a lot of what I have to cobble together in zsh via antigen and omz was batteries-included or fisherman-easy in fish. It's very powerful right out of the box. I miss it all the time, and it may get me back before it's done.
I wish it'd be more popular and preinstalled on servers and macOS.
One of the underappreciated values is that while you can configure it you get great functionality out of the box. Switching was chsh, picking a theme in the interactive config, and going back to work. The only I’ve really felt the need to do was to add the Terraform workspace to my prompt, which was quite easy.
Apparently, https://github.com/fish-shell/fish-shell/issues/4019 still has not been fixed. There's no similar issue in bash/zsh.
Great to hear that. I am using vi key bindings wherever it's possible, for example, text editing, Firefox(vimium) and file manager(ranger). But I have never been able to figure out how to use vi mode effectively in the shell prompt. The last time since I tried vi mode in shell was at least 5 years ago. I could roughly remember that vi mode bindings conflicted with certain oh-my-fish plugins I had installed. Even worse factor was that, I didn't know how to do certain things in vi mode, for example "M-." key to yank last argument from previous command. So I gave it up in the end.
Would you mind sharing what plugins do you use? And how do you work efficiently with vi mode? Thanks ahead.
Yeah, maybe not the best. Once could say they're improving though.
> Vi mode bindings now support dh, dl, c0, cf, ct, cF, cT, ch, cl, y0, ci, ca, yi, ya, di, da, d;, d,, o, O and Control+left/right keys to navigate by word
A new "fish_add_path" helper function to add paths to $PATH without producing duplicates, to be used interactively or in config.fish (#6960, #7028). For example:
fish_add_path /opt/mycoolthing/bin
will add /opt/mycoolthing/bin to the beginning of $fish_user_path without creating duplicates, so it can be called safely from config.fish or interactively, and the path will just be there, once.
Not the best comparison but: vim has vimtutor, a couple of good vim games and so on. Is there anything for fish?
Here's the docs if you do want to read about it first: https://fishshell.com/docs/current/
I also enjoyed https://jvns.ca/blog/2017/04/23/the-fish-shell-is-awesome/ which is a nice read though not a tutorial.
Command output is split on newlines, which turns out to work really well with most Unix tools and only breaks on the most pathological of filenames. The newbie-ism `for f in (ls)` isn't actually harmful in fish.
Autocomplete definitions are very straightforward and declarative, so writing your own is easy. See https://fishshell.com/docs/current/cmds/complete.html#exampl.... zsh's system is more intimidating. (I even contributed completions for a few commands to this release of fish.)
Huh.
It feels super weird to see this finally hit release. Feels like a lifetime ago that I made this patch, I'd completely forgotten about it.
Since then I've gone through another lockdown, quit my job, started a Rust GUI framework, and started doing self-employed consulting.
Also it feels kind of humbling to think about the weeks I spent writing it, and then see that it's only a bullet point in a changelog that has hundreds of them (most of them a lot more useful than mine).
Cheers to the fish community!
I’m still wanting a fish-alike interative shell that improves on the Bourne shell language (and bash extensions). I’m having hopes on Oil shell [0], but it’s still in an early stage so I guess I’ll have to wait for a far future…
[0]: https://oilshell.org
- jorgebucaran/fisher - Plugin manager
- IlanCosman/tide - Nice prompt with git status
- jorgebucaran/humantime.fish - Turn milliseconds into a human-readable string in Fish.
- franciscolourenco/done - Automatically receive notifications when long processes finish.
- laughedelic/pisces - Helps you to work with paired symbols like () and '' in the command line.
- jethrokuan/fzf - To integrate fzf (junegunn/fzf)
> fzf.fish is a newer fzf plugin with very similar features. It lacks Tmux support and fzf tab completion, but includes functions for searching git log, git status, and browsing shell variables using fzf. Additionally, it is more likely to be maintained going forward. You can read more about the differences between it and this plugin in the README of fzf.fish here.
From [1] (slightly condensed):
> TLDR: choose fzf.fish over jethrokuan/fzf if you want faster, more efficient, code, code that is easier to debug if you encounter issues, a tool built on Unix philosophy, a plugin that is more likely to attract contributors because it is more maintainable and has CI, a plugin that will be more frequently updated by its author (Jethro no longer uses fish), features for searching git status, git log, and shell variables and you don't mind having to integrate fzf with Tmux yourself, which is easy to do, not having buggy fzf tab completion
Seems like it can search git status/log as well.
BTW I still waiting for https://github.com/fish-shell/fish-shell/issues/510
Congrats for the release!
I LOVE fish but they went out of their way to not be compatible with Bash (like (pwd) instead of $(pwd) for expanding) that break a lot of existing scripts.
The breaking point for me was when the rust/cargo env didn't work in it because they don't have compatible case statements.
Zsh with plenty of plugins makes it pretty convenient as a shell that is still compatible with most bash scripts.
Perhaps fish is not for you?
It nearly is! I love fish powerful completion, just find it annoying that it is triggered automatically. Also fish syntax seems saner than bourne's, and I love it (but miss process substitution from time to time). Unfortunately, I cannot stand the flashiness. With some work, I have managed to disable all colors by setting a lot of fish_color variables in my configuration file. But the auto-completion drains me after a few minutes of use. As if you are speaking to somebody and they complete all your sentences! Even if the completion is correct, isn't that extremely annoying?
**.pdf
to recursively get all pdfs or *{.flac,.mp3}
to only get flac and mp3 files from a directory.I don't miss zsh and the pages of configuration at all.
Unfortunate choice of keys for redo IMO
Fish has a great help system and error messages.
Fish is also a much cleaner programming language because it doesn't need to carry the historical quirks of bash, zsh, and posix. That said I wouldn't recommend using it as a programming language.
If you mean that you still have to use bash on other machines: yeah, I feel you there.
At least for me, I'm fortunate that if I end up using a machine frequently, I can just install fish and add my config/dot files.
I use fish strictly as a command line and it is fantastic.
Either that, or maybe I'm just lazy and missing out on a nice tool...
Bash is a pretty useful and powerful scripting too, especially in server side (among other big list of stuff as you know).