Skip to content

Instantly share code, notes, and snippets.

@subhaze
Created April 12, 2016 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save subhaze/08fce76f52917bc7e7636993514a9935 to your computer and use it in GitHub Desktop.
Save subhaze/08fce76f52917bc7e7636993514a9935 to your computer and use it in GitHub Desktop.
command to quickly cd to a site directory, with autocomplete
site(){
cd ~/Sites/$1
}
_site()
{
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "$(ls ~/Sites/)" -- $cur) )
}
complete -F _site site
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment