7 ms·
I switched to fish a few years back after a couple decades of using bash. It took about 10 minutes to make that permanent everywhere – because so much is built-
by acdha 5y ago
I switched to fish a few years back after a couple decades of using bash. It took about 10 minutes to make that permanent everywhere – because so much is built-in and the defaults are good, there was no need to spend time on more than the package install plus chsh.
For scripting, I’d already set a personal policy that anything complicated use Python. For me there’s a fairly big difference between interactive shell sessions and scripts which solidly shifts the balance to a full language with a rich standard library and robust error handling. My scripts were edited using shfmt and shellcheck interactively anyway, so switching to Python wasn’t an increase in terms of tool support and the richer language means that I’m writing less code to get more functionality and especially error handling.
- indigodaddy 5y agoI tried out zsh and just could not get used to how different tab completion was vs bash, so went back to bash quickly. Is tab completion on fish more similar to bash than zsh is?
- MiguelX413 5y agoI use zsh because of its tab completion lol
- kbd 5y agoTotally. And there’s nothing better than fzf-tab https://github.com/Aloxaf/fzf-tab https://github.com/Aloxaf/fzf-tab
- MiguelX413 5y agoI'll try it out!
- cookiecaper 5y agoTry it for yourself: https://rootnroll.com/d/fish-shell/ https://rootnroll.com/d/fish-shell/
- indigodaddy 5y agoAh cool thanks!
- acdha 5y agoI didn't find it too much of a switch — it works well and things like Option-><arrow> to complete it word by word are really handy with repetitive tasks like using the AWS CLI.
- mwaitjmp 5y agoTotally agree, it’s very off putting to use zsh auto complete after years of using bash.
- bscphil 5y agoNo, fish actually has super fancy autocompletion with suggestions, which is even more complicated and visually messy than the zsh defaults. Furthermore, none of it can be disabled in fish. (This is why I don't use fish, fwiw.) On the other hand, you can disable all these advanced features in zsh and get something a bit closer to a bash readline shell, with a few extra features. That's what I use.
- shawndellysse 5y ago`fish` is amazing. I used to have a big old dotfiles repo, but nowadays I add starship[0] to my env and I'm pretty much good to go. On the non-interactive scripting front, I've found fish to be a very competent language for it, but you're right, the error handling (among other things) are lacking compared to "real" languages [0]: https://starship.rs https://starship.rs
- tokumei 5y agoI’ve been using fish for years and I love it. I have a simple prompt and a few functions that I share between all of the environments I have.
- shepherdjerred 5y agoI've had this experience as well. My zsh config was a monster. fish was extremely easy -- starship and ready to go.
- skyfaller 5y agoI have to say, I use fish and I customize my prompt... is starship really necessary? I recognize starship is cross-shell, but if I standardize on installing fish on my machines, I'm not sure I need that feature. Is there a "killer app" for starship that you can't get from writing out your prompt in a fish shell script? Here's mine: https://github.com/maximum-ethics/linode-caddy/blob/master/roles/fish-shell/files/fish_prompt.fish https://github.com/maximum-ethics/linode-caddy/blob/master/r... It's a 3-line prompt with a timestamp on the first line, my username@host + pwd on the 2nd line, and the actual prompt with the cursor on the 3rd line. I'm now considering swapping the timestamp to the right side after that possibility was mentioned in other comments in this thread.
- NobodyNada 5y agoI switched to Fish a couple years ago, and I love it too — the only thing I ever find myself missing from bash is `!!`. The (new) Alt+S keybind to prepend `sudo` to a command covers many of these use cases, but not all of them. For example, sometimes I want to re-run the last two commands; in Bash I could do `<up><up> && !!` but there doesn’t seem to be a good way to do this in Fish without having to re-type one of the commands. Alt+Up is great for recalling individual arguments, but am I missing something or is there no way to recall a whole previous line in-place, without overwriting what’s currently on the command line?
- cookiecaper 5y agoUp-up-Ctrl+K to kill the line; down to go down one in the history; end to go to end of line; `; and` or ` &&` to join the commands; ctrl+Y to yank the line from the killring. [0] Seems to work in bash too, fwiw. [0] https://fishshell.com/docs/current/interactive.html#copy-and-paste-kill-ring https://fishshell.com/docs/current/interactive.html#copy-and...
- artful-hacker 5y agoThe first thing in install with oh-my-fish is bang-bang, which fixes this issue for me. https://github.com/oh-my-fish/plugin-bang-bang https://github.com/oh-my-fish/plugin-bang-bang
- kstrauser 5y agoSame here. It's just so ergonomic. For instance, here's how to make a fancy prompt in fish: - Write a function called "fish_prompt" with "echo", "set_color", and whatever else you want. - Put it in a file in fish's "functions" directory called "fish_prompt.fish" That's it. Done. Every time fish needs to display a prompt, it does so by calling the "fish_prompt" function. Where does fish find the definition of a function called "foo"? In a file called "foo.fish". Oh, do you want one of those very cool right-side-of-the-window prompts showing the date, maybe? Write a function called "fish_right_prompt.fish". There, you're finished. There are a million little niceties like this that seem so obvious in retrospect. Fish is what happens when someone completely rethinks a shell from the perspective of how things should be done today after we have a few decades of experimentation under our belt.
- otabdeveloper4 5y agoFish doesn't work with a light theme. (Dark text on white background.) Also the keybindings in fish are extremely unergonomic. Honestly I just want a bash that saves every command entered, ever, and never deletes history. (I think I can spare the 100 kilobytes of disk space to hold command history forever.) And fish doesn't get this right either, even though it's a complete no-brainer. Sigh. So no, I'm not a fan of fish.
- myhf 5y agoFinally, a command line shell for the 90s
- laumars 5y agoI’m glad that works for you but that sounds like a horrible solution to me. Maybe better than Bash but magic named files are probably my least favourite feature in scripting languages.
- kstrauser 5y agoDon't think of it as magic, but as convention. Where do you put your function definitions? In the folder named "functions". There are only a handful of such things to learn.
- Barrin92 5y agofish is fantastic. abbreviations are very nice, the fish_config gui is helpful if you actually need to configure something, and there's just a lot of utility things like fish_add_path. It's just very pleasant to use.
- revscat 5y agoI used fish for around a year and a half and wound up switching back to zsh. fish's startup time is way too long for my tastes, and the devs seem completely uninterested in providing a "don't load plugins" flag. I open up new tmux panes/windows/etc all the time, so fish's slowness here is really noticeable. It also negatively affects using things like `tmux popup`, which spawns a shell. Things like this that take no noticeable time under zsh are sluggish under fish.
- acdha 5y agoInteresting — I picked fish because it was so much faster than zsh but I also run it pretty lean without much in the way of plugins.
- lordgrenville 5y agoI switched to fish for about six months, and recently went back to zsh when I realised that the three things I really liked about it (abbreviations, syntax highlighting and autosuggestions) were all doable in zsh with extensions [0]. (It feels pretty slow, even slower than say OMZ, but that's not such a big deal for me.) [0] https://github.com/olets/zsh-abbr https://github.com/olets/zsh-abbr https://github.com/zsh-users/zsh-syntax-highlighting https://github.com/zsh-users/zsh-syntax-highlighting https://github.com/zsh-users/zsh-autosuggestions https://github.com/zsh-users/zsh-autosuggestions
- beebmam 5y agoDoes fish still not have reverse search? I have a hard time taking a shell seriously if you can't perform an operation at least as good as this. Even Powershell supports reverse search!
- acdha 5y agoWhat specifically are you looking for? It has history search but it sounds like you’re looking for something specific?
- orthecreedence 5y agoIn bash, I can type ctrl+r then type a few characters, and the last command that contains that string will get pulled up and I can hit [enter] to run it. Not sure if fish has this or not, but I use reverse search in bash exhaustively.
- faho 5y agoIn fish: Just enter the text you want to look for into the commandline and press [up]. There's no need to enter a separate mode via ctrl-r.
- spear 5y agoThat separate mode is incremental search and it's a big advantage. It lets you keep extending the search string until it matches the command you're looking for.
- deleted 5y ago[deleted]
- acdha 5y agoI used to use Control-R a lot and now use the fish equivalent: https://fishshell.com/docs/current/interactive.html#searchable-command-history https://fishshell.com/docs/current/interactive.html#searchab... I find it to be more polished and especially like the way it works with fragments (e.g. if you start typing "git log" and hit Option/Alt-ꜛ it will find commands prefixed with that whereas bash Control-R requires you to hit Control-R first and then type that, which isn't as handy when you realize you want to search halfway through).
- krinchan 5y agoI liked fish a lot but various tooling at work just expected you to be working in something sh-like. I handled sourcing files of env vars with some utility functions but I still found myself having to drop into bash/zsh pretty often. I feel torn because I really can empathize with making a clean break. But it also precludes a lot of people from making the shell a daily driver when your co-workers are shoving shell scripts your supposed to source into your env into github, lol.