summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/copybuffer/README.md11
-rw-r--r--plugins/copybuffer/copybuffer.plugin.zsh14
-rw-r--r--plugins/docker/_docker13
-rw-r--r--plugins/git/git.plugin.zsh1
-rw-r--r--plugins/mvn/mvn.plugin.zsh2
-rw-r--r--plugins/ng/README.md37
-rw-r--r--plugins/ng/ng.plugin.zsh77
-rw-r--r--plugins/npm/npm.plugin.zsh6
-rw-r--r--plugins/perms/perms.plugin.zsh12
-rw-r--r--plugins/rails/rails.plugin.zsh1
-rw-r--r--plugins/xcode/README.md2
-rw-r--r--plugins/xcode/xcode.plugin.zsh13
12 files changed, 174 insertions, 15 deletions
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
diff --git a/plugins/docker/_docker b/plugins/docker/_docker
index 66dfeea9e..1366fd61b 100644
--- a/plugins/docker/_docker
+++ b/plugins/docker/_docker
@@ -228,7 +228,7 @@ __docker_get_log_options() {
journald_options=("env" "labels" "tag")
json_file_options=("env" "labels" "max-file" "max-size")
syslog_options=("env" "labels" "syslog-address" "syslog-facility" "syslog-format" "syslog-tls-ca-cert" "syslog-tls-cert" "syslog-tls-key" "syslog-tls-skip-verify" "tag")
- splunk_options=("env" "labels" "splunk-caname" "splunk-capath" "splunk-format" "splunk-index" "splunk-insecureskipverify" "splunk-source" "splunk-sourcetype" "splunk-token" "splunk-url" "splunk-verify-connection" "tag")
+ splunk_options=("env" "labels" "splunk-caname" "splunk-capath" "splunk-format" "splunk-gzip" "splunk-gzip-level" "splunk-index" "splunk-insecureskipverify" "splunk-source" "splunk-sourcetype" "splunk-token" "splunk-url" "splunk-verify-connection" "tag")
[[ $log_driver = (awslogs|all) ]] && _describe -t awslogs-options "awslogs options" awslogs_options "$@" && ret=0
[[ $log_driver = (fluentd|all) ]] && _describe -t fluentd-options "fluentd options" fluentd_options "$@" && ret=0
@@ -434,7 +434,7 @@ __docker_complete_events_filter() {
(event)
local -a event_opts
event_opts=('attach' 'commit' 'connect' 'copy' 'create' 'delete' 'destroy' 'detach' 'die' 'disconnect' 'exec_create' 'exec_detach'
- 'exec_start' 'export' 'import' 'kill' 'load' 'mount' 'oom' 'pause' 'pull' 'push' 'reload' 'rename' 'resize' 'restart' 'save' 'start'
+ 'exec_start' 'export' 'health_status' 'import' 'kill' 'load' 'mount' 'oom' 'pause' 'pull' 'push' 'reload' 'rename' 'resize' 'restart' 'save' 'start'
'stop' 'tag' 'top' 'unmount' 'unpause' 'untag' 'update')
_describe -t event-filter-opts "event filter options" event_opts && ret=0
;;
@@ -792,7 +792,7 @@ __docker_node_commands() {
"ls:List nodes in the swarm"
"promote:Promote a node as manager in the swarm"
"rm:Remove one or more nodes from the swarm"
- "ps:List tasks running on a node"
+ "ps:List tasks running on a node, defaults to current node"
"update:Update a node"
)
_describe -t docker-node-commands "docker node command" _docker_node_subcommands
@@ -1083,6 +1083,7 @@ __docker_service_subcommand() {
"($help)*--constraint=[Placement constraints]:constraint: "
"($help)--endpoint-mode=[Placement constraints]:mode:(dnsrr vip)"
"($help)*"{-e=,--env=}"[Set environment variables]:env: "
+ "($help)*--group-add=[Add additional user groups to the container]:group:_groups"
"($help)*--label=[Service labels]:label: "
"($help)--limit-cpu=[Limit CPUs]:value: "
"($help)--limit-memory=[Limit Memory]:value: "
@@ -1177,6 +1178,7 @@ __docker_service_subcommand() {
"($help)--arg=[Service command args]:arguments: _normal" \
"($help)*--container-label-add=[Add or update container labels]:label: " \
"($help)*--container-label-rm=[Remove a container label by its key]:label: " \
+ "($help)*--group-rm=[Remove previously added user groups from the container]:group:_groups" \
"($help)--image=[Service image tag]:image:__docker_repositories" \
"($help -)1:service:__docker_complete_services" && ret=0
;;
@@ -1658,7 +1660,8 @@ __docker_subcommand() {
$opts_help \
"($help)*"{-f=,--filter=}"[Filter values]:filter:__docker_complete_events_filter" \
"($help)--since=[Events created since this timestamp]:timestamp: " \
- "($help)--until=[Events created until this timestamp]:timestamp: " && ret=0
+ "($help)--until=[Events created until this timestamp]:timestamp: " \
+ "($help)--format=[Format the output using the given go template]:template: " && ret=0
;;
(exec)
local state
@@ -1701,7 +1704,7 @@ __docker_subcommand() {
"($help -a --all)"{-a,--all}"[Show all images]" \
"($help)--digests[Show digests]" \
"($help)*"{-f=,--filter=}"[Filter values]:filter:->filter-options" \
- "($help)--format[Pretty-print containers using a Go template]:template: " \
+ "($help)--format[Pretty-print images using a Go template]:template: " \
"($help)--no-trunc[Do not truncate output]" \
"($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \
"($help -): :__docker_repositories" && ret=0
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index 6197c234b..25da03509 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -46,6 +46,7 @@ alias gapa='git add --patch'
alias gb='git branch'
alias gba='git branch -a'
+alias gbd='git branch -d'
alias gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d'
alias gbl='git blame -b -w'
alias gbnm='git branch --no-merged'
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
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))
diff --git a/plugins/ng/ng.plugin.zsh b/plugins/ng/ng.plugin.zsh
new file mode 100644
index 000000000..2488bc230
--- /dev/null
+++ b/plugins/ng/ng.plugin.zsh
@@ -0,0 +1,77 @@
+
+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
+ 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'
+ ;;
+
+ b | build )
+ opts='--environment --output-path --suppress-sizes --target --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='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)
+ 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-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 )
+ 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
+ ;;
+
+ * )
+ opts=''
+ ;;
+ esac
+
+ setopt shwordsplit
+ reply=($opts)
+ unset shwordsplit
+}
+
+compctl -K _ng_completion ng
diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh
index 02e4f3e93..43aedc36d 100644
--- a/plugins/npm/npm.plugin.zsh
+++ b/plugins/npm/npm.plugin.zsh
@@ -32,6 +32,12 @@ alias npmE='PATH="$(npm bin)":"$PATH"'
# Check which npm modules are outdated
alias npmO="npm outdated"
+# Check package versions
+alias npmV="npm -v"
+
+# List packages
+alias npmL="npm list"
+
# Run npm start
alias npmst="npm start"
diff --git a/plugins/perms/perms.plugin.zsh b/plugins/perms/perms.plugin.zsh
index 81f56d577..7cdebab7f 100644
--- a/plugins/perms/perms.plugin.zsh
+++ b/plugins/perms/perms.plugin.zsh
@@ -6,10 +6,10 @@
### Aliases
# Set all files' permissions to 644 recursively in a directory
-alias set644='find . -type f -print0 | xargs -0 chmod 644'
+alias set644='find . -type f ! -perm 644 -print0 | xargs -0 chmod 644'
# Set all directories' permissions to 755 recursively in a directory
-alias set755='find . -type d -print0 | xargs -0 chmod 755'
+alias set755='find . -type d ! -perm 755 -print0 | xargs -0 chmod 755'
### Functions
@@ -63,14 +63,14 @@ EOF
exit_status=0;
if [[ $use_slow == true ]]; then
# Process directories first so non-traversable ones are fixed as we go
- find "$target" -type d -exec chmod $chmod_opts 755 {} \;
+ find "$target" -type d ! -perm 755 -exec chmod $chmod_opts 755 {} \;
if [[ $? != 0 ]]; then exit_status=$?; fi
- find "$target" -type f -exec chmod $chmod_opts 644 {} \;
+ find "$target" -type f ! -perm 644 -exec chmod $chmod_opts 644 {} \;
if [[ $? != 0 ]]; then exit_status=$?; fi
else
- find "$target" -type d -print0 | xargs -0 chmod $chmod_opts 755
+ find "$target" -type d ! -perm 755 -print0 | xargs -0 chmod $chmod_opts 755
if [[ $? != 0 ]]; then exit_status=$?; fi
- find "$target" -type f -print0 | xargs -0 chmod $chmod_opts 644
+ find "$target" -type f ! -perm 644 -print0 | xargs -0 chmod $chmod_opts 644
if [[ $? != 0 ]]; then exit_status=$?; fi
fi
echo "Complete"
diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
index e532639b5..c8974b5f4 100644
--- a/plugins/rails/rails.plugin.zsh
+++ b/plugins/rails/rails.plugin.zsh
@@ -36,6 +36,7 @@ alias -g RET='RAILS_ENV=test'
# Rails aliases
alias rc='rails console'
+alias rcs='rails console --sandbox'
alias rd='rails destroy'
alias rdb='rails dbconsole'
alias rg='rails generate'
diff --git a/plugins/xcode/README.md b/plugins/xcode/README.md
index 15e657859..c12ce047f 100644
--- a/plugins/xcode/README.md
+++ b/plugins/xcode/README.md
@@ -26,7 +26,7 @@ plugins=(... xcode)
### `xc`
-Opens the current directory in Xcode as an Xcode project. This will open one of the `.xcworkspace` and `.xcodeproj` files that it can find in the current working directory.
+Opens the current directory in Xcode as an Xcode project. This will open one of the `.xcworkspace` and `.xcodeproj` files that it can find in the current working directory. You can also specify a directory to look in for the Xcode files.
Returns 1 if it didn't find any relevant files.
### `simulator`
diff --git a/plugins/xcode/xcode.plugin.zsh b/plugins/xcode/xcode.plugin.zsh
index 0a2fa0839..f711c39fb 100644
--- a/plugins/xcode/xcode.plugin.zsh
+++ b/plugins/xcode/xcode.plugin.zsh
@@ -7,10 +7,19 @@ alias xcsel='sudo xcode-select --switch'
# source: http://gist.github.com/subdigital/5420709
function xc {
local xcode_proj
- xcode_proj=(*.{xcworkspace,xcodeproj}(N))
+ if [[ $# == 0 ]]; then
+ xcode_proj=(*.{xcworkspace,xcodeproj}(N))
+ else
+ xcode_proj=($1/*.{xcworkspace,xcodeproj}(N))
+ fi
+
if [[ ${#xcode_proj} -eq 0 ]]; then
- echo "No xcworkspace/xcodeproj file found in the current directory."
+ if [[ $# == 0 ]]; then
+ echo "No xcworkspace/xcodeproj file found in the current directory."
+ else
+ echo "No xcworkspace/xcodeproj file found in $1."
+ fi
return 1
else
echo "Found ${xcode_proj[1]}"