4
I have an function in my .zshrc
called c
that is defined like so
c() {
cd ~/Code/$1
}
How can I teach ZSH to treat this c
function just like I had done cd ~/Code
from the command line so that it completes the projects underneath?
4
I have an function in my .zshrc
called c
that is defined like so
c() {
cd ~/Code/$1
}
How can I teach ZSH to treat this c
function just like I had done cd ~/Code
from the command line so that it completes the projects underneath?
2
I found the answer through another search just now. From this answer on Stack Overflow, I added the following to my .zshrc
compctl -/ -W ~/Code c
-/
tells compctl
to just complete file system paths-W
tells compctl
to implicitly add the value ~/Code
to the front of the completion.c
is the thing to complete