Skip to content

Instantly share code, notes, and snippets.

@vgaicuks
Created March 19, 2019 16:08
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 vgaicuks/26e09e13e864ebf9d20f76cebf6b49fa to your computer and use it in GitHub Desktop.
Save vgaicuks/26e09e13e864ebf9d20f76cebf6b49fa to your computer and use it in GitHub Desktop.
Project autocomplete
#!/bin/bash
_projects()
{
local curw
COMPREPLY=()
curw=${COMP_WORDS[COMP_CWORD]}
local projects=$(ls -1 ~/code)
COMPREPLY=($(compgen -W "$projects" -- $curw));
return 0
}
complete -o default -F _projects c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment