Skip to content

Instantly share code, notes, and snippets.

@YodasWs
Created February 3, 2019 13:37
Show Gist options
  • Save YodasWs/3fb981b0ae8725faa00000525ffab838 to your computer and use it in GitHub Desktop.
Save YodasWs/3fb981b0ae8725faa00000525ffab838 to your computer and use it in GitHub Desktop.
# Gulp Completion
# Sam Grundman <sam-github@yodas.ws>
#
# This will auto-complete your Gulp task names when you hit tab!
#
# License: CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
#
# Installation
# 1. Save to ~/
# 2. in .bashrc:
# source ~/gulp-completion.sh
function _gulp_completions() {
# Get all gulp tasks as known by gulp
gulp_tasks=`gulp --tasks-simple`
# Without this autocompletion would not work for colons
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
# Tell complete what stuff to show.
COMPREPLY=($(compgen -W "$gulp_tasks" -- "$cur"))
}
complete -o default -F _gulp_completions gulp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment