Created
September 6, 2013 12:57
-
-
Save vyper/6463418 to your computer and use it in GitHub Desktop.
Use 'sandbox' to change a work directory
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
# sandbox | |
SANDBOX_DIR=~/Documents/Projects/ | |
_sandbox() { | |
local current=${COMP_WORDS[COMP_CWORD]} | |
local options="reset `ls $SANDBOX_DIR`" | |
COMPREPLY=( $(compgen -W "$options" $current) ) | |
} | |
cd_sandbox() { | |
cd $SANDBOX_DIR/$1 | |
} | |
complete -F _sandbox sandbox | |
alias sandbox=cd_sandbox |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment