Skip to content

Instantly share code, notes, and snippets.

@jgeewax
Created August 20, 2010 23:24
Show Gist options
  • Save jgeewax/541410 to your computer and use it in GitHub Desktop.
Save jgeewax/541410 to your computer and use it in GitHub Desktop.
_jumpto() {
local IFS=$'\t\n'
local dirs=("$HOME/workspace/")
COMPREPLY=( $(
for dir in "${dirs}"; do
cd "$dir" 2 >/dev/null &&
compgen -d -- "${COMP_WORDS[COMP_CWORD]}"
done
) )
return 0
}
complete -o filenames -o nospace -F _jumpto jumpto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment