Hacker News new | ask | show | jobs
by robochat 1227 days ago
You can easily get bash to do that by adding these lines to your .inputrc file.

  "\e[A": history-search-backward
  "\e[B": history-search-forward
  "\e[C": forward-char
  "\e[D": backward-char
5 comments

Most things in fish can be achieved with customization and configuration in other shells, like zsh or bash.

The point of fish is a sane set of defaults that doesn't require customization and is good enough.

Best feature of fish is the fact that my fish dotfiles are about 100loc max with a fully async prompt.

Comparable functionality in zsh would be 500loc of ultra obscure tweaks :)

What do you mean by "fully async prompt"?
https://github.com/mattgreen/lucid.fish

It avoids pauses when doing `git status` on gigantic repos.

They are explicitly against configuration options though. Good luck if their opinions about what's sane doesn't match your own. By the way I have that feature in zsh myself. Quite useful.
> Good luck if their opinions about what's sane doesn't match your own.

Thank you, and yes, that's when you don't use fish.

The point of fish is being for people who are fine with the defaults set by the authors. It's the core selling point.

If you want zsh that acts like fish, try "fizsh".
That is so cool, people really think of everything don't they?
I checked fizsh out and the installation on Ubuntu was broken (from the package in the repo), the last commit to the repo was in 2016... It seemed promising at first but these things are all about continued investment and maintenance.
Not wrong, but fish is so nice because it just works without any configuration. Sane defaults are a blessing.

I just checked and the only things I have configured are `set fish_greeting` (i.e. empty) and some paths...

Edit: Also, I don't know how, but the fish completion is magic. It seems to remember which commands I use often in which folders and in which order. I'm not sure if that's how it's implemented. Sure feels that way though.

> It seems to remember which commands I use often in which folders and in which order. I'm not sure if that's how it's implemented. Sure feels that way though.

Check ~/.local/share/fish/fish_history!

Fish shell search and suggestions are awesome, and not comparable to what readline gives you. I don't know how it does that, but the shell understands the concept of files, commands in PATH, and CWD. So depending on the directory you are in, after typing "vim " you will get different suggestions (completable by right arrow). Somehow it knows what I mean 80% of the time.
Nice to know!

Nonetheless, what moved me from bash to fish was having this as granted. Now I worry only about specific higher-level functions. Also hunting each of these optimizations distracts me from my task at hand.

There's other stuff as well, for instance I'm abusing `for` iterations a lot more to run the same command for lists of things. Using bash before was less ergonomic and painful.

You need to restart bash to make this work. Cool.