From 33b1a3bcfed1d52d48a3a467f81da1599d2fa883 Mon Sep 17 00:00:00 2001 From: futjikato Date: Fri, 4 Oct 2013 22:29:33 +0200 Subject: [PATCH 1/2] Added gitignore plugin ( for gitignore.io ) --- custom/plugins/gitignore/gitignore.plugin.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 custom/plugins/gitignore/gitignore.plugin.zsh diff --git a/custom/plugins/gitignore/gitignore.plugin.zsh b/custom/plugins/gitignore/gitignore.plugin.zsh new file mode 100644 index 000000000..1b866c0d0 --- /dev/null +++ b/custom/plugins/gitignore/gitignore.plugin.zsh @@ -0,0 +1,11 @@ +function gi() { curl http://gitignore.io/api/$@ ;} + +_gitignireio_get_command_list() { + curl -s http://gitignore.io/api/list | tr "," "\n" +} + +_gitignireio () { + compadd `_gitignireio_get_command_list` +} + +compdef _gitignireio gi \ No newline at end of file From 9afb139d20f12f93c086140db3e9bfd4913f15a0 Mon Sep 17 00:00:00 2001 From: futjikato Date: Sat, 5 Oct 2013 00:56:17 +0200 Subject: [PATCH 2/2] Updated completion to work with comma seperated list --- custom/plugins/gitignore/gitignore.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom/plugins/gitignore/gitignore.plugin.zsh b/custom/plugins/gitignore/gitignore.plugin.zsh index 1b866c0d0..332497cec 100644 --- a/custom/plugins/gitignore/gitignore.plugin.zsh +++ b/custom/plugins/gitignore/gitignore.plugin.zsh @@ -5,7 +5,8 @@ _gitignireio_get_command_list() { } _gitignireio () { - compadd `_gitignireio_get_command_list` + compset -P '*,' + compadd -S '' `_gitignireio_get_command_list` } compdef _gitignireio gi \ No newline at end of file