17 ms·
Similarly, project autocompletion for the directory where I do my web dev ... export SITES=$HOME/Sites # Plural to cd and list contents alias sites="cd
by skoskie 6y ago
Similarly, project autocompletion for the directory where I do my web dev ...
export SITES=$HOME/Sites
# Plural to cd and list contents
alias sites="cd $SITES; ll"
# Singular to access a particular project
site() { cd $SITES/$1; }
# Autocomplete function
_site() { _directories -W $SITES -/; }
compdef _site site
It works from within any directory, which is nice.
site f[tab][enter]
takes me to
$SITES/foo/