diff options
Diffstat (limited to 'plugins/gitignore')
-rw-r--r-- | plugins/gitignore/README.md | 17 | ||||
-rw-r--r-- | plugins/gitignore/gitignore.plugin.zsh | 4 |
2 files changed, 19 insertions, 2 deletions
diff --git a/plugins/gitignore/README.md b/plugins/gitignore/README.md new file mode 100644 index 000000000..753dd31fd --- /dev/null +++ b/plugins/gitignore/README.md @@ -0,0 +1,17 @@ +# gitignore + +This plugin enables you the use of [gitignore.io](https://www.gitignore.io/) from the command line. You need an active internet connection. + +To use it, add `gitignore` to the plugins array in your zshrc file: + +```zsh +plugins=(... gitignore) +``` + +## Plugin commands + +* `gi list`: List all the currently supported gitignore.io templates. + +* `gi [TEMPLATENAME]`: Show git-ignore output on the command line, e.g. `gi java` to exclude class and package files. + +* `gi [TEMPLATENAME] >> .gitignore`: Appending programming language settings to your projects .gitignore. diff --git a/plugins/gitignore/gitignore.plugin.zsh b/plugins/gitignore/gitignore.plugin.zsh index 481d487ba..15e38d3b7 100644 --- a/plugins/gitignore/gitignore.plugin.zsh +++ b/plugins/gitignore/gitignore.plugin.zsh @@ -1,7 +1,7 @@ -function gi() { curl -sL https://www.gitignore.io/api/$@ ;} +function gi() { curl -fL https://www.gitignore.io/api/${(j:,:)@} } _gitignoreio_get_command_list() { - curl -sL https://www.gitignore.io/api/list | tr "," "\n" + curl -sfL https://www.gitignore.io/api/list | tr "," "\n" } _gitignoreio () { |