Live data from Hacker News

fish shell

fishshell.com

31–40 of 78 posts

Re: fish shell

#31

I have been using fish for a few months exclusively on my Mac. I really miss a few bashisms: mostly pressing esc-. inserts the last part of the last command. I have not changed the shell on my server, somehow I am afraid of breaking things... (bad shell scripts that don't have correct shebang line).

In fish it's simple enough to start typing the command you want and then hit arrow right to autocomplete. If you have a couple often commands that start the same way just arrow up or down to cycle through them, then arrow right to put them on the command line.

Re: fish shell

#32
post #18

The fact that you cannot redirect stderr to stdout and pipe to another command is a bit of a stumbling point for me. When I saw the bug[1] for the first time I thought that it must be some strange corner case, but it turns out it is a real bug. After reading the bug report I started to wonder if there were any other other unixy features that were missing. I/O redirection is a core unix concept in my opinion. [1] "Red…

It doesn't have process redirection either, and that's one I use a fair bit. For example

    paste 
Where hquery is one of my utilities for running xpath queries over loosely parsed HTML. This would produce a tab-delimited list of link urls to link text.

Re: fish shell

#33
I defined the following function to convert my bash aliases to fish functions, which eased my switchover a bit. I saved it as ~/.config/fish/functions/import_bash_aliases.fish

  function import_bash_aliases --description 'bash aliases to .fish function files.'
      for a in (cat ~/.bashrc  | grep "^alias")
          set aname (echo $a | grep -Eoe "[a-z0-9]+=" | sed 's/=//')
          set command (echo $a | sed 's/^alias .*=//' \
            | sed 's/^ *\'//' | sed 's/\' *$//' )
          echo "Processing alias $aname as $command"
          if test -f ~/.config/fish/functions/$aname.fish
              echo Function $aname is already defined. Skipping...
          else
              alias $aname $command
              funcsave $aname
          end
      end
  end

Re: fish shell

#34
post #11

Why is this interesting when we have zsh? https://github.com/robbyrussell/oh-my-zsh?source=cc

or prezto https://github.com/sorin-ionescu/prezto

One thing I have found with prezto (as well as oh-my-zsh) is that over time, starting up a new terminal window can take a while. On the other hand, when I tried fish, I found certain aspects of it to be sluggish (autocomplete, for example).

Re: fish shell

#35
post #28
post #23

Earlier quoted context omitted.

I know people with well more than that, particularly when you factor in 'oh my zsh' and its ilk.

I am not sure I would include oh-my-zsh as someone's personal zshrc. Moreover I thought OP had made a distinction between bash (10k) and zsh (1k) so I am not sure how o-m-z counts as a bashrc? I will take your word for it but I cant imagine what people put in there bashrc to get to 10k. The entire bash-it repository is 8,588 and over a third of it is bash completions which seems to duplicate the majority of what is a…

Sorry, I'm not the parent commenter.

Re: fish shell

#36
post #9

the developer should provider a converter tool to convert .bashrc/.zshrc to fish config

it looks like a NP-Complete problem

A solution that converted as many easy things as possible and then output anything it couldn't figure out somewhere so you could convert that by hand would still probably be rather useful.

Re: fish shell

#37
post #21

I've been using fish for a while now. Overall it's pretty great. Here's my fish config if you want to see an example: https://bitbucket.org/sjl/dotfiles/src/tip/fish/config.fish

For someone calling fish 'pretty great' I sure see a lot of angst towards fish in that config file! Thanks for the post though.

This config file is glorious. Every other line is just pure gold.

   function fish_user_keybindings
       jesus_fucking_christ_bind_the_fucking_keys_fish
   end

Re: fish shell

#38
I tried fish, last time it was posted. I quickly abandoned it though.

One of my main commandline utilities is git in combination with git-flow(amazing). I found the normal git completion lacking. I believe branches didn't get completed correctly in combination with some commands. The git-flow completion was non existent.

When that changes I might try it again. But for a shell that has tabcompletion as a selling point I was very unimpressed.

Re: fish shell

#39
post #19
post #12

Earlier quoted context omitted.

I am a year-or-two-old fishshell convert who is reasonably well versed in bash and tried using zsh and bash with a big .bashrc. A few things stand out to me as huge pluses: - It has a lot of cool functionality out of the box such as highlighting, smarter autocomplete (type in a partial word at the prompt and hit up instead of the cumbersome bash ctrl r/s history prompt that loves to beep at you), directory history (a…

Do you know anyone with a 10k .bashrc?

My apologies, I was being a little facetious. Just a little. :)

The size difference was based on my intuition that when I maintained my own .bashrc and .zshrc, I was able to "get away" with fewer total lines in my .zshrc than my .bashrc. I remember my .bashrc being dozens of pages, my .zshrc was only a couple.

Compare that to my fish init file...all it does is set a few paths and aliases and turn off the greeting, because everything else just works out of the box for me.

Re: fish shell

#40

Why is this interesting when we have zsh? https://github.com/robbyrussell/oh-my-zsh?source=cc

Why is zsh interesting, when you can have a friendly shell out of the box

https://github.com/bpinto/oh-my-fish

I tried to get started with both. For me fish was by far the easier & more friendly starter. For shell powerusers zsh might be offer more options and less pitfalls.

Post reply on HN