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.

Revisions

  1. vyper created this gist Sep 6, 2013.
    12 changes: 12 additions & 0 deletions sandbox-with-autocomplete.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    # 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