Created
September 22, 2012 22:27
-
-
Save jeremyf/3768044 to your computer and use it in GitHub Desktop.
bash-completion
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
# project completion for Sublime projects by Jeremy Friesen <jeremy.n.friesen@gmail.com> | |
function _project { | |
local cur | |
COMPREPLY=() | |
_get_comp_words_by_ref cur | |
COMPREPLY=( $(find $HOME/Repositories -type d -maxdepth 1 -mindepth 1 -exec basename {} \; | egrep "^$cur")) | |
} | |
complete -F _project -o default project | |
# Assumes that $HOME/Repositories houses all of your project repositories. | |
# Assumes `project` accepts one for a directory that is in the | |
# $HOME/Repositories directory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment