Hacker News new | ask | show | jobs
by mejutoco 1940 days ago
Fish is my shell of choice, like many in this thread. To me it just works, without configuring anything (ok, maybe a couple of aliases), with great defaults.

As an example, type anything(for instance, '.conf') + up arrow, and there you see all the completions (for instance, 'less /etc/postgresql/10/main/pg_hba.conf' shows for me) based on the shell history. You can then cycle through them with up/down arrows. It is the same as ctrl+R in bash, but so discoverable and plain. I found tons of similar details in fish.

Edit: typos

4 comments

>without configuring anything

and if you want to configure stuff it actually also has a neat ui built in with fish_config

> As an example, type anything(for instance, '.conf') + up arrow, and there you see all the completions (for instance, 'less /etc/postgresql/10/main/pg_hba.conf' shows for me) based on the shell history. You can then cycle through them with up/down arrows. It is the same as ctrl+R in bash, but so discoverable and plain. I found tons of similar details in fish.

Fun anecdote: my school's crappy homebrew distribution had a bash plugin that did exactly that (it was the distro's one redeeming feature, honestly).

After I moved to other distros, I missed that feature for years (I hate Ctrl+R).

Looking for plugins that implemented it was how I found fish, and I never looked back.

It really is my pet peeve with fish, but the last command that started with what you typed cannot be completed that way. For that, you need to use right-arrow.

I kept a fork of fish for that purpose for some time, but that was really too much hassle and I went back to zsh.

Which is pretty sad, because otherwise fish is amazing.

ctrl + e or end will complete commands in that case
IIUC, right-arrow also does, and option-right-arrow will complete individual arguments from the last command one by one (macOS).
For this specific use-case, ctrl+R + fzf works nicely.
We’ve added some improvements in this release that should make that a better experience by improving the performance of `history` when piped to fzf (or anything else). The output was previously buffered and GNU wide character comparison/conversion is insanely slow so that had to be hacked around.