Created
April 12, 2016 14:10
-
-
Save subhaze/08fce76f52917bc7e7636993514a9935 to your computer and use it in GitHub Desktop.
command to quickly cd to a site directory, with autocomplete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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