Skip to content

Instantly share code, notes, and snippets.

@adamwalter
Last active August 29, 2015 14:05
Show Gist options
  • Save adamwalter/52a3e520aa24b1069a26 to your computer and use it in GitHub Desktop.
Save adamwalter/52a3e520aa24b1069a26 to your computer and use it in GitHub Desktop.
cd into custom directory with tab autocomplete of its subdirectories
_dirComplete()
{
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "$(ls ~/public_html/dev/)" -- $cur) )
}
complete -F _dirComplete cddev
cdDev() {
cd ~/public_html/dev/$1
}
alias cddev=cdDev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment