summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/brew/_brew3
-rw-r--r--plugins/bundler/bundler.plugin.zsh10
-rw-r--r--plugins/docker/README.md19
-rw-r--r--plugins/docker/_docker290
-rw-r--r--plugins/git-flow/git-flow.plugin.zsh6
-rw-r--r--plugins/git/_git-branch21
-rw-r--r--plugins/git/git.plugin.zsh25
-rw-r--r--plugins/jump/jump.plugin.zsh52
-rw-r--r--plugins/mosh/mosh.plugin.zsh2
-rw-r--r--plugins/pod/_pod381
-rw-r--r--plugins/rails3/rails3.plugin.zsh6
-rw-r--r--plugins/tmux/tmux.plugin.zsh2
-rw-r--r--plugins/web-search/web-search.plugin.zsh21
13 files changed, 827 insertions, 11 deletions
diff --git a/plugins/brew/_brew b/plugins/brew/_brew
index e43ba2900..bf0a286c1 100644
--- a/plugins/brew/_brew
+++ b/plugins/brew/_brew
@@ -28,6 +28,7 @@ _1st_arguments=(
'missing:check all installed formuale for missing dependencies.'
'outdated:list formulas for which a newer version is available'
'prune:remove dead links'
+ 'reinstall:reinstall a formula'
'remove:remove a formula'
'search:search for a formula (/regex/ or string)'
'server:start a local web app that lets you browse formulae (requires Sinatra)'
@@ -75,7 +76,7 @@ case "$words[1]" in
install|home|homepage|log|info|abv|uses|cat|deps|edit|options|versions)
_brew_all_formulae
_wanted formulae expl 'all formulae' compadd -a formulae ;;
- remove|rm|uninstall|unlink|cleanup|link|ln)
+ reinstall|remove|rm|uninstall|unlink|cleanup|link|ln)
_brew_installed_formulae
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
esac
diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
index c01241409..1e70db6af 100644
--- a/plugins/bundler/bundler.plugin.zsh
+++ b/plugins/bundler/bundler.plugin.zsh
@@ -1,10 +1,17 @@
alias be="bundle exec"
-alias bi="bundle install"
alias bl="bundle list"
alias bp="bundle package"
alias bo="bundle open"
alias bu="bundle update"
+if [[ "$(uname)" == 'Darwin' ]]
+then
+ local cores_num="$(sysctl hw.ncpu | awk '{print $2}')"
+else
+ local cores_num="$(nproc)"
+fi
+eval "alias bi='bundle install --jobs=$cores_num'"
+
# The following is based on https://github.com/gma/bundler-exec
bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard jekyll kitchen knife middleman nanoc rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor thin thor unicorn unicorn_rails puma)
@@ -42,3 +49,4 @@ for cmd in $bundled_commands; do
compdef _$cmd bundled_$cmd=$cmd
fi
done
+
diff --git a/plugins/docker/README.md b/plugins/docker/README.md
new file mode 100644
index 000000000..231a6dcf5
--- /dev/null
+++ b/plugins/docker/README.md
@@ -0,0 +1,19 @@
+## Docker autocomplete plugin
+
+- Adds autocomplete options for all docker commands.
+- Will also show containerIDs and Image names where applicable
+
+####Shows help for all commands
+![General Help](http://i.imgur.com/tUBO9jh.png "Help for all commands")
+
+
+####Shows your downloaded images where applicable
+![Images](http://i.imgur.com/R8ZsWO1.png "Images")
+
+
+####Shows your running containers where applicable
+![Containers](http://i.imgur.com/WQtbheg.png "Containers")
+
+
+
+Maintainer : Ahmed Azaan ([@aeonazaan](https://twitter.com/aeonazaan))
diff --git a/plugins/docker/_docker b/plugins/docker/_docker
new file mode 100644
index 000000000..f13f876cf
--- /dev/null
+++ b/plugins/docker/_docker
@@ -0,0 +1,290 @@
+#compdef docker
+
+# Docker autocompletion for oh-my-zsh
+# Requires: Docker installed
+# Author : Azaan (@aeonazaan)
+
+
+# ----- Helper functions
+# Output a selectable list of all running docker containers
+__docker_containers() {
+ declare -a cont_cmd
+ cont_cmd=($(docker ps | awk 'NR>1{print $1":[CON("$1")"$2"("$3")]"}'))
+ _describe 'containers' cont_cmd
+}
+
+# output a selectable list of all docker images
+__docker_images() {
+ declare -a img_cmd
+ img_cmd=($(docker images | awk 'NR>1{print $1}'))
+ _describe 'images' img_cmd
+}
+
+# ----- Commands
+# Seperate function for each command, makes extension easier later
+# ---------------------------
+__attach() {
+ __docker_containers
+}
+
+__build() {
+ _arguments \
+ '-q=false[Suppress verbose build output]' \
+ '-t="[fuck to be applied to the resulting image in case of success]' \
+ '*:files:_files'
+}
+
+__commit() {
+ _arguments \
+ '-author="[Author]' \
+ '-m="[Commit message]' \
+ '-run="[Config automatically applied when the image is run.\n]'
+ __docker_containers
+}
+
+__diff() {
+ __docker_containers
+}
+
+__export() {
+ __docker_containers
+}
+
+
+__history() {
+ __docker_images
+}
+
+__images() {
+ _arguments \
+ '-a[show all images]' \
+ '-notrunc[dont truncate output]' \
+ '-q[only show numeric IDs]' \
+ '-viz[output graph in graphviz format]'
+ __docker_images
+}
+
+__import() {
+ _arguments '*:files:_files'
+}
+
+__info() {
+ # no arguments
+}
+
+__insert() {
+ __docker_images
+ _arguments '*:files:_files'
+}
+
+__inspect() {
+ __docker_images
+ __docker_containers
+}
+
+__kill() {
+ __docker_containers
+}
+
+__login() {
+ _arguments \
+ '-e="[email]' \
+ '-p="[password]' \
+ '-u="[username]' \
+}
+
+__logs() {
+ __docker_containers
+}
+
+__port() {
+ __docker_containers
+}
+
+__top() {
+ __docker_containers
+}
+
+__ps() {
+ _arguments \
+ '-a[Show all containers. Only running containers are shown by default.]' \
+ '-beforeId="[Show only container created before Id, include non-running ones.]' \
+ '-l[Show only the latest created container, include non-running ones.]' \
+ '-n=[Show n last created containers, include non-running ones.]' \
+ '-notrurrrrnc[Dont truncate output]' \
+ '-q[Only display numeric IDs]' \
+ '-s[Display sizes]' \
+ '-sinceId="[Show only containers created since Id, include non-running ones.]'
+}
+
+__pull() {
+ _arguments '-t="[Download tagged image in repository]'
+}
+
+__push() {
+
+}
+
+__restart() {
+ _arguments '-t=[number of seconds to try to stop before killing]'
+ __docker_containers
+}
+
+__rm() {
+ _arguments '-v[Remove the volumes associated to the container]'
+ __docker_containers
+}
+
+__rmi() {
+ __docker_images
+}
+
+__run() {
+ _arguments \
+ '-a=[Attach to stdin, stdout or stderr.]' \
+ '-c=[CPU shares (relative weight)]' \
+ '-d[Detached mode: leave the container running in the background]' \
+ '-dns=[Set custom dns servers]' \
+ '-e=[Set environment variables]' \
+ '-entrypoint="[Overwrite the default entrypoint of the image]' \
+ '-h="[Container host name]' \
+ '-i[Keep stdin open even if not attached]' \
+ '-m=[Memory limit (in bytes)]' \
+ '-p=[Expose a containers port to the host (use docker port to see the actual mapping)]' \
+ '-t[Allocate a pseudo-tty]' \
+ '-u="[Username or UID]' \
+ '-v=[Bind mount a volume (e.g. from the host: -v /host:/container, from docker: -v /container)]' \
+ '-volumes-from="[Mount volumes from the specified container]'
+ __docker_images
+}
+
+__search() {
+ _arguments '-notrunc[Dont truncate output]'
+}
+
+__start() {
+ __docker_containers
+}
+
+__stop() {
+ _arguments '-t=[number of seconds to try to stop before killing]'
+ __docker_containers
+}
+
+__tag() {
+ _arguments '-f[Force]'
+ __docker_images
+}
+
+__version() {
+
+}
+
+__wait() {
+ __docker_containers
+}
+
+# end commands ---------
+# ----------------------
+
+local -a _1st_arguments
+_1st_arguments=(
+ "attach":"Attach to a running container"
+ "build":"Build a container from a Dockerfile"
+ "commit":"Create a new image from a container's changes"
+ "diff":"Inspect changes on a container's filesystem"
+ "export":"Stream the contents of a container as a tar archive"
+ "history":"Show the history of an image"
+ "images":"List images"
+ "import":"Create a new filesystem image from the contents of a tarball"
+ "info":"Display system-wide information"
+ "insert":"Insert a file in an image"
+ "inspect":"Return low-level information on a container"
+ "kill":"Kill a running container"
+ "login":"Register or Login to the docker registry server"
+ "logs":"Fetch the logs of a container"
+ "port":"Lookup the public-facing port which is NAT-ed to PRIVATE_PORT"
+ "top":"Lookup the running processes of a container"
+ "ps":"List containers"
+ "pull":"Pull an image or a repository from the docker registry server"
+ "push":"Push an image or a repository to the docker registry server"
+ "restart":"Restart a running container"
+ "rm":"Remove one or more containers"
+ "rmi":"Remove one or more images"
+ "run":"Run a command in a new container"
+ "search":"Search for an image in the docker index"
+ "start":"Start a stopped container"
+ "stop":"Stop a running container"
+ "tag":"Tag an image into a repository"
+ "version":"Show the docker version information"
+ "wait":"Block until a container stops, then print its exit code"
+)
+
+_arguments '*:: :->command'
+
+if (( CURRENT == 1 )); then
+ _describe -t commands "docker command" _1st_arguments
+ return
+fi
+
+local -a _command_args
+case "$words[1]" in
+ attach)
+ __docker_containers ;;
+ build)
+ __build ;;
+ commit)
+ __commit ;;
+ diff)
+ __diff ;;
+ export)
+ __export ;;
+ history)
+ __history ;;
+ images)
+ __images ;;
+ import)
+ __import ;;
+ info)
+ __info ;;
+ insert)
+ __insert ;;
+ inspect)
+ __inspect ;;
+ kill)
+ __kill ;;
+ login)
+ __login ;;
+ logs)
+ __logs ;;
+ port)
+ __port ;;
+ top)
+ __top ;;
+ ps)
+ __ps ;;
+ pull)
+ __pull ;;
+ push)
+ __push ;;
+ restart)
+ __restart ;;
+ rm)
+ __rm ;;
+ rmi)
+ __rmi ;;
+ run)
+ __run ;;
+ search)
+ __search ;;
+ start)
+ __start ;;
+ stop)
+ __stop ;;
+ tag)
+ __tag ;;
+ version)
+ __version ;;
+ wait)
+ __wait ;;
+esac
diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh
index ab9c0c848..b9ea06844 100644
--- a/plugins/git-flow/git-flow.plugin.zsh
+++ b/plugins/git-flow/git-flow.plugin.zsh
@@ -20,6 +20,12 @@
# c. Or, use this file as a oh-my-zsh plugin.
#
+#Alias
+alias gf='git flow'
+alias gcd='git checkout develop'
+alias gch='git checkout hotfix'
+alias gcr='git checkout release'
+
_git-flow ()
{
local curcontext="$curcontext" state line
diff --git a/plugins/git/_git-branch b/plugins/git/_git-branch
index 86d03bc30..6b9c1a483 100644
--- a/plugins/git/_git-branch
+++ b/plugins/git/_git-branch
@@ -60,3 +60,24 @@ _git-branch ()
"($l $c $m -d)-D[delete a branch]" \
$dependent_deletion_args
}
+
+(( $+functions[__git_ignore_line] )) ||
+__git_ignore_line () {
+ declare -a ignored
+ ignored=()
+ ((CURRENT > 1)) &&
+ ignored+=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
+ ((CURRENT < $#line)) &&
+ ignored+=(${line[CURRENT+1,-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
+ $* -F ignored
+}
+
+(( $+functions[__git_ignore_line_inside_arguments] )) ||
+__git_ignore_line_inside_arguments () {
+ declare -a compadd_opts
+
+ zparseopts -D -E -a compadd_opts V: J: 1 2 n f X: M: P: S: r: R: q F:
+
+ __git_ignore_line $* $compadd_opts
+}
+
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index 2ecc74eb6..bcb32384b 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -22,6 +22,8 @@ alias gca='git commit -v -a'
compdef _git gc=git-commit
alias gca!='git commit -v -a --amend'
compdef _git gca!=git-commit
+alias gcmsg='git commit -m'
+compdef _git gcmsg=git-commit
alias gco='git checkout'
compdef _git gco=git-checkout
alias gcm='git checkout master'
@@ -52,9 +54,9 @@ compdef gcount=git
alias gcl='git config --list'
alias gcp='git cherry-pick'
compdef _git gcp=git-cherry-pick
-alias glg='git log --stat --max-count=5'
+alias glg='git log --stat --max-count=10'
compdef _git glg=git-log
-alias glgg='git log --graph --max-count=5'
+alias glgg='git log --graph --max-count=10'
compdef _git glgg=git-log
alias glgga='git log --graph --decorate --all'
compdef _git glgga=git-log
@@ -70,7 +72,10 @@ alias grh='git reset HEAD'
alias grhh='git reset HEAD --hard'
alias gclean='git reset --hard && git clean -dfx'
alias gwc='git whatchanged -p --abbrev-commit --pretty=medium'
-alias gf='git ls-files | grep'
+
+#remove the gf alias
+#alias gf='git ls-files | grep'
+
alias gpoat='git push origin --all && git push origin --tags'
alias gmt='git mergetool --no-prompt'
compdef _git gm=git-mergetool
@@ -124,3 +129,17 @@ function _git_log_prettily(){
}
alias glp="_git_log_prettily"
compdef _git glp=git-log
+
+# Work In Progress (wip)
+# These features allow to pause a branch development and switch to another one (wip)
+# When you want to go back to work, just unwip it
+#
+# This function return a warning if the current branch is a wip
+function work_in_progress() {
+ if $(git log -n 1 | grep -q -c wip); then
+ echo "WIP!!"
+ fi
+}
+# these alias commit and uncomit wip branches
+alias gwip='git add -A; git ls-files --deleted -z | xargs -0 git rm; git commit -m "wip"'
+alias gunwip='git log -n 1 | grep -q -c wip && git reset HEAD~1'
diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh
new file mode 100644
index 000000000..a3c5cf8c3
--- /dev/null
+++ b/plugins/jump/jump.plugin.zsh
@@ -0,0 +1,52 @@
+# Easily jump around the file system by manually adding marks
+# marks are stored as symbolic links in the directory $MARKPATH (default $HOME/.marks)
+#
+# jump FOO: jump to a mark named FOO
+# mark FOO: create a mark named FOO
+# unmark FOO: delete a mark
+# marks: lists all marks
+#
+export MARKPATH=$HOME/.marks
+
+jump() {
+ cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
+}
+
+mark() {
+ if (( $# == 0 )); then
+ MARK=$(basename "$(pwd)")
+ else
+ MARK="$1"
+ fi
+ if read -q \?"Mark $(pwd) as ${MARK}? (y/n) "; then
+ mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$MARK"
+ fi
+}
+
+unmark() {
+ rm -i "$MARKPATH/$1"
+}
+
+autoload colors
+marks() {
+ for link in $MARKPATH/*(@); do
+ local markname="$fg[cyan]${link:t}$reset_color"
+ local markpath="$fg[blue]$(readlink $link)$reset_color"
+ printf "%s\t" $markname
+ printf "-> %s \t\n" $markpath
+ done
+}
+
+_completemarks() {
+ reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_\da-zA-Z\-]*):$/\2/g'))
+}
+compctl -K _completemarks jump
+compctl -K _completemarks unmark
+
+_mark_expansion() {
+ setopt extendedglob
+ autoload -U modify-current-argument
+ modify-current-argument '$(readlink "$MARKPATH/$ARG")'
+}
+zle -N _mark_expansion
+bindkey "^g" _mark_expansion
diff --git a/plugins/mosh/mosh.plugin.zsh b/plugins/mosh/mosh.plugin.zsh
new file mode 100644
index 000000000..ea36b7ee9
--- /dev/null
+++ b/plugins/mosh/mosh.plugin.zsh
@@ -0,0 +1,2 @@
+# Allow SSH tab completion for mosh hostnames
+compdef mosh=ssh
diff --git a/plugins/pod/_pod b/plugins/pod/_pod
new file mode 100644
index 000000000..563fa5e66
--- /dev/null
+++ b/plugins/pod/_pod
@@ -0,0 +1,381 @@
+#compdef pod
+#autoload
+
+# -----------------------------------------------------------------------------
+# FILE: _pod
+# DESCRIPTION: Cocoapods autocomplete plugin for Oh-My-Zsh
+# http://cocoapods.org
+# AUTHOR: Alexandre Joly (alexandre.joly@mekanics.ch)
+# GITHUB: https://github.com/mekanics
+# TWITTER: @jolyAlexandre
+# VERSION: 0.0.1
+# LICENSE: MIT
+# -----------------------------------------------------------------------------
+
+local -a _1st_arguments
+_1st_arguments=(
+ 'help:Show help for the given command.'
+ 'install:Install project dependencies'
+ 'ipc:Inter-process communication'
+ 'list:List pods'
+ 'outdated:Show outdated project dependencies'
+ 'podfile-info:Shows information on installed Pods'
+ 'push:Push new specifications to a spec-repo'
+ 'repo:Manage spec-repositories'
+ 'search:Searches for pods'
+ 'setup:Setup the CocoaPods environment'
+ 'spec:Manage pod specs'
+ 'update:Update outdated project dependencies'
+)
+
+local -a _repo_arguments
+_repo_arguments=(
+ 'add:Add a spec repo'
+ 'lint:Validates all specs in a repo'
+ 'update:Update a spec repo'
+)
+
+local -a _spec_arguments
+_spec_arguments=(
+ 'cat:Prints a spec file'
+ 'create:Create spec file stub'
+ 'edit:Edit a spec file'
+ 'lint:Validates a spec file'
+ 'which:Prints the path of the given spec'
+)
+
+local -a _ipc_arguments
+_ipc_arguments=(
+ 'list:Lists the specifications know to CocoaPods'
+ 'podfile:Converts a Podfile to YAML'
+ 'repl:The repl listens to commands on standard input'
+ 'spec:Converts a podspec to YAML'
+ 'update-search-index:Updates the search index'
+)
+
+local -a _list_arguments
+_list_arguments=(
+ 'new:Lists pods introduced in the master spec-repo since the last check'
+)
+
+local -a _inherited_options
+_inherited_options=(
+ '(--silent)--silent[Show nothing]' \
+ '(--version)--version[Show the version of CocoaPods]' \
+ '(--no-color)--no-color[Show output without color]' \
+ '(--verbose)--verbose[Show more debugging information]' \
+ '(--help)--help[Show help banner of specified command]'
+)
+
+local -a _install_options
+_install_options=(
+ '(--no-clean)--no-clean[Leave SCM dirs like `.git` and `.svn` intact after downloading]' \
+ '(--no-integrate)--no-integrate[Skip integration of the Pods libraries in the Xcode project(s)]' \
+ '(--no-repo-update)--no-repo-update[Skip running `pod repo update` before install]'
+)
+
+local -a _update_options
+_update_options=(
+ '(--no-clean)--no-clean[Leave SCM dirs like `.git` and `.svn intact after downloading]' \
+ '(--no-integrate)--no-integrate[Skip integration of the Pods libraries in the Xcode project(s)]' \
+ '(--no-repo-update)--no-repo-update[Skip running `pod repo update before install]'
+)
+
+local -a _outdated_options
+_outdated_options=(
+ '(--no-repo-update)--no-repo-update[Skip running `pod repo update` before install]'
+)
+
+local -a _search_options
+_search_options=(
+ '(--full)--full[Search by name, summary, and description]' \
+ '(--stats)--stats[Show additional stats (like GitHub watchers and forks)]' \
+ '(--ios)--ios[Restricts the search to Pods supported on iOS]' \
+ '(--osx)--osx[Restricts the search to Pods supported on OS X]'
+)
+
+local -a _list_options
+_list_options=(
+ '(--update)--update[Run `pod repo update` before listing]'
+)
+
+local -a _podfile_info_options
+_podfile_info_options=(
+ '(--all)--all[Show information about all Pods with dependencies that are used in a project]' \
+ '(--md)--md[Output information in Markdown format]' \
+ '*:script or directory:_files'
+)
+
+local -a _push_options
+_push_options=(
+ '(--allow-warnings)--allow-warnings[Allows pushing even if there are warnings]' \
+ '(--local-only)--local-only[Does not perform the step of pushing REPO to its remote]' \
+ '*:script or directory:_files'
+)
+
+local -a _repo_lint_options
+_repo_lint_options=(
+ '(--only-errors)--only-errors[Lint presents only the errors]'
+)
+
+local -a _setup_options
+_setup_options=(
+ '(--push)--push[Use this option to enable push access once granted]'
+)
+
+local -a _spec_lint_options
+_spec_lint_options=(
+ '(--quick)--quick[Lint skips checks that would require to download and build the spec]' \
+ '(--only-errors)--only-errors[Lint validates even if warnings are present]' \
+ '(--no-clean)--no-clean[Lint leaves the build directory intact for inspection]' \
+ '*:script or directory:_files'
+)
+
+local -a _spec_cat_options
+_spec_cat_options=(
+ '(--show-all)--show-all[Pick from all versions of the given podspec]'
+)
+
+local -a _spec_which_options
+_spec_which_options=(
+ '(--show-all)--show-all[Print all versions of the given podspec]'
+)
+
+local -a _spec_edit_options
+_spec_edit_options=(
+ '(--show-all)--show-all[Pick which spec to edit from all available versions of the given podspec]'
+)
+
+
+__first_command_list ()
+{
+ local expl
+ declare -a tasks
+
+ tasks=(install ipc list outdated podfile-info push repo search setup spec update)
+
+ _wanted tasks expl 'help' compadd $tasks
+}
+
+__repo_list() {
+ _wanted application expl 'repo' compadd $(command ls -1 ~/.cocoapods 2>/dev/null | sed -e 's/ /\\ /g')
+}
+
+__pod-repo() {
+ local curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ _arguments -C \
+ ':command:->command' \
+ '*::options:->options'
+
+ case $state in
+ (command)
+ _describe -t commands "pod repo" _repo_arguments
+ return
+ ;;
+
+ (options)
+ case $line[1] in
+ (lint)
+ _arguments \
+ $_inherited_options \
+ $_repo_lint_options \
+ ':feature:__repo_list'
+ ;;
+
+ (update)
+ _arguments \
+ $_inherited_options \
+ ':feature:__repo_list'
+ ;;
+
+ (add)
+ _arguments \
+ $_inherited_options
+ esac
+ ;;
+ esac
+}
+
+__pod-spec() {
+ local curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ _arguments -C \
+ ':command:->command' \
+ '*::options:->options'
+
+ case $state in
+ (command)
+ _describe -t commands "pod spec" _spec_arguments
+ return
+ ;;
+
+ (options)
+ case $line[1] in
+ (create)
+ _arguments \
+ $_inherited_options
+ ;;
+
+ (lint)
+ _arguments \
+ $_inherited_options \
+ $_spec_lint_options
+ ;;
+
+ (cat)
+ _arguments \
+ $_inherited_options \
+ $_spec_cat_options
+ ;;
+
+ (which)
+ _arguments \
+ $_inherited_options \
+ $_spec_which_options
+ ;;
+
+ (edit)
+ _arguments \
+ $_inherited_options \
+ $_spec_edit_options
+ ;;
+ esac
+ return
+ ;;
+ esac
+}
+
+__pod-ipc() {
+ local curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ _arguments -C \
+ ':command:->command' \
+ '*::options:->options'
+
+ case $state in
+ (command)
+ _describe -t commands "pod ipc" _ipc_arguments
+ return
+ ;;
+
+ (options)
+ _arguments -C \
+ $_inherited_options
+ return
+ ;;
+ esac
+}
+
+__pod-list() {
+ local curcontext="$curcontext" state line
+ typeset -A opt_args
+
+ _arguments -C \
+ $_inherited_options \
+ $_list_options \
+ ':command:->command' \
+ '*::options:->options'
+
+ case $state in
+ (command)
+ _describe -t commands "pod list" _list_arguments
+ return
+ ;;
+
+ (options)
+ _arguments -C \
+ $_inherited_options \
+ $_list_options
+ return
+ ;;
+ esac
+}
+
+local curcontext="$curcontext" state line
+typeset -A opt_args
+
+_arguments -C \
+ $_inherited_options \
+ ':command:->command' \
+ '*::options:->options'
+
+case $state in
+ (command)
+ _describe -t commands "pod" _1st_arguments
+ return
+ ;;
+
+ (options)
+ case $line[1] in
+ (help)
+ _arguments \
+ $_inherited_options \
+ ':help:__first_command_list'
+ ;;
+
+ (push)
+ _arguments \
+ $_inherited_options \
+ $_push_options \
+ ':repo:__repo_list'
+ ;;
+
+ (repo)
+ __pod-repo
+ ;;
+
+ (spec)
+ __pod-spec
+ ;;
+
+ (ipc)
+ __pod-ipc
+ ;;
+
+ (list)
+ __pod-list
+ ;;
+
+ (install)
+ _arguments \
+ $_inherited_options \
+ $_install_options
+ ;;
+
+ (update)
+ _arguments \
+ $_inherited_options \
+ $_update_options
+ ;;
+
+ (outdated)
+ _arguments \
+ $_inherited_options \
+ $_outdated_options
+ ;;
+
+ (search)
+ _arguments \
+ $_inherited_options \
+ $_search_options
+ ;;
+
+ (podfile-info)
+ _arguments \
+ $_inherited_options \
+ $_podfile_info_options
+ ;;
+
+ (setup)
+ _arguments \
+ $_inherited_options \
+ $_setup_options
+ ;;
+
+ esac
+ ;;
+esac
diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh
index 2555fab67..b53d18d08 100644
--- a/plugins/rails3/rails3.plugin.zsh
+++ b/plugins/rails3/rails3.plugin.zsh
@@ -4,7 +4,11 @@ function _rails_command () {
if [ -e "script/server" ]; then
ruby script/$@
else
- ruby script/rails $@
+ if [ -e "bin/rails" ]; then
+ bin/rails $@
+ else
+ rails $@
+ fi
fi
}
diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh
index 3ecc2ac69..96fab80a6 100644
--- a/plugins/tmux/tmux.plugin.zsh
+++ b/plugins/tmux/tmux.plugin.zsh
@@ -38,7 +38,7 @@ if which tmux &> /dev/null
fi
# Set the correct local config file to use.
- if [[ "$ZSH_TMUX_ITERM2" == "false" ]] && (( [[ -f $HOME/.tmux.conf ]] || -h $HOME/.tmux.conf ]] ))
+ if [[ "$ZSH_TMUX_ITERM2" == "false" ]] && [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]]
then
#use this when they have a ~/.tmux.conf
export _ZSH_TMUX_FIXED_CONFIG="$zsh_tmux_plugin_path/tmux.extra.conf"
diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh
index 6b6de2b15..8eedb90ee 100644
--- a/plugins/web-search/web-search.plugin.zsh
+++ b/plugins/web-search/web-search.plugin.zsh
@@ -11,7 +11,7 @@ function web_search() {
fi
# check whether the search engine is supported
- if [[ ! $1 =~ '(google|bing|yahoo)' ]];
+ if [[ ! $1 =~ '(google|bing|yahoo|duckduckgo)' ]];
then
echo "Search engine $1 not supported."
return 1
@@ -24,8 +24,12 @@ function web_search() {
$open_cmd "$url"
return
fi
-
- url="${url}/search?q="
+ if [[ $1 == 'duckduckgo' ]]; then
+ #slightly different search syntax for DDG
+ url="${url}/?q="
+ else
+ url="${url}/search?q="
+ fi
shift # shift out $1
while [[ $# -gt 0 ]]; do
@@ -34,10 +38,19 @@ function web_search() {
done
url="${url%?}" # remove the last '+'
-
+
$open_cmd "$url"
}
+
alias bing='web_search bing'
alias google='web_search google'
alias yahoo='web_search yahoo'
+alias ddg='web_search duckduckgo'
+#add your own !bang searches here
+alias wiki='web_search duckduckgo \!w'
+alias news='web_search duckduckgo \!n'
+alias youtube='web_search duckduckgo \!yt'
+alias map='web_search duckduckgo \!m'
+alias image='web_search duckduckgo \!i'
+alias ducky='web_search duckduckgo \!'