Last active
August 29, 2015 14:05
-
-
Save adamwalter/52a3e520aa24b1069a26 to your computer and use it in GitHub Desktop.
cd into custom directory with tab autocomplete of its subdirectories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_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