1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-22 22:00:08 +00:00
ohmyzsh/plugins/gitignore/gitignore.plugin.zsh
low-ghost 494b07b093 Update gitignore.plugin: comma separated arguments
Seems like this is more like the intended effect, splits arguments with commas
for proper gitignore.io api request.
Thanks for teaching me about custom compdef completions!

Updated with zsh join operator by Marc Cornellà
2016-01-18 21:54:10 +01:00

12 lines
275 B
Bash

function gi() { curl -sL https://www.gitignore.io/api/${(j:,:)@} }
_gitignoreio_get_command_list() {
curl -sL https://www.gitignore.io/api/list | tr "," "\n"
}
_gitignoreio () {
compset -P '*,'
compadd -S '' `_gitignoreio_get_command_list`
}
compdef _gitignoreio gi