Created
April 21, 2011 22:34
-
-
Save rondevera/935626 to your computer and use it in GitHub Desktop.
project_completion.bash
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
cdp(){ | |
# For changing directly to a specific project's directory. | |
# Usage: `cdp bloombox` | |
local proj=$1 | |
c "/Users/ron/Documents/Projects/$proj/" | |
settabtitle $proj | |
} | |
_cdp(){ | |
# Tab completion routine for `cdp`: | |
COMPREPLY=() | |
local cur="${COMP_WORDS[COMP_CWORD]}" | |
local words=$(ls -1p ~/Documents/Projects | grep /$ | sed "s/\/$//") | |
COMPREPLY=($(compgen -W "${words}" -- "$cur")) | |
} | |
complete -F _cdp -o nospace cdp # Enables tab completion for `cdp` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment