I'm migrating from ZSH to Fish, and the only thing I haven't been able to figure out yet is my c function:
functions/c:
#!/bin/sh
cd "$PROJECTS/$1"
functions/_c:
#compdef c
_files -W $PROJECTS -/
That works nicely on ZSH, I can type c <tab> and it completes as if I was doing cd $PROJECTS directly.
On fish, I created a c.fish like this:
function c
cd $PROJECTS/$argv
end
complete --command c --no-files --arguments='(find $PROJECTS -mindepth 1 -maxdepth 2)'
But as you can imagine, it doesn't work as the ZSH version, as completions don't know about $argv, and won't complete past the first folder.
Is there a way to do the same thing in Fish?
I considered creating an abbr, but I really like the way I have it on ZSH today.