Skip to content

Instantly share code, notes, and snippets.

@petehalverson
Created March 1, 2017 23:11
Show Gist options
  • Save petehalverson/89c5127de5944c46920b65567a0e013d to your computer and use it in GitHub Desktop.
Save petehalverson/89c5127de5944c46920b65567a0e013d to your computer and use it in GitHub Desktop.
www
# add to .bashrc, .bash_profile, ~/.profile
www() {
cd ~/www/"$@"
}
_www() {
local cur="${COMP_WORDS[COMP_CWORD]}"
COMPREPLY=( $(compgen -W "$(ls ~/www)" -- $cur) )
}
complete -o default -F _www www
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment