forked from ohmyzsh/ohmyzsh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into personal
* origin/master: Rename getgb plugin to gb Rename gb completion file to more conventional _gb Fix formatting of gb plugin completion Add more information to the README Add README to gb plugin Add plugin for Gb completion (http://getgb.io) bundler plugin: Simplify retrieval of cpu count on OSX (ohmyzsh#5180) Fix gfg function completion definition Fix man-preview completion definition Fix issue with `dash` as the default `/bin/sh` script executing program. (ohmyzsh#5177) znt: update to v2.2.1 (ohmyzsh#5174) emacs plugin tweak to open buffer from stdin (ohmyzsh#5126) Update taskwarrior completion to 2.5.1 (ohmyzsh#5171) Remove undesirable hardcoding of PATH into zshrc (ohmyzsh#4925) Add README for OSX plugin and refactor plugin file Open finder to PWD - part 2 (ohmyzsh#5165) Add ofd() to OSX plugin to open finder on current directory (ohmyzsh#5164) add 'mvn clean install -DskipTests --offline' alias to speed up maven compile (ohmyzsh#5153) Peepcode theme: Don't try to use RVM if it's not available (ohmyzsh#5154) Replace _kitchen completion with the version from zsh-users (ohmyzsh#5011)
- Loading branch information
Showing
20 changed files
with
331 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,28 @@ | ||
#!/bin/sh | ||
|
||
# get list of available X windows. | ||
x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null` | ||
_emacsfun() | ||
{ | ||
# get list of available X windows. | ||
x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null` | ||
|
||
if [ -z "$x" ] || [ "$x" = "nil" ] ;then | ||
# Create one if there is no X window yet. | ||
emacsclient --alternate-editor "" --create-frame "$@" | ||
if [ -z "$x" ] || [ "$x" = "nil" ] ;then | ||
# Create one if there is no X window yet. | ||
emacsclient --alternate-editor "" --create-frame "$@" | ||
else | ||
# prevent creating another X frame if there is at least one present. | ||
emacsclient --alternate-editor "" "$@" | ||
fi | ||
} | ||
|
||
|
||
# adopted from https://github.com/davidshepherd7/emacs-read-stdin/blob/master/emacs-read-stdin.sh | ||
# If the second argument is - then write stdin to a tempfile and open the | ||
# tempfile. (first argument will be `--no-wait` passed in by the plugin.zsh) | ||
if [ "$#" -ge "2" -a "$2" = "-" ] | ||
then | ||
tempfile="$(mktemp emacs-stdin-$USER.XXXXXXX --tmpdir)" | ||
cat - > "$tempfile" | ||
_emacsfun --no-wait $tempfile | ||
else | ||
# prevent creating another X frame if there is at least one present. | ||
emacsclient --alternate-editor "" "$@" | ||
_emacsfun "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# `gb` plugin | ||
|
||
> A project based build tool for the Go programming language. | ||
See https://getgb.io for the full `gb` documentation | ||
|
||
* * * * | ||
|
||
- Adds completion support for all `gb` commands. | ||
- Also supports completion for the [`gb-vendor` plugin](https://godoc.org/github.com/constabulary/gb/cmd/gb-vendor). | ||
|
||
To use it, add `gb` to your plugins array: | ||
```sh | ||
plugins=(... gb) | ||
``` | ||
|
||
## Caveats | ||
|
||
The `git` plugin defines an alias `gb` that usually conflicts with the `gb` program. | ||
If you're having trouble with it, remove it by adding `unalias gb` at the end of your | ||
zshrc file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
#compdef gb | ||
#autoload | ||
|
||
_gb () { | ||
local ret=1 state | ||
_arguments -C ':command:->command' '*::options:->options' && ret=0 | ||
|
||
case $state in | ||
(command) | ||
local -a subcommands | ||
subcommands=( | ||
"build:build a package" | ||
"doc:show documentation for a package or symbol" | ||
"env:print project environment variables" | ||
"generate:generate Go files by processing source" | ||
"help:displays the help" | ||
"info:info returns information about this project" | ||
"list:list the packages named by the importpaths" | ||
"test:test packages" | ||
"vendor:manage your vendored dependencies" | ||
) | ||
_describe -t subcommands 'gb subcommands' subcommands && ret=0 | ||
;; | ||
(options) | ||
case $line[1] in | ||
(build) | ||
_arguments \ | ||
-f'[ignore cached packages]' \ | ||
-F'[do not cache packages]' \ | ||
-q'[decreases verbosity]' \ | ||
-P'[the number of build jobs to run in parallel]' \ | ||
-R'[sets the base of the project root search path]' \ | ||
-dotfile'[output a dot formatted file of the build steps]' \ | ||
-ldflags'["flag list" arguments to pass to the linker]' \ | ||
-gcflags'["arg list" arguments to pass to the compiler]' \ | ||
-race'[enable data race detection]' \ | ||
-tags'["tag list" additional build tags]' | ||
;; | ||
(list) | ||
_arguments \ | ||
-f'[alternate format for the list, using the syntax of package template]' \ | ||
-s'[read format template from STDIN]' \ | ||
-json'[prints output in structured JSON format]' | ||
;; | ||
(test) | ||
_arguments \ | ||
-v'[print output from test subprocess]' \ | ||
-ldflags'["flag list" arguments to pass to the linker]' \ | ||
-gcflags'["arg list" arguments to pass to the compiler]' \ | ||
-race'[enable data race detection]' \ | ||
-tags'["tag list" additional build tags]' | ||
;; | ||
(vendor) | ||
_gb-vendor | ||
esac | ||
;; | ||
esac | ||
|
||
return ret | ||
} | ||
|
||
_gb-vendor () { | ||
local curcontext="$curcontext" state line | ||
_arguments -C ':command:->command' '*::options:->options' | ||
|
||
case $state in | ||
(command) | ||
local -a subcommands | ||
subcommands=( | ||
'delete:deletes a local dependency' | ||
'fetch:fetch a remote dependency' | ||
'list:lists dependencies, one per line' | ||
'purge:remove all unreferenced dependencies' | ||
'restore:restore dependencies from the manifest' | ||
'update:update a local dependency' | ||
) | ||
_describe -t subcommands 'gb vendor subcommands' subcommands && ret=0 | ||
;; | ||
(options) | ||
case $line[1] in | ||
(delete) | ||
_arguments \ | ||
-all'[remove all dependencies]' | ||
;; | ||
(fetch) | ||
_arguments \ | ||
-branch'[fetch from a particular branch]' \ | ||
-no-recurse'[do not fetch recursively]' \ | ||
-tag'[fetch the specified tag]' \ | ||
-revision'[fetch the specific revision from the branch (if supplied)]' \ | ||
-precaire'[allow the use of insecure protocols]' \ | ||
;; | ||
(list) | ||
_arguments \ | ||
-f'[controls the template used for printing each manifest entry]' | ||
;; | ||
(restore) | ||
_arguments \ | ||
-precaire'[allow the use of insecure protocols]' | ||
;; | ||
(update) | ||
_arguments \ | ||
-all'[update all dependencies in the manifest or supply a given dependency]' \ | ||
-precaire'[allow the use of insecure protocols]' | ||
;; | ||
esac | ||
;; | ||
esac | ||
} | ||
|
||
_gb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,85 @@ | ||
# author: Peter Eisentraut | ||
# source: https://gist.github.com/petere/10307599 | ||
# compdef kitchen | ||
#compdef kitchen | ||
# ------------------------------------------------------------------------------ | ||
# Copyright (c) 2014 Github zsh-users - http://github.com/zsh-users | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
# * Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# * Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# * Neither the name of the zsh-users nor the | ||
# names of its contributors may be used to endorse or promote products | ||
# derived from this software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY | ||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
# ------------------------------------------------------------------------------ | ||
# Description | ||
# ----------- | ||
# | ||
# Completion script for Test Kitchen (http://kitchen.ci/). | ||
# | ||
# ------------------------------------------------------------------------------ | ||
# Authors | ||
# ------- | ||
# | ||
# * Peter Eisentraut (https://github.com/petere) | ||
# | ||
# ------------------------------------------------------------------------------ | ||
|
||
|
||
_kitchen() { | ||
local curcontext="$curcontext" state line | ||
typeset -A opt_args | ||
|
||
_arguments '1: :->cmds'\ | ||
'2: :->args' | ||
|
||
case $state in | ||
cmds) | ||
_arguments "1:Commands:(console converge create destroy diagnose driver help init list login setup test verify version)" | ||
;; | ||
args) | ||
case $line[1] in | ||
converge|create|destroy|diagnose|list|setup|test|verify) | ||
compadd "$@" all | ||
_kitchen_instances | ||
;; | ||
login) | ||
_kitchen_instances | ||
;; | ||
esac | ||
;; | ||
esac | ||
local curcontext="$curcontext" state line | ||
typeset -A opt_args | ||
|
||
_arguments '1: :->cmds'\ | ||
'2: :->args' | ||
|
||
case $state in | ||
cmds) | ||
_kitchen_commands | ||
;; | ||
args) | ||
case $line[1] in | ||
converge|create|destroy|diagnose|list|setup|test|verify) | ||
compadd 'all' | ||
_kitchen_instances | ||
;; | ||
login) | ||
_kitchen_instances | ||
;; | ||
esac | ||
;; | ||
esac | ||
} | ||
|
||
_kitchen_commands() { | ||
local commands | ||
|
||
commands=("${(@f)$(_call_program commands $service help | sed -n 's/^ kitchen \([[:alpha:]]*\) [ [].*# \(.*\)$/\1:\2/p')}") | ||
_describe -t commands 'kitchen commands' commands | ||
} | ||
|
||
_kitchen_instances() { | ||
if [[ $_kitchen_instances_cache_dir != $PWD ]]; then | ||
unset _kitchen_instances_cache | ||
fi | ||
if [[ ${+_kitchen_instances_cache} -eq 0 ]]; then | ||
_kitchen_instances_cache=(${(f)"$(bundle exec kitchen list -b 2>/dev/null || kitchen list -b 2>/dev/null)"}) | ||
_kitchen_instances_cache_dir=$PWD | ||
fi | ||
compadd -a _kitchen_instances_cache | ||
if [[ $_kitchen_instances_cache_dir != $PWD ]]; then | ||
unset _kitchen_instances_cache | ||
fi | ||
if [[ ${+_kitchen_instances_cache} -eq 0 ]]; then | ||
_kitchen_instances_cache=(${(f)"$(_call_program instances $service list -b 2>/dev/null)"}) | ||
_kitchen_instances_cache_dir=$PWD | ||
fi | ||
_wanted instances expl 'instance' compadd -a _kitchen_instances_cache | ||
} | ||
|
||
_kitchen "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# OSX plugin | ||
|
||
## Description | ||
|
||
This plugin provides a few utilities to make it more enjoyable on OSX. | ||
|
||
To start using it, add the `osx` plugin to your plugins array in `~/.zshrc`: | ||
|
||
```zsh | ||
plugins=(... osx) | ||
``` | ||
|
||
Original author: [Sorin Ionescu](https://github.com/sorin-ionescu) | ||
|
||
|
||
## Commands | ||
|
||
| Command | Description | | ||
|:--------------|:-----------------------------------------------| | ||
| `tab` | Open the current directory in a new tab | | ||
| `ofd` | Open the current directory in a Finder window | | ||
| `pfd` | Return the path of the frontmost Finder window | | ||
| `pfs` | Return the current Finder selection | | ||
| `cdf` | `cd` to the current Finder directory | | ||
| `pushdf` | `pushd` to the current Finder directory | | ||
| `quick-look` | Quick-Look a specified file | | ||
| `man-preview` | Open a specified man page in Preview app | |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.