Last active
February 24, 2017 19:23
-
-
Save EdwardDrapkin/a936df8abefb56636d7dd5b4f93428da to your computer and use it in GitHub Desktop.
This file contains hidden or 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
_complete_proj() { | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
opts=$( find -X ~/projects -name ${cur}* -maxdepth 1 -type d -prune | xargs basename ) | |
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) | |
return 0; | |
} | |
proj() { | |
cd ~/projects/$1 | |
} | |
complete -F _complete_proj proj | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment