Live data from Hacker News

The fish shell is amazing

rmpr.xyz

131–140 of 302 posts

Re: The fish shell is amazing

#133

Is there anyone who can provide a simple summary for bash v zsh vs fish? Maybe I’m lazy but I’ve just stuck with bash for.. well since ever. Maybe it’s time to try something new but then if it ain’t broke… anyway would be interested in what things it does that I never knew I needed or things which just make life simpler/easier.

Autocomplete is much better. For example, just typing "y" displays "arn start" in gray _after_ my cursor. I can then refine my command, or use right-arrow to accept the suggestion. And this is just one example; fish is full of small usability touches like that. If you need to run a bash script, `bash the_script.sh` still works

Of course you could always just do ctrl+r and cycle through and refine suggestions in bash

Re: The fish shell is amazing

#135
post #55

Earlier quoted context omitted.

Interestingly I moved from such a zsh setup to fish a couple of years back. Zsh with add-ons was noticeably slow compared to fish and syncing the config to all the devices I used.

ZSH plus oh-my-zsh cd’ing into a git repo with large LFS files will hang your shell even on very fast NVME storage.

That’s the git plugin doing it’s thing. You can fix it in config but I admit is an annoying default.

Re: The fish shell is amazing

#136
post #55

Earlier quoted context omitted.

Interestingly I moved from such a zsh setup to fish a couple of years back. Zsh with add-ons was noticeably slow compared to fish and syncing the config to all the devices I used.

ZSH plus oh-my-zsh cd’ing into a git repo with large LFS files will hang your shell even on very fast NVME storage.

You can get reasonable version control integration from zsh without any kind of wild oh-my-zsh config. Most distributed versions of zsh are compiled with vcs_info enabled.

    autoload -Uz vcs_info
    zstyle ':vcs_info:*' enable git hg
    zstyle ':vcs_info:*' check-for-changes true
    zstyle ':vcs_info:git*' formats "%{$fg[cyan]%}(%{$fg[green]%}%s %{$fg[blue]%}%r%{$fg[cyan]%}:%{$fg[green]%}%b%{$fg[yellow]%}%m%u%c%{$fg[cyan]%})%{$reset_color%} "

    setopt prompt_subst
    export PROMPT="%{$fg_bold[red]%}%n%{$reset_color$fg[white]%}@%{$fg_bold[green]%}%m%{$reset_color$fg[white]%}:%{$fg[cyan]%}%1~ \${vcs_info_msg_0_}%{$fg_bold[white]%}%(#.#.\$) %{$reset_color%}"

Re: The fish shell is amazing

#137

It is typical HN that everyone is talking about Zsh and how it isn't so bad. And you know what, I used it for a while long time ago, and it is great. I even had config I could transport to another machine when I need. All that can't be compared with fish out of the box, which is why I am using fish, it will be 10 or so years now. When I say use, I mean that, I just use it, I don't spend time learning it's obscure fea…

where does one put an alias ? i have a collection of them in my .zshrc that i would love to use.

they're just functions so they end up in files in ~/.config/fish/functions/

  $ alias foo bar

  $ function foo --wraps bar --description 'alias foo=bar'
    bar $argv
  end
these two are basically equivalent. you'll need to

  $ funcsave foo
to make it persist. this will write foo.fish into that functions folder.

there's also abbreviations like

  $ abbr --add ll ls -lh
which expand as you type. ll won't end up in your history because it's expanded before that.

Re: The fish shell is amazing

#138

Earlier quoted context omitted.

Oh wow...finally someone is bringing the great ideas of Powershell to unix. Can't wait to see how this turns out.

> great ideas of Powershell to unix Now-If-They-Could-Improve the Syntax To-Make-It-Usable.

At least it's consistent. Verb-Noun
Post reply on HN