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

Fish is great. For those wondering what advantages is has over zsh+ohmyzsh, I can say is that by default it provides most the functionality you want without having to install/tweak anything. Git support is built in (you get a nice git prompt) there's syntax highlighting, amazing history completion, predictive commands, man page completions... and so on. To try it on linux, just install fish and then run "fish", to get back to to bash/zsh just "exit"

Only problem is it's not POSIX so there is some weirdness in command substitution, logical operators and stuff. So you still script in sh.



That was precisely my first question, so thanks for the answer, but I don't really see how that's enough to switch… I've been using this "cleaned up/opinionated" fork 'Prezto' for a while now: https://github.com/sorin-ionescu/prezto

If I'm motivated enough to download and install a shell, why wouldn't I just clone Prezto and change one config file to turn on syntax highlighting and git support? Especially when it doesn't bring any "weirdness in command substitution" and I get the great zsh expansions and completions?

Anyways, I'll try it out (why not?) but the benefit to me wasn't clear from the page, and even with your direct clarification here I'm seeing more downsides than zsh + Prezto and not a significant upside.


It's been many years since I've use zsh, so I won't pretend to know what's state of the art with it. I will say that one of the reasons I use fish is it's incredibly easy to customize. My old bash config just came along with me from years of use. Some of it I understood, some of it was just culled from the Internet and kept working, so I kept around (see: prompt customization). But, other than simple aliases, env var setting, and the occasional function, I didn't bother much with shell customization. I find fish simple enough that I can write a new function or tab completion and not have to spend a day figuring out the bash syntax again.

Writing tab completions in fish is really, really simple. It's the thing that initially sold me and it's kept me hooked.

The history is more powerful than bash, too. Although I find it sometimes works against me. E.g., since it tries to guess your command, things you type in lowercase suddenly turn to uppercase until you manage to disambiguate from a previous command.

If you're looking for plugins, there's oh-my-fish [1]. Years back, the term "fish-nuggets" was popular and you'll find repos named that on GitHub with other configuration. I use a couple plugins, but for the most part I don't need them. I think part of that is because fish is featureful out of the box and part of it is because customizing is so easy. I'll usually just add what I need myself rather than trying to find a general purpose plugin.

Anyway, not a direct answer to your question -- apologies for that. Hopefully something in there is of use for you, however.

[1] -- https://github.com/bpinto/oh-my-fish


As someone who spends half of my workday in a shell, but doesn't often _code_ in shell, I find "it's not POSIX" to be the advantage.

Loop constructs and defining temporary functions in particular seem much more natural to my brain.

I used it as my main shell for about two years (on OSX even), but had to give it up due to a broken command-not-found handler (long story, but increased my quality of life with non-global bundler so much I went back to zsh).


> Only problem is it's not POSIX so there is some weirdness in command substitution, logical operators and stuff. So you still script in sh.

Yeah some wild-card matching stuff doesn't work, also for example expanding `pkg-config --cflags gobject-2.0` as one would in bash requires calling eval gcc.

On the other-hand it's not like Bash doesn't have weird gotcha's -- for example does anyone remember which of these is a valid conditional?

  string='Foo Bar';
  if [[ *"Foo"* == $string ]]
  if [[ $string == *"Foo"* ]]


I'm never sure when these plugs become too much, but...

I created a language called bish that allows you to write your shell scripts in a sane and comfortable syntax. No more remembering which one of those conditionals to use! Bish compiles to bash, so you also get to keep all of the portability that comes with bash scripts. I haven't had much time to work on it recently, and it's still missing some features, but it's ready to use now:

https://github.com/tdenniston/bish


> I'm never sure when these plugs become too much, but...

Long ago. IIRC this is the thing that translates something looking sort of like a subset of (Python? Haskell? C? I can't remember which.) into mostly-working Bash. It's a terrible idea.




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

Search: