I use iTerm on my mac and ZSH and about my zsh with the theme dstufft
I wrote this in my .bash_rc
function goToPythonApp {
if [ -z "$1" ]; then
cd ~/Documents/Apps/PythonApps
else
cd ~/Documents/Apps/PythonApps/$1
fi
}
so i can print goToPythonApp abc
Then i will switch to ~/Documents/Apps/PythonApps/abc
But sometimes I forget the name of the folder in ~/Documents/Apps/PythonApps/
Is there an input method goToPythonApp, then click <space>, then click <tab>to generate a list of entries in ~/Documents/Apps/PythonApps/?
Similar to how ZSH (or oh-my-zsh) can autocomplete for half-printed commands?
Either this, or I can type goToPythonApp ab, then press <tab>, and automatically complete the sentence abc, which is a valid entry in the folder ~/Documents/Apps/PythonApps/?
UPDATE
The method used suggested in the answer below I received command not found for complete.
autoload bashcompinit && bashcompinit, .bash_rc file
command not found for complete , .