Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As someone who uses zsh + spaceship, what benefits would I gain moving to fish as my main shell? I don’t write many bash scripts so the scripting side is less of a concern.


If you've already set up your zsh as you like it, I don't think there's a huge amount of benefit. The big benefit of fish is that it's pretty much the ideal shell, but straight out of the box, without configuration. Autocomplete just works, navigating the history is easy, it completes commands from your history, choosing a shell prompt can be as simple as opening a browser, etc. You can customise it pretty much as deeply as you need to - just like zsh - but the defaults are good enough that you've got a really nice shell out of the box.


My rationale for picking fish over zsh in 2017 was that it had everything I wanted included, as was quite noticeably faster. Since then I’ve spent almost no time maintaining shell configuration, which has been pleasant.


Speed!

fish does a lot out of the box that I needed plugins for in zsh. zsh's plugins are slow, so my shell startup was over three seconds. fish starts way faster, even with plugins.


The first time I learned to write my own shell prompt by creating a file named “fish_prompt.fish” in the right directory, then writing a function in it named “fish_prompt” that echos a string to stdout, I was nearly ready to uninstall zsh. Using it ruined me on stuffing stuff into $PS1 and crossing my fingers.

I highly recommend everyone at least try it for a few days, if only to see what kinds of things you’d always taken granted are actually shell-specific. Worst case: you say “this isn’t for me” and go back to bash/zsh/whatever happy that you’re still using your favorite shell.


I switched from zsh to fish a couple of years ago. My setups are very similar in capability but my fish config is about 10% the size. I get nearly everything I want for free and now only use one plugin, fzf.fish


I like use fish + starship.rs. Which gives a pretty similar experience. Starship can actually share you prompt across different shells so I get the same experience in zsh and fish.

I find I stick to fish more because: 1. has more features that I like out of the box. zsh requires oh-my-zsh to get similar features and that's just another thing for me to install every time. 2. Help menu tab completion. Fish has many completions for common shell apps that will display descriptions from the help menu from just hitting tab. 3. Scripting is much better, while you might not use it much now it much now you don't have a hard corner to cut yourself on if you do need it at some point.


When I evaluated my transition from bash to something else over the years, I found fish to be more cost-effective to maintain. Many times, I only need to install the distro package to feel comfortable, instead of loading all my dotfiles and things like oh-my-zsh.

Out of the box, effortlessly, I have autocompletion for commands; puts tabs/indentation automatically whenever I start an ad-hoc multiline command inside a for/if statement; a color prompt; etc.

I use fisher for plugins and now have more functions in my dotfiles, but it has far fewer dependencies — like 3 or 4 plugins. When I tried zsh, I immediately added several plugins with oh-my-zsh to feel comfortable.

I'm evaluating zellij instead tmux for the same reason. Some extra batteries included for free, but staying simple enough to keep.


Tbh, little, mostly convenience (best metaphor I can give is installing Sublime Text vs manually installing your vim and your own personal configs). By default it supports a bunch of interesting things, autocomplete, iteractive filesystem navigation, theming (I used oh-my-fish in the past, not sure how it is now), etc.

I like it, I would love to run it as my main shell, but I just do too much scripting for my own good to hop on this wagon.


Eh, you can probably get very similar to fish with zsh + loads of plugins, but fish has lots of niceties out of the box (syntax highlighting, autosuggestion based on your directory). I've been using fish + starship with just a fzf plugin and it's got everything I need.

Check it out, it's effective with very little config


Speaking of starship, today I realized that I don't really need any of its features, I just like the way it looks. So I replicated it with pure fish by creating a simple function:

  function fish_prompt
      # Fedora Silverblue workaround
      set -l pwd (string replace /var/home /home $PWD)
  
      echo
      echo -s (set_color -o cyan)(prompt_pwd -D 3 $pwd) (set_color magenta)(fish_vcs_prompt)
      echo -ns (set_color green) "" (set_color normal) " "
  end


For me it's really about the autocomplete.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: