From bd599066d763a0792b6c6b1654f098f3ca6e1df7 Mon Sep 17 00:00:00 2001 From: Carlo Dapor Date: Fri, 12 Aug 2016 20:50:57 +0200 Subject: Added angular-cli (ng) completion. --- plugins/ng/ng.plugin.zsh | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 plugins/ng/ng.plugin.zsh (limited to 'plugins') diff --git a/plugins/ng/ng.plugin.zsh b/plugins/ng/ng.plugin.zsh new file mode 100644 index 000000000..8e9b4ab16 --- /dev/null +++ b/plugins/ng/ng.plugin.zsh @@ -0,0 +1,73 @@ + +ng_opts='addon asset-sizes b build completion d destroy doc e2e g generate get h help i init install lint make-this-awesome new s serve server set t test v version -h --help' + +_ng_completion () { + local words cword opts + read -Ac words + read -cn cword + let cword-=1 + + case $words[cword] in + addon ) + opts='-b --blueprint -d -dir --directory --dry-run -sb --skip-bower -sg --skip-git -sn --skip-npm -v --verbose' + ;; + + asset-sizes ) + opts='-o --output-path' + ;; + + i | install) + opts='' + ;; + + b | build ) + opts='--environment --output-path --suppress-sizes --watch --watcher -dev -e -prod' + ;; + + d | destroy ) + opts='--dry-run --verbose --pod --classic --dummy --in-repo --in-repo-addon -d -v -p -c -dum -id -ir' + ;; + + g | generate ) + opts='component directive pipe route service --generate -d --dry-run --verbose -v --pod -p --classic -c --dummy -dum -id --in-repo --in-repo-addon -ir' + ;; + + h | help | -h | --help) + opts='--json --verbose -v' + ;; + + init ) + opts='--blueprint --dry-run --link-cli --mobile --name --prefix --skip-bower --skip-npm --source-dir --style --verbose -b -d -lc -n -p -sb -sd -sn -v' + ;; + + new ) + opts='--blueprint --directory --dry-run --link-cli --mobile --prefix --skip-bower --skip-git --skip-npm --source-dir --style --verbose -b -d -dir -lc -p -sb -sd -sg -sn -v' + ;; + + s | serve | server ) + opts='--environment --host --insecure-proxy --inspr --live-reload --live-reload-host --live-reload-port --output-path --port --proxy --ssl --ssl-cert --ssl-key --watcher -H -dev -e -lr -lrbu -lrh -lrp -op -out -p -pr -prod -pxy -w' + ;; + + set ) + opts='--global -g' + ;; + + t | test ) + opts='--browsers --colors --config-file --environment --filter --host --launch --log-level --module --path --port --query --reporter --server --silent --test-page --test-port --watch -H -c -cf -e -f -m -r -s -tp -w' + ;; + + v | version ) + opts='--verbose' + ;; + + ng | *) + opts=$ng_opts + ;; + esac + + setopt shwordsplit + reply=($opts) + unset shwordsplit +} + +compctl -K _ng_completion ng -- cgit v1.2.3-70-g09d2 From a748f513a6270fafca8328d614c7200a6f1e7484 Mon Sep 17 00:00:00 2001 From: Carlo Dapor Date: Fri, 12 Aug 2016 21:01:51 +0200 Subject: The argument completion also has no extra options. --- plugins/ng/ng.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/ng/ng.plugin.zsh b/plugins/ng/ng.plugin.zsh index 8e9b4ab16..ce34c8b54 100644 --- a/plugins/ng/ng.plugin.zsh +++ b/plugins/ng/ng.plugin.zsh @@ -16,7 +16,7 @@ _ng_completion () { opts='-o --output-path' ;; - i | install) + completion | i | install) opts='' ;; -- cgit v1.2.3-70-g09d2 From 3da2f7ea6a5aa6ea312846e070b534df5aa78baf Mon Sep 17 00:00:00 2001 From: Carlo Dapor Date: Fri, 12 Aug 2016 23:43:19 +0200 Subject: Updated options for generate. Added gh-pages:deploy / github-pages:deploy. --- plugins/ng/ng.plugin.zsh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'plugins') diff --git a/plugins/ng/ng.plugin.zsh b/plugins/ng/ng.plugin.zsh index ce34c8b54..2488bc230 100644 --- a/plugins/ng/ng.plugin.zsh +++ b/plugins/ng/ng.plugin.zsh @@ -1,5 +1,5 @@ -ng_opts='addon asset-sizes b build completion d destroy doc e2e g generate get h help i init install lint make-this-awesome new s serve server set t test v version -h --help' +ng_opts='addon asset-sizes b build completion d destroy doc e2e g generate get github-pages:deploy gh-pages:deploy h help i init install lint make-this-awesome new s serve server set t test v version -h --help' _ng_completion () { local words cword opts @@ -16,12 +16,8 @@ _ng_completion () { opts='-o --output-path' ;; - completion | i | install) - opts='' - ;; - b | build ) - opts='--environment --output-path --suppress-sizes --watch --watcher -dev -e -prod' + opts='--environment --output-path --suppress-sizes --target --watch --watcher -dev -e -prod' ;; d | destroy ) @@ -29,7 +25,11 @@ _ng_completion () { ;; g | generate ) - opts='component directive pipe route service --generate -d --dry-run --verbose -v --pod -p --classic -c --dummy -dum -id --in-repo --in-repo-addon -ir' + opts='class component directive enum module pipe route service --generate -d --dry-run --verbose -v --pod -p --classic -c --dummy -dum -id --in-repo --in-repo-addon -ir' + ;; + + gh-pages:deploy | github-pages:deploy ) + opts='--environment --gh-token --gh-username --skip-build --user-page --message' ;; h | help | -h | --help) @@ -45,7 +45,7 @@ _ng_completion () { ;; s | serve | server ) - opts='--environment --host --insecure-proxy --inspr --live-reload --live-reload-host --live-reload-port --output-path --port --proxy --ssl --ssl-cert --ssl-key --watcher -H -dev -e -lr -lrbu -lrh -lrp -op -out -p -pr -prod -pxy -w' + opts='--environment --host --insecure-proxy --inspr --live-reload --live-reload-base-url --live-reload-host --live-reload-live-css --live-reload-port --output-path --port --proxy --ssl --ssl-cert --ssl-key --target --watcher -H -dev -e -lr -lrbu -lrh -lrp -op -out -p -pr -prod -pxy -t -w' ;; set ) @@ -60,9 +60,13 @@ _ng_completion () { opts='--verbose' ;; - ng | *) + ng ) opts=$ng_opts ;; + + * ) + opts='' + ;; esac setopt shwordsplit -- cgit v1.2.3-70-g09d2 From 34bc556bd3500da316e020fb2cec3ba8dc6115ab Mon Sep 17 00:00:00 2001 From: Carlo Dapor Date: Mon, 15 Aug 2016 15:27:38 +0200 Subject: Added README.md --- plugins/ng/README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 plugins/ng/README.md (limited to 'plugins') diff --git a/plugins/ng/README.md b/plugins/ng/README.md new file mode 100644 index 000000000..86ad64041 --- /dev/null +++ b/plugins/ng/README.md @@ -0,0 +1,37 @@ +## NG Plugin + +This [ng plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/ng) + adds completion support for Angular's CLI (named ng). + +Ng is hosted on [ng home](https://github.com/catull/angular-cli) + +It is used to generate Angular 2 app "stubs", build those apps, configure them, +test them, lint them etc. + +Ahem, "stubs" is not what Angular engineers refer to the items ng can generate +for you. + +"Stubs" can be any one of: +- class +- component +- directive +- enum +- module +- pipe +- route +- service + +At the moment, `ng completion` creates a very rough completion for Zsh and +Bash. + +It is missing most of the options and a few arguments. +In future, this plugin may be shortened to simply being + +```zsh +eval `ng completion` +``` + +There is hope this materialises in the 21st century. + +### CONTRIBUTOR + - Carlo Dapor ([catull](https://github.com/catull)) -- cgit v1.2.3-70-g09d2 From 904d0ccef9a3508df61f9b0bb784d8b59d5e8bb2 Mon Sep 17 00:00:00 2001 From: Shang Yehua Date: Tue, 6 Sep 2016 11:10:42 +0800 Subject: Add some prompts for "install:install-file" (#5376) Add "-DgroupId= -DartifactId= -Dversion= -Dpackaging=jar -Dfile=" to options for "install:install-file" for when you need install a local jar file. Closes #5376. --- plugins/mvn/mvn.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index d290c98ec..625aad949 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -172,7 +172,7 @@ function listMavenCompletions { gwt:browser gwt:clean gwt:compile gwt:compile-report gwt:css gwt:debug gwt:eclipse gwt:eclipseTest gwt:generateAsync gwt:help gwt:i18n gwt:mergewebxml gwt:resources gwt:run gwt:sdkInstall gwt:source-jar gwt:soyc gwt:test # options - -Dmaven.test.skip=true -DskipTests -DskipITs -Dmaven.surefire.debug -DenableCiProfile -Dpmd.skip=true -Dcheckstyle.skip=true -Dtycho.mode=maven -Dmaven.test.failure.ignore=true + -Dmaven.test.skip=true -DskipTests -DskipITs -Dmaven.surefire.debug -DenableCiProfile -Dpmd.skip=true -Dcheckstyle.skip=true -Dtycho.mode=maven -Dmaven.test.failure.ignore=true -DgroupId= -DartifactId= -Dversion= -Dpackaging=jar -Dfile= # arguments -am -amd -B -C -c -cpu -D -e -emp -ep -f -fae -ff -fn -gs -h -l -N -npr -npu -nsu -o -P -pl -q -rf -s -T -t -U -up -V -v -X -- cgit v1.2.3-70-g09d2 From 1b7fc2f3aca32ba8713be0e27305c5cf578033f6 Mon Sep 17 00:00:00 2001 From: Brad Urani Date: Thu, 22 Sep 2016 10:41:30 -0700 Subject: Add copybuffer function and keybinding (#5431) * Add copybuffer function and keybinding: binds ctrl-o to copy the command line buffer to the system clipboard. * Add README --- plugins/copybuffer/README.md | 11 +++++++++++ plugins/copybuffer/copybuffer.plugin.zsh | 14 ++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 plugins/copybuffer/README.md create mode 100644 plugins/copybuffer/copybuffer.plugin.zsh (limited to 'plugins') diff --git a/plugins/copybuffer/README.md b/plugins/copybuffer/README.md new file mode 100644 index 000000000..da138bdbd --- /dev/null +++ b/plugins/copybuffer/README.md @@ -0,0 +1,11 @@ +# `copybuffer` plugin + +This plugin binds the ctrl-o keyboard shortcut to a command that copies the text +that is currently typed in the command line ($BUFFER) to the system clipboard. + +This is useful if you type a command - and before you hit enter to execute it - want +to copy it maybe so you can paste it into a script, gist or whatnot. + +```zsh +plugins=(... copybuffer) +``` diff --git a/plugins/copybuffer/copybuffer.plugin.zsh b/plugins/copybuffer/copybuffer.plugin.zsh new file mode 100644 index 000000000..cc205d40f --- /dev/null +++ b/plugins/copybuffer/copybuffer.plugin.zsh @@ -0,0 +1,14 @@ +# copy the active line from the command line buffer +# onto the system clipboard (requires clipcopy plugin) + +copybuffer () { + if which clipcopy &>/dev/null; then + echo $BUFFER | clipcopy + else + echo "clipcopy function not found. Please make sure you have Oh My Zsh installed correctly." + fi +} + +zle -N copybuffer + +bindkey "^O" copybuffer -- cgit v1.2.3-70-g09d2