Commit 78bbf7a6 authored by Robby Russell's avatar Robby Russell
Browse files

Merge pull request #3809 from ncanceill/easymerge

Easy-to-Merge
parents 9eaf5110 a7e79824
# author: Peter Eisentraut
# source: https://gist.github.com/petere/10307599
# compdef kitchen
_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
}
_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
}
_kitchen "$@"
...@@ -15,6 +15,6 @@ compdef _laravel5 la5 ...@@ -15,6 +15,6 @@ compdef _laravel5 la5
#Alias #Alias
alias la5='php artisan' alias la5='php artisan'
alias la5dump='php artisan dump-autoload'
alias la5cache='php artisan cache:clear' alias la5cache='php artisan cache:clear'
alias la5routes='php artisan routes' alias la5routes='php artisan route:list'
alias la5vendor='php artisan vendor:publish'
...@@ -15,7 +15,7 @@ function chpwd() { ...@@ -15,7 +15,7 @@ function chpwd() {
# Changes directory to the last working directory. # Changes directory to the last working directory.
function lwd() { function lwd() {
[[ ! -r "$cache_file" ]] || cd `cat "$cache_file"` [[ ! -r "$cache_file" ]] || cd "`cat "$cache_file"`"
} }
# Automatically jump to last working directory unless this isn't the first time # Automatically jump to last working directory unless this isn't the first time
......
# Mercurial plugin
### Usage
Update .zshrc:
1. Add name to the list of plugins, e.g. `plugins = (..., mercurial, ...)`
(that is pretty obvious).
2. Change PROMPT variable of current theme to contain current folder mercurial repo info:
robbyrussel theme is used by default, so you need to modify PROMPT var
from [this file](https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/robbyrussell.zsh-theme)
by adding `$(hg_prompt_info)` after `$(git_prompt_info)`, so currently it
looks next:
```diff
- PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
+ PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)$(hg_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
```
and put modified var at the end of **.zshrc**.
3. Initialize additional vars used in plugin. So in short put next in **.zshrc**:
```
ZSH_THEME_HG_PROMPT_PREFIX="%{$fg_bold[magenta]%}hg:(%{$fg[red]%}"
ZSH_THEME_HG_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_HG_PROMPT_DIRTY="%{$fg[magenta]%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_HG_PROMPT_CLEAN="%{$fg[magenta]%})"
```
### What's inside?
#### Adds handy aliases:
###### general
* `hgc` - `hg commit`
* `hgb` - `hg branch`
* `hgba` - `hg branches`
* `hgbk` - `hg bookmarks`
* `hgco` - `hg checkout`
* `hgd` - `hg diff`
* `hged` - `hg diffmerge`
###### pull and update
* `hgi` - `hg incoming`
* `hgl` - `hg pull -u`
* `hglr` - `hg pull --rebase`
* `hgo` - `hg outgoing`
* `hgp` - `hg push`
* `hgs` - `hg status`
* `hgsl` - `hg log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n"`
###### this is the 'git commit --amend' equivalent
* `hgca` - `hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip`
###### list unresolved files (since hg does not list unmerged files in the status command)
* `hgun` - `hg resolve --list`
#### Displays repo branch and directory status in prompt
This is the same as git plugin does.
**Note**: additional changes to **.zshrc** are required in order for this to
work.
### Mantainers
[ptrv](https://github.com/ptrv) - original creator
[oshybystyi](https://github.com/oshybystyi) - created this README and know how most of code works
# mix-fast
Fast mix autocompletion plugin.
This script caches the output for later usage and significantly speeds it up.
It generates a .mix_tasks cache file for current project. Currently if you want
to update cache you should remove .mix_tasks file
Inspired by and based on rake-fast zsh plugin.
This is entirely based on [this pull request by Ullrich Schäfer](https://github.com/robb/.dotfiles/pull/10/), which is inspired by [this Ruby on Rails trick from 2006](http://weblog.rubyonrails.org/2006/3/9/fast-mix-task-completion-for-zsh/).
## Installation
Just add the plugin to your `.zshrc`:
```bash
plugins=(foo bar mix-fast)
```
You might consider adding `.mix_tasks` to your [global .gitignore](https://help.github.com/articles/ignoring-files#global-gitignore)
## Usage
`mix`, then press tab
Currently maintained by [styx](https://github.com/styx/)
\ No newline at end of file
_mix_refresh () {
if [ -f .mix_tasks ]; then
rm .mix_tasks
fi
echo "Generating .mix_tasks..." > /dev/stderr
_mix_generate
cat .mix_tasks
}
_mix_does_task_list_need_generating () {
[ ! -f .mix_tasks ];
}
_mix_generate () {
mix --help | grep -v 'iex -S' | tail -n +2 | cut -d " " -f 2 > .mix_tasks
}
_mix () {
if [ -f mix.exs ]; then
if _mix_does_task_list_need_generating; then
echo "\nGenerating .mix_tasks..." > /dev/stderr
_mix_generate
fi
compadd `cat .mix_tasks`
fi
}
compdef _mix mix
alias mix_refresh='_mix_refresh'
#compdef mix #compdef mix
#autoload #autoload
# Elixir mix zsh completion # Elixir mix zsh completion
local -a _1st_arguments local -a _1st_arguments
_1st_arguments=( _1st_arguments=(
'archive:Archive this project into a .ez file' 'app.start:Start all registered apps'
'clean:Clean generated application files' 'archive:List all archives'
'archive.build:Archive this project into a .ez file'
'archive.install:Install an archive locally'
'archive.uninstall:Uninstall archives'
'clean:Delete generated application files'
'cmd:Executes the given command'
'compile:Compile source files' 'compile:Compile source files'
'compile.protocols:Consolidates all protocols in all paths'
'deps:List dependencies and their status' 'deps:List dependencies and their status'
"deps.clean:Remove dependencies' files" "deps.clean:Remove the given dependencies' files"
'deps.compile:Compile dependencies' 'deps.compile:Compile dependencies'
'deps.get:Get all out of date dependencies' 'deps.get:Get all out of date dependencies'
'deps.unlock:Unlock the given dependencies' 'deps.unlock:Unlock the given dependencies'
'deps.update:Update dependencies' 'deps.update:Update the given dependencies'
'do:Executes the commands separated by comma' 'do:Executes the tasks separated by comma'
'escriptize:Generates an escript for the project' 'escript.build:Builds an escript for the project'
'help:Print help information for tasks' 'help:Print help information for tasks'
'hex:Print hex help information'
'hex.config:Read or update hex config'
'hex.docs:Publish docs for package'
'hex.info:Print hex information'
'hex.key:Hex API key tasks'
'hex.outdated:Shows outdated hex deps for the current project'
'hex.owner:Hex package ownership tasks'
'hex.publish:Publish a new package version'
'hex.search:Search for package names'
'hex.user:Hex user tasks'
'loadconfig:Loads and persists the given configuration'
'local:List local tasks' 'local:List local tasks'
'local.install:Install a task or an archive locally' 'local.hex:Install hex locally'
'local.rebar:Install rebar locally' 'local.rebar:Install rebar locally'
'local.uninstall:Uninstall local tasks or archives' 'new:Create a new Elixir project'
'local.hex:Install Hex locally'
'new:Creates a new Elixir project'
'run:Run the given file or expression' 'run:Run the given file or expression'
"test:Run a project's tests" "test:Run a project's tests"
'--help:Describe available tasks' '--help:Describe available tasks'
...@@ -34,7 +49,7 @@ __task_list () ...@@ -34,7 +49,7 @@ __task_list ()
local expl local expl
declare -a tasks declare -a tasks
tasks=(archive clean compile deps deps.clean deps.compile deps.get deps.unlock deps.update do escriptize help local local.install local.rebar local.uninstall new run test) tasks=(app.start archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.unlock deps.update do escript.build help hex hex.config hex.docs hex.info hex.key hex.outdated hex.owner hex.publish hex.search hex.user loadconfig local local.hex local.rebar new run test)
_wanted tasks expl 'help' compadd $tasks _wanted tasks expl 'help' compadd $tasks
} }
...@@ -57,7 +72,7 @@ case $state in ...@@ -57,7 +72,7 @@ case $state in
(options) (options)
case $line[1] in case $line[1] in
(help) (help)
_arguments ':feature:__task_list' _arguments ':feature:__task_list'
esac esac
;; ;;
esac esac
......
...@@ -138,23 +138,6 @@ function man-preview() { ...@@ -138,23 +138,6 @@ function man-preview() {
man -t "$@" | open -f -a Preview man -t "$@" | open -f -a Preview
} }
function trash() {
local trash_dir="${HOME}/.Trash"
local temp_ifs="$IFS"
IFS=$'\n'
for item in "$@"; do
if [[ -e "$item" ]]; then
item_name="$(basename $item)"
if [[ -e "${trash_dir}/${item_name}" ]]; then
mv -f "$item" "${trash_dir}/${item_name} $(date "+%H-%M-%S")"
else
mv -f "$item" "${trash_dir}/"
fi
fi
done
IFS=$temp_ifs
}
function vncviewer() { function vncviewer() {
open vnc://$@ open vnc://$@
} }
......
_paver_does_target_list_need_generating () {
[ ! -f .paver_targets ] && return 0;
[ pavement.py -nt .paver_targets ] && return 0;
return 1;
}
_paver () {
if [ -f pavement.py ]; then
if _paver_does_target_list_need_generating; then
paver --help 2>&1 |grep '-'|grep -v -e '--'|awk -F '-' '{print $1}'|tr -d ' ' > .paver_targets
fi
compadd `cat .paver_targets`
fi
}
compdef _paver paver
#compdef pod #compdef pod
#autoload #autoload
# setopt XTRACE VERBOSE
# vim: ft=zsh sw=2 ts=2 et
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# FILE: _pod # FILE: _pod
# DESCRIPTION: Cocoapods (0.27.1) autocomplete plugin for Oh-My-Zsh # DESCRIPTION: Cocoapods (0.33.1) autocomplete plugin for Oh-My-Zsh
# http://cocoapods.org # http://cocoapods.org
# Generated with `pod --completion-script
# AUTHOR: Alexandre Joly (alexandre.joly@mekanics.ch) # AUTHOR: Alexandre Joly (alexandre.joly@mekanics.ch)
# GITHUB: https://github.com/mekanics # GITHUB: https://github.com/mekanics
# TWITTER: @jolyAlexandre # TWITTER: @jolyAlexandre
# VERSION: 0.0.3 # VERSION: 0.0.5
# LICENSE: MIT
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
local -a _1st_arguments local -a _subcommands
_1st_arguments=( local -a _options
'help:Show help for the given command'
'init:Generate a Podfile for the current directory' case "$words[2]" in
'install:Install project dependencies' help)
'ipc:Inter-process communication' case "$words[3]" in
'list:List pods' *) # pod help
'outdated:Show outdated project dependencies' _options=(
'podfile-info:Shows information on installed Pods' "--help:Show help banner of specified command"
'push:Push new specifications to a spec-repo' "--no-ansi:Show output without ANSI codes"
'repo:Manage spec-repositories' "--silent:Show nothing"
'search:Searches for pods' "--verbose:Show more debugging information"
'setup:Setup the CocoaPods environment' )
'spec:Manage pod specs' _describe -t options "pod help options" _options
'update:Update outdated project dependencies' ;;
)
local -a _repo_arguments
_repo_arguments=(
'add:Add a spec repo'
'lint:Validates all specs in a repo'
'remove:Remove a spec 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/repos 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
(remove)
_arguments \
$_inherited_options \
':feature:__repo_list'
;;
esac
;;
esac esac
} ;;
ipc)
__pod-spec() { case "$words[3]" in
local curcontext="$curcontext" state line list)
typeset -A opt_args case "$words[4]" in
*) # pod ipc list
_arguments -C \ _options=(
':command:->command' \ "--help:Show help banner of specified command"
'*::options:->options' "--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
case $state in "--verbose:Show more debugging information"
(command) )
_describe -t commands "pod spec" _spec_arguments _describe -t options "pod ipc list options" _options
return ;;
;; esac
;;
(options) podfile)
case $line[1] in case "$words[4]" in
(create) *) # pod ipc podfile
_arguments \ _options=(
$_inherited_options "--help:Show help banner of specified command"
;; "--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
(lint) "--verbose:Show more debugging information"
_arguments \ )
$_inherited_options \ _describe -t options "pod ipc podfile options" _options
$_spec_lint_options ;;
;; esac
;;
(cat) repl)
_arguments \ case "$words[4]" in
$_inherited_options \ *) # pod ipc repl
$_spec_cat_options _options=(
;; "--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
(which) "--silent:Show nothing"
_arguments \ "--verbose:Show more debugging information"
$_inherited_options \ )
$_spec_which_options _describe -t options "pod ipc repl options" _options
;; ;;
esac
(edit) ;;
_arguments \ spec)
$_inherited_options \ case "$words[4]" in
$_spec_edit_options *) # pod ipc spec
;; _options=(
esac "--help:Show help banner of specified command"
return "--no-ansi:Show output without ANSI codes"
;; "--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod ipc spec options" _options
;;
esac
;;
update-search-index)
case "$words[4]" in
*) # pod ipc update-search-index
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod ipc update-search-index options" _options
;;
esac
;;
*) # pod ipc
_subcommands=(
"list:Lists the specifications known to CocoaPods."
"podfile:Converts a Podfile to YAML."
"repl:The repl listens to commands on standard input."
"spec:Converts a podspec to JSON."
"update-search-index:Updates the search index."
)
_describe -t commands "pod ipc subcommands" _subcommands
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod ipc options" _options
;;
esac esac
} ;;
init)
__pod-ipc() { case "$words[3]" in
local curcontext="$curcontext" state line *) # pod init
typeset -A opt_args _options=(
"--help:Show help banner of specified command"
_arguments -C \ "--no-ansi:Show output without ANSI codes"
':command:->command' \ "--silent:Show nothing"
'*::options:->options' "--verbose:Show more debugging information"
)
case $state in _describe -t options "pod init options" _options
(command) ;;
_describe -t commands "pod ipc" _ipc_arguments
return
;;
(options)
_arguments -C \
$_inherited_options
return
;;
esac esac
} ;;
install)
__pod-list() { case "$words[3]" in
local curcontext="$curcontext" state line *) # pod install
typeset -A opt_args _options=(
"--help:Show help banner of specified command"
_arguments -C \ "--no-ansi:Show output without ANSI codes"
$_inherited_options \ "--no-clean:Leave SCM dirs like \`.git\` and \`.svn\` intact after downloading"
$_list_options \ "--no-integrate:Skip integration of the Pods libraries in the Xcode project(s)"
':command:->command' \ "--no-repo-update:Skip running \`pod repo update\` before install"
'*::options:->options' "--silent:Show nothing"
"--verbose:Show more debugging information"
case $state in )
(command) _describe -t options "pod install options" _options
_describe -t commands "pod list" _list_arguments ;;
return
;;
(options)
_arguments -C \
$_inherited_options \
$_list_options
return
;;
esac 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
;; ;;
lib)
(options) case "$words[3]" in
case $line[1] in create)
(help) case "$words[4]" in
_arguments \ *) # pod lib create
$_inherited_options \ _options=(
':help:__first_command_list' "--help:Show help banner of specified command"
;; "--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
(push) "--verbose:Show more debugging information"
_arguments \ )
$_inherited_options \ _describe -t options "pod lib create options" _options
$_push_options \ ;;
':repo:__repo_list' esac
;; ;;
lint)
(repo) case "$words[4]" in
__pod-repo *) # pod lib lint
;; _options=(
"--help:Show help banner of specified command"
(spec) "--no-ansi:Show output without ANSI codes"
__pod-spec "--no-clean:Lint leaves the build directory intact for inspection"
;; "--no-subspecs:Lint skips validation of subspecs"
"--only-errors:Lint validates even if warnings are present"
(ipc) "--quick:Lint skips checks that would require to download and build the spec"
__pod-ipc "--silent:Show nothing"
;; "--subspec=NAME:Lint validates only the given subspec"
"--verbose:Show more debugging information"
(list) )
__pod-list _describe -t options "pod lib lint options" _options
;; ;;
esac
(install) ;;
_arguments \ *) # pod lib
$_inherited_options \ _subcommands=(
$_install_options "create:Creates a new Pod"
;; "lint:Validates a Pod"
)
(update) _describe -t commands "pod lib subcommands" _subcommands
_arguments \ _options=(
$_inherited_options \ "--help:Show help banner of specified command"
$_update_options "--no-ansi:Show output without ANSI codes"
;; "--silent:Show nothing"
"--verbose:Show more debugging information"
(outdated) )
_arguments \ _describe -t options "pod lib options" _options
$_inherited_options \ ;;
$_outdated_options esac
;; ;;
list)
(search) case "$words[3]" in
_arguments \ new)
$_inherited_options \ case "$words[4]" in
$_search_options *) # pod list new
;; _options=(
"--help:Show help banner of specified command"
(podfile-info) "--no-ansi:Show output without ANSI codes"
_arguments \ "--silent:Show nothing"
$_inherited_options \ "--update:Run \`pod repo update\` before listing"
$_podfile_info_options "--verbose:Show more debugging information"
;; )
_describe -t options "pod list new options" _options
(setup) ;;
_arguments \ esac
$_inherited_options \ ;;
$_setup_options *) # pod list
;; _subcommands=(
"new:Lists pods introduced in the master spec-repo since the last check"
)
_describe -t commands "pod list subcommands" _subcommands
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--update:Run \`pod repo update\` before listing"
"--verbose:Show more debugging information"
)
_describe -t options "pod list options" _options
;;
esac
;;
outdated)
case "$words[3]" in
*) # pod outdated
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--no-repo-update:Skip running \`pod repo update\` before install"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod outdated options" _options
;;
esac
;;
plugins)
case "$words[3]" in
create)
case "$words[4]" in
*) # pod plugins create
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod plugins create options" _options
;;
esac
;;
list)
case "$words[4]" in
*) # pod plugins list
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--verbose:Show more debugging information"
)
_describe -t options "pod plugins list options" _options
;;
esac
;;
search)
case "$words[4]" in
*) # pod plugins search
_options=(
"--full:Search by name, author, and description"
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--verbose:Show more debugging information"
)
_describe -t options "pod plugins search options" _options
;;
esac
;;
*) # pod plugins
_subcommands=(
"create:Creates a new plugin"
"list:List all known plugins"
"search:Search for known plugins"
)
_describe -t commands "pod plugins subcommands" _subcommands
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod plugins options" _options
;;
esac
;;
push)
case "$words[3]" in
*) # pod push
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod push options" _options
;;
esac
;;
repo)
case "$words[3]" in
add)
case "$words[4]" in
*) # pod repo add
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--shallow:Create a shallow clone (fast clone, but no push capabilities)"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod repo add options" _options
;;
esac
;;
lint)
case "$words[4]" in
*) # pod repo lint
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--only-errors:Lint presents only the errors"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod repo lint options" _options
;;
esac
;;
push)
case "$words[4]" in
*) # pod repo push
_options=(
"--allow-warnings:Allows pushing even if there are warnings"
"--help:Show help banner of specified command"
"--local-only:Does not perform the step of pushing REPO to its remote"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod repo push options" _options
;;
esac
;;
remove)
case "$words[4]" in
*) # pod repo remove
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod repo remove options" _options
;;
esac
;;
update)
case "$words[4]" in
*) # pod repo update
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod repo update options" _options
;;
esac
;;
*) # pod repo
_subcommands=(
"add:Add a spec repo."
"lint:Validates all specs in a repo."
"push:Push new specifications to a spec-repo"
"remove:Remove a spec repo"
"update:Update a spec repo."
)
_describe -t commands "pod repo subcommands" _subcommands
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod repo options" _options
;;
esac esac
;; ;;
search)
case "$words[3]" in
*) # pod search
_options=(
"--full:Search by name, summary, and description"
"--help:Show help banner of specified command"
"--ios:Restricts the search to Pods supported on iOS"
"--no-ansi:Show output without ANSI codes"
"--osx:Restricts the search to Pods supported on OS X"
"--stats:Show additional stats (like GitHub watchers and forks)"
"--verbose:Show more debugging information"
"--web:Searches on cocoapods.org"
)
_describe -t options "pod search options" _options
;;
esac
;;
setup)
case "$words[3]" in
*) # pod setup
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--no-shallow:Clone full history so push will work"
"--push:Use this option to enable push access once granted"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod setup options" _options
;;
esac
;;
spec)
case "$words[3]" in
cat)
case "$words[4]" in
*) # pod spec cat
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--show-all:Pick from all versions of the given podspec"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod spec cat options" _options
;;
esac
;;
create)
case "$words[4]" in
*) # pod spec create
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod spec create options" _options
;;
esac
;;
edit)
case "$words[4]" in
*) # pod spec edit
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--show-all:Pick which spec to edit from all available versions of the given podspec"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod spec edit options" _options
;;
esac
;;
lint)
case "$words[4]" in
*) # pod spec lint
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--no-clean:Lint leaves the build directory intact for inspection"
"--no-subspecs:Lint skips validation of subspecs"
"--only-errors:Lint validates even if warnings are present"
"--quick:Lint skips checks that would require to download and build the spec"
"--silent:Show nothing"
"--subspec=NAME:Lint validates only the given subspec"
"--verbose:Show more debugging information"
)
_describe -t options "pod spec lint options" _options
;;
esac
;;
which)
case "$words[4]" in
*) # pod spec which
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--show-all:Print all versions of the given podspec"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod spec which options" _options
;;
esac
;;
*) # pod spec
_subcommands=(
"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."
)
_describe -t commands "pod spec subcommands" _subcommands
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod spec options" _options
;;
esac
;;
trunk)
case "$words[3]" in
add-owner)
case "$words[4]" in
*) # pod trunk add-owner
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod trunk add-owner options" _options
;;
esac
;;
me)
case "$words[4]" in
clean-sessions)
case "$words[5]" in
*) # pod trunk me clean-sessions
_options=(
"--all:Removes all your sessions, except for the current one"
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod trunk me clean-sessions options" _options
;;
esac
;;
*) # pod trunk me
_subcommands=(
"clean-sessions:Remove sessions"
)
_describe -t commands "pod trunk me subcommands" _subcommands
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod trunk me options" _options
;;
esac
;;
push)
case "$words[4]" in
*) # pod trunk push
_options=(
"--allow-warnings:Allows push even if there are lint warnings"
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod trunk push options" _options
;;
esac
;;
register)
case "$words[4]" in
*) # pod trunk register
_options=(
"--description=DESCRIPTION:An arbitrary description to easily identify your session later on."
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod trunk register options" _options
;;
esac
;;
*) # pod trunk
_subcommands=(
"add-owner:Add an owner to a pod"
"me:Display information about your sessions"
"push:Publish a podspec"
"register:Manage sessions"
)
_describe -t commands "pod trunk subcommands" _subcommands
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod trunk options" _options
;;
esac
;;
try)
case "$words[3]" in
*) # pod try
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod try options" _options
;;
esac
;;
update)
case "$words[3]" in
*) # pod update
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--no-clean:Leave SCM dirs like \`.git\` and \`.svn\` intact after downloading"
"--no-integrate:Skip integration of the Pods libraries in the Xcode project(s)"
"--no-repo-update:Skip running \`pod repo update\` before install"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod update options" _options
;;
esac
;;
*) # pod
_subcommands=(
"help:Show help for the given command."
"ipc:Inter-process communication"
"init:Generate a Podfile for the current directory."
"install:Install project dependencies"
"lib:Develop pods"
"list:List pods"
"outdated:Show outdated project dependencies"
"plugins:Show available CocoaPods plugins"
"push:Temporary alias for the \`pod repo push\` command"
"repo:Manage spec-repositories"
"search:Searches for pods"
"setup:Setup the CocoaPods environment"
"spec:Manage pod specs"
"trunk:Interact with the CocoaPods API (e.g. publishing new specs)"
"try:Try a Pod!"
"update:Update outdated project dependencies"
)
_describe -t commands "pod subcommands" _subcommands
_options=(
"--completion-script:Print the auto-completion script"
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
"--version:Show the version of the tool"
)
_describe -t options "pod options" _options
;;
esac esac
...@@ -59,7 +59,7 @@ alias rn='rake notes' ...@@ -59,7 +59,7 @@ alias rn='rake notes'
alias rr='rake routes' alias rr='rake routes'
# legacy stuff # legacy stuff
alias ss='thin --stats "/thin/stats" start' alias sstat='thin --stats "/thin/stats" start'
alias sg='ruby script/generate' alias sg='ruby script/generate'
alias sd='ruby script/destroy' alias sd='ruby script/destroy'
alias sp='ruby script/plugin' alias sp='ruby script/plugin'
......
echo "It looks like you have been using the 'rails3' plugin,"
echo "which has been deprecated in favor of a newly consolidated 'rails' plugin."
echo "You will want to modify your ~/.zshrc configuration to begin using it."
echo "Learn more at https://github.com/robbyrussell/oh-my-zsh/pull/2240"
echo "It looks like you have been using the 'rails4' plugin,"
echo "which has been deprecated in favor of a newly consolidated 'rails' plugin."
echo "You will want to modify your ~/.zshrc configuration to begin using it."
echo "Learn more at https://github.com/robbyrussell/oh-my-zsh/pull/2240"
...@@ -14,4 +14,6 @@ Plugin for Sublime Text, a cross platform text and code editor, available for Li ...@@ -14,4 +14,6 @@ Plugin for Sublime Text, a cross platform text and code editor, available for Li
* If `st` is passed a file, open it in Sublime Text * If `st` is passed a file, open it in Sublime Text
* if `stt` command is called, it is equivalent to `st .`, opening the current folder in Sublime Text * If `stt` command is called, it is equivalent to `st .`, opening the current folder in Sublime Text
\ No newline at end of file
* If `sst` command is called, it is like `sudo st`, opening the file or folder in Sublime Text. Useful for editing system protected files.
\ No newline at end of file
...@@ -5,6 +5,7 @@ if [[ $('uname') == 'Linux' ]]; then ...@@ -5,6 +5,7 @@ if [[ $('uname') == 'Linux' ]]; then
_sublime_linux_paths=( _sublime_linux_paths=(
"$HOME/bin/sublime_text" "$HOME/bin/sublime_text"
"/opt/sublime_text/sublime_text" "/opt/sublime_text/sublime_text"
"/opt/sublime_text_3/sublime_text"
"/usr/bin/sublime_text" "/usr/bin/sublime_text"
"/usr/local/bin/sublime_text" "/usr/local/bin/sublime_text"
"/usr/bin/subl" "/usr/bin/subl"
...@@ -33,7 +34,7 @@ elif [[ "$OSTYPE" = darwin* ]]; then ...@@ -33,7 +34,7 @@ elif [[ "$OSTYPE" = darwin* ]]; then
for _sublime_path in $_sublime_darwin_paths; do for _sublime_path in $_sublime_darwin_paths; do
if [[ -a $_sublime_path ]]; then if [[ -a $_sublime_path ]]; then
alias subl="'$_sublime_path'" subl () { "$_sublime_path" $* }
alias st=subl alias st=subl
break break
fi fi
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# TaskWarrior<http://taskwarrior.org/>. It uses the zsh tab completion # TaskWarrior<http://taskwarrior.org/>. It uses the zsh tab completion
# script (_task) distributed with TaskWarrior for the completion definitions. # script (_task) distributed with TaskWarrior for the completion definitions.
# #
# Typing task[tabtab] will give you a list of current tasks, task 66[tabtab] # Typing task [tabtab] will give you a list of current tasks, task 66[tabtab]
# gives a list of available modifications for that task, etc. # gives a list of available modifications for that task, etc.
################################################################################ ################################################################################
......
#compdef tugboat
#autoload
# Tugboat zsh autocompletion
local -a _commands
_commands=(
'add-key:[NAME] Upload an ssh public key.'
'authorize:Authorize a DigitalOcean account with tugboat.'
'create:[NAME] Create a droplet.'
'destroy:[FUZZY_NAME] Destroy a droplet.'
'destroy_image:[FUZZY_NAME] Destroy an image.'
'droplets:Retrieve a list of your droplets.'
'halt:[FUZZY_NAME] Shutdown a droplet.'
'help:[COMMAND] Describe commands or a specific command.'
'images:Retrieve a list of your images.'
'info:[FUZZY_NAME] [OPTIONS] Show a droplets information.'
'info_image:[FUZZY_NAME] [OPTIONS] Show an images information.'
'keys:Show available SSH keys.'
'password-reset:[FUZZY_NAME] Reset root password.'
'rebuild:[FUZZY_NAME] [IMAGE_NAME] Rebuild a droplet.'
'regions:Show regions.'
'resize:[FUZZY_NAME -s, --size=N] Resize a droplet.'
'restart:[FUZZY_NAME] Restart a droplet.'
'sizes:Show available droplet sizes.'
'snapshot:[SNAPSHOT_NAME] [FUZZY_NAME] [OPTIONS] Queue a snapshot of the droplet.'
'ssh:[FUZZY_NAME] SSH into a droplet.'
'start:[FUZZY_NAME] Start a droplet.'
'verify:Check your DigitalOcean credentials.'
'version:Show version.'
'wait:[FUZZY_NAME] Wait for a droplet to reach a state.'
)
local -a _create_arguments
_create_arguments=(
'-s:[--size=N] The size_id of the droplet'
'-i:[--image=N] The image_id of the droplet'
'-r:[--region=N] The region_id of the droplet'
'-k:[--keys=KEYS] A comma separated list of SSH key ids to add to the droplet'
'-p:[--private-networking] Enable private networking on the droplet'
'-b:[--backups-enabled] Enable backups on the droplet'
'-q:[--quiet]'
)
__task_list ()
{
local expl
declare -a tasks
arguments=(add-key authorize create destroy destroy_image droplets halt help images info info_image keys password-reset rebuild regions resize restart sizes snapshot ssh start verify version wait)
_wanted tasks expl 'help' compadd $arguments
}
__droplets_list ()
{
_wanted application expl 'command' compadd $(command tugboat droplets | cut -d " " -f1)
}
__tugboat-create ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "gem subcommand" _create_arguments
return
;;
esac
}
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "gem subcommand" _commands
return
;;
(options)
case $line[1] in
(help)
_arguments ':feature:__task_list'
;;
(ssh)
_arguments ':feature:__droplets_list'
;;
(create)
_arguments ':feature:__tugboat-create'
;;
esac
;;
esac
vi-mode
=======
This plugin increase `vi-like` zsh functionality.
Use `ESC` or `CTRL-[` to enter `Normal mode`.
History
-------
- `ctrl-p` : Previous command in history
- `ctrl-n` : Next command in history
- `/` : Search backward in history
- `n` : Repeat the last `/`
Mode indicators
---------------
*Normal mode* is indicated with red `<<<` mark at the right prompt, when it
wasn't defined by theme.
Vim edition
-----------
- `v` : Edit current command line in Vim
Movement
--------
- `$` : To the end of the line
- `^` : To the first non-blank character of the line
- `0` : To the first character of the line
- `w` : [count] words forward
- `W` : [count] WORDS forward
- `e` : Forward to the end of word [count] inclusive
- `E` : Forward to the end of WORD [count] inclusive
- `b` : [count] words backward
- `B` : [count] WORDS backward
- `t{char}` : Till before [count]'th occurrence of {char} to the right
- `T{char}` : Till before [count]'th occurrence of {char} to the left
- `f{char}` : To [count]'th occurrence of {char} to the right
- `F{char}` : To [count]'th occurrence of {char} to the left
- `;` : Repeat latest f, t, F or T [count] times
- `,` : Repeat latest f, t, F or T in opposite direction
Insertion
---------
- `i` : Insert text before the cursor
- `I` : Insert text before the first character in the line
- `a` : Append text after the cursor
- `A` : Append text at the end of the line
- `o` : Insert new command line below the current one
- `O` : Insert new command line above the current one
Delete and Insert
-----------------
- `ctrl-h` : While in *Insert mode*: delete character after the cursor
- `ctrl-w` : While in *Insert mode*: delete word after the cursor
- `d{motion}` : Delete text that {motion} moves over
- `dd` : Delete line
- `D` : Delete characters under the cursor until the end of the line
- `c{motion}` : Delete {motion} text and start insert
- `cc` : Delete line and start insert
- `C` : Delete to the end of the line and start insert
- `r{char}` : Replace the character under the cursor with {char}
- `R` : Enter replace mode: Each character replaces existing one
- `x` : Delete [count] characters under and after the cursor
- `X` : Delete [count] characters before the cursor
virtualenvwrapper='virtualenvwrapper.sh' virtualenvwrapper='virtualenvwrapper.sh'
if (( $+commands[$virtualenvwrapper] )); then if (( $+commands[$virtualenvwrapper] )); then
source ${${virtualenvwrapper}:c} function {
setopt local_options
unsetopt equals
source ${${virtualenvwrapper}:c}
}
elif [[ -f "/etc/bash_completion.d/virtualenvwrapper" ]]; then elif [[ -f "/etc/bash_completion.d/virtualenvwrapper" ]]; then
virtualenvwrapper="/etc/bash_completion.d/virtualenvwrapper" function {
source "/etc/bash_completion.d/virtualenvwrapper" setopt local_options
unsetopt equals
virtualenvwrapper="/etc/bash_completion.d/virtualenvwrapper"
source "/etc/bash_completion.d/virtualenvwrapper"
}
else else
print "zsh virtualenvwrapper plugin: Cannot find ${virtualenvwrapper}.\n"\ print "zsh virtualenvwrapper plugin: Cannot find ${virtualenvwrapper}.\n"\
"Please install with \`pip install virtualenvwrapper\`" >&2 "Please install with \`pip install virtualenvwrapper\`" >&2
......
...@@ -11,6 +11,7 @@ function web_search() { ...@@ -11,6 +11,7 @@ function web_search() {
yahoo "https://search.yahoo.com/search?p=" yahoo "https://search.yahoo.com/search?p="
duckduckgo "https://www.duckduckgo.com/?q=" duckduckgo "https://www.duckduckgo.com/?q="
yandex "https://yandex.ru/yandsearch?text=" yandex "https://yandex.ru/yandsearch?text="
github "https://github.com/search?q="
) )
# define the open command # define the open command
...@@ -49,6 +50,7 @@ alias google='web_search google' ...@@ -49,6 +50,7 @@ alias google='web_search google'
alias yahoo='web_search yahoo' alias yahoo='web_search yahoo'
alias ddg='web_search duckduckgo' alias ddg='web_search duckduckgo'
alias yandex='web_search yandex' alias yandex='web_search yandex'
alias github='web_search github'
#add your own !bang searches here #add your own !bang searches here
alias wiki='web_search duckduckgo \!w' alias wiki='web_search duckduckgo \!w'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment