mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-01-20 17:26:32 +01:00
21 lines
395 B
Bash
21 lines
395 B
Bash
# gitignore plugin for oh-my-zsh
|
|
# Uses gitignore.io CDN endpoint
|
|
function _gi_curl() {
|
|
curl -sfL "https://www.gitignore.io/api/$1"
|
|
}
|
|
|
|
function gi() {
|
|
local query="${(j:,:)@}"
|
|
_gi_curl "$query" || return 1
|
|
}
|
|
|
|
_gitignoreio_get_command_list() {
|
|
_gi_curl "list" | tr "," "\n"
|
|
}
|
|
|
|
_gitignoreio () {
|
|
compset -P '*,'
|
|
compadd -S '' $(_gitignoreio_get_command_list)
|
|
}
|
|
|
|
compdef _gitignoreio gi |