Skip to content

Instantly share code, notes, and snippets.

@vyper
Created September 6, 2013 12:57
Show Gist options
  • Save vyper/6463418 to your computer and use it in GitHub Desktop.
Save vyper/6463418 to your computer and use it in GitHub Desktop.
Use 'sandbox' to change a work directory
# 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