Started experimenting with #FishShell today, to replace my #zsh when outside of Emacs & Eshell.
-
Gergely Nagy 🐁replied to Gergely Nagy 🐁 last edited by
I might not switch to #FishShell myself (
cd
not auto-suggesting the way I'm used to is a Big Deal), but it will be a perfect shell on Wife's laptop.She's never going to drop into shell herself, but I will, and a stock fish shell will do just fine! Saves me from having to deploy my zsh configuration to her laptop too.
It is also very likely that I will set it as the default shell for the twins, when they get their own computers in a few years time. They likely won't use the shell much either, but if they do, I want them to have something that is friendly out of the box.
-
@algernon
```
zoxide init --cmd cd fish | source
```
zoxide is a phenomenal `cd` modifier. It remembers your most used directories and can fuzzy match them. -
@Brahn Yeah, I'm using that. It makes
cd blah
work, but it does not makecd b
auto-suggestcd blah
. When usingz blah
,z b
will auto-suggestz blah
- I want the same forcd
.cd b<TAB>
does not tab-complete tocd blah
either (I can live with that, I want the auto-suggest, the tab completion is unnecessary).See the zsh & fish comparison video here: https://asciinema.org/a/N2ckKLEnvf9ep5yHfyadfpQzA
-
Gergely Nagy 🐁replied to Gergely Nagy 🐁 last edited by
HAH!
I found the culprit! Fish treats
cd
specially when validating autosuggests, even if I overrode the stockcd
function.I can patch this.
Should I? I dunno. Probably not. But now that I found it, I will. Might even turn it into a settable option and submit it upstream or something.
But I'll check if there's an existing PR or issue about this.
-
@algernon ooh... you want zoxide autocomplete... now I want that.
-
-
@algernon ha! it works!
```
function __zoxide_cd_complete
set -l query (commandline --current-token)
if test -n "$query"
set -l matches (zoxide query --list -- $query)
for match in $matches
echo "$match"
end
end
end# Use zoxide query for cd completions
complete -c cd -f -a '(__zoxide_cd_complete)'
``` -
Gergely Nagy 🐁replied to Gergely Nagy 🐁 last edited by
I did the thing, I patched fish to stop it from special-casing
cd
when validating auto-suggests from history.The raw patch (against 3.7.1, because that is what's in NixOS 24.05) is here.
And with this, it looks like #FishShell will be able to replace #zsh for me too, not just for the rest of the family. I will be experimenting with it for a few more days though, before I commit to it.
-
@algernon If you just wanna get rid of the long direnv output:
```
λ cat ~/.config/direnv/direnv.toml
[global]
hide_env_diff = true
```(needs a recent direnv from this year or so)
-
@jankatins Yep! Was told about that earlier, and am using it now
-
Matija Šukljereplied to Gergely Nagy 🐁 last edited by
@algernon, the only major issue I still have with #FishShell is the lack of alphabet globbing.
Here's the relevant issue and my current workaround:
https://github.com/fish-shell/fish-shell/issues/3681#issuecomment-2341736648 -
Gergely Nagy 🐁replied to Matija Šuklje last edited by
@hook Luckily, I'm not affected. I'm not doing anything serious in neither fish or zsh. Any file renamings or complicated operations are done in Eshell, fish/zsh is only used for some light interactive purposes, where doing it from Emacs would be inconvenient for one reason or another.