Commit 56a5793ce0b299e213fb207d6cea94b929d5a13b

Authored by mj
1 parent 093a6c34bc
Exists in master and in 2 other branches 02-merge, dev

Squashed 'repos/robbyrussell/oh-my-zsh/' changes from 5ee5403..6ddd44a

6ddd44a Merge pull request #3622 from koddsson/notifier-plugin-if-order
656db4d Merge pull request #3623 from uberspot/nmap_feat
1308515 Re-order OS detection if..else statement.
0dc7b5c add nmap plugin with some aliases for scan modes
31e29e1 Merge pull request #3625 from tandrup/master
1dcc81c Merge pull request #3630 from designorant/grunt-plugin-update
8b45118 Update Grunt plugin to 0.1.2
7fc47e7 Fixing spaces in title and message given to bgnotify on OS X
677acc3 Merge pull request #3486 from ckesc/master
bd792f0 Merge pull request #3444 from lululau/httpie-pr
9aa11c3 Merge pull request #3458 from rexk/feature/go-plugin-upgrade
86a41a8 Merge pull request #3480 from dskecse/add-rails-rdms-alias
d28917d Merge pull request #1999 from akatov/carton
78cfe75 Merge pull request #3301 from t413/master
aa9325a Merge pull request #3025 from DanielOaks/ys-newness
b91ca24 Merge pull request #3394 from zghember/master
4353162 Merge pull request #2407 from mgalgs/gmt-compdef
237304a Merge pull request #2346 from zsiciarz/master
2728543 Merge pull request #3508 from joshtronic/patch-1
07ebfd8 Merge pull request #3497 from hsingh23/patch-1
9c0b643 Merge pull request #3509 from joshtronic/patch-2
ff6ca9b Merge pull request #3538 from TheLinuxKitten/grep-if-color
e2fd99a Merge pull request #3526 from DariusPHP/master
be63e8b Merge pull request #3518 from mfaerevaag/master
6809b42 Merge pull request #3541 from agios/tmuxinator
983c0c9 Merge pull request #3615 from mopsfelder/hgprompt
49a3dd1 Merge pull request #3608 from idjaw/master
c4c3d32 Merge pull request #3544 from tejasbubane/add-all-alias-in-git-plugin
7649c29 Merge pull request #2009 from akatov/grunt
9d0a9b8 Merge pull request #3559 from WarFox/feature/mvn-plugin-src-docs
d80f620 Merge pull request #3561 from jakobj/master
7c2d84f Merge pull request #3569 from avalent/master
2f23f33 Merge pull request #3577 from jameswomack/npm_convenience_aliases
377b1f9 Merge pull request #3580 from LukasDoe/master
e1bcd77 Merge pull request #3601 from nextgenthemes/master
57ed0cd Merge pull request #3598 from roderickrandolph/master
56bc1c3 Merge pull request #3609 from craigp/added_local_hex_to_mix_plugin
43bdea4 Removing say() function in perl plugin so that it doesn't overwrite OSX comand line utility. Closes #2562
ce607d3 Adding keystrong return to oascrupt per suggestion by @enzzzy. Fixes #2913.
6713aef Merge branch 'master' of github.com:robbyrussell/oh-my-zsh
aa16e18 Updating histoby-substring-search README to instruct user to load plugins via .zshrc. Closes #1832.
7b71dcc Merge pull request #3610 from bderrly/zle-active-check
d7837c6 Shorten the zle check and reset-prompt into one line.
efd6d4d Merge pull request #3597 from apjanke/no-dot-in-cdpath
a1de65e Removing  --no-check-certificate from README
5cd3182 Missed a few textile formatting spots
caac64c Few copy edits to README
8f1741d Moving README to markdown... and taking first steps at reorganizing it. Also updated the LICENSE to reflect 2015.
0a99ca0 plugins: mercurial: Update the order prompt vars are displayed
77140a2 Merge pull request #3603 from alx741/master
bc8abe5 Verify zle is active before trying to reset-prompt.
9bf1960 Merge pull request #3607 from mcornella/drop-insecure-url
aff01d9 Update readme.md
3936763 Markdown bolds to capital letters
8ce1245 added the 'mix local.hex' command to plugin completions
e10470f Adding ssh-config to vagrant plugin autocomplete. Was missing
152a751 Revert usage of install.ohmyz.sh URL, until HTTPS support.
223197b Merge pull request #3533 from maff/chucknorris-fortune
8d561aa Merge pull request #3573 from mcornella/fix-taskwarrior-first-completion
dcc08b0 Merge pull request #3545 from BilalBudhani/ember-cli-plugin
9a58e8d Merge pull request #3578 from ctroncoso/patch-1
67fff60 Merge pull request #3589 from miguxbe/master
84a318b Merge pull request #3590 from voronkovich/master
5b429b6 Merge pull request #3596 from kossmac/master
24ebf9c Merge pull request #3591 from zmwangx/ls-variants
c5e8713 Merge pull request #3594 from pi0/master
33900df PLUGINS: vi-mode: allow ctrl-h, ctrl-?, ctrl-w for char and word deletion
099246d PLUGINS: vi-mode: allow ctrl-p, ctrl-n for history navigation
d8b9932 Update readme.md
660eeb1 Update readme.md
3120b9a Update readme.md
f50b3fe Create ubuntu plugin, based on debian plugin.
6b29aab Create readme.md
8b5950b Fix: "\s" is a gawk-specific regexp operator.
23d4e7e Merge pull request #1 from roderickrandolph/fix-return-status-arrow-color
46e6e2e Fixes incorrect prompt arrow color
6ccf67a Do not put explicit dot in $cdpath, since it causes problems on Cygwin due to an underlying zsh bug.
cd36ded added stats command to docker plugin
7c73a3a Laravel 5 support
2790a5e Bring back -h option to ls variants
b39dbec Fix tmuxinator completion for symlinked dirs
ec9525b Add initial JHBuild plugin support
7c00bcd Modify theme to optimize the usability, when you use solarized dark as shell color scheme.
4b20bfe Fix first-tab completion in task command
68955f1 docker containers based on defined names
6967393 Add convenience aliases for installation of npm modules
3b6a695 Merge branch 'master' of github.com:avalent/oh-my-zsh
3ba10ad Added cab autocompletion to the cabal plugin.
6bccb1a removed superfluous vcs_info_msg in trapd00r theme
fc606d9 Added alias for downloading maven dependencies' sources and javadocs
2e0da68 add chucknorris plugin
431faa9 Creates Ember-cli plugin and Adds its aliases
8cb97d6 Add alias for git add --all
f2130fa Test if --color=auto is a valid option for grep
c4d3de1 added server:run alias
4533c7a [wd] Update to v0.4.1
49549d9 Update git-hubflow.plugin.zsh
fd3a348 Update git-flow.plugin.zsh
b2f8764 Adds completions to wp-cli plugin
5b90092 Sublime Text plugin: added sst alias for sudo run sublime
a55a313 Add rdms alias to rails plugin
8105d4a Merge commit '175b4a807383530aa75145b5b6fdedb3ce1f11f2'
8790fa3 go plugin upgrade for version 1.4
957564a Add completion for httpie
6fd0b73 Merge commit '141c2e593401f245a9f9bb0799ada8bf14b677d7'
6f70d28 Update theme "jispwoso" to support ret status and git
fd69c34 Add screenshots to readme
98fc8dd Fix for OS X when no window id is returned (like on the desktop)
cbec1d7 Add window ID fallback for windows.
3d376bb Fix renamed method issue.
adafe27 add cygwin windows support with notifu, add to readme
0b0cc2c Fixed math on linux, removed debug echo.
e16d3e4 Add bgnotify plugin, a cross-platform background notifier!
49e10ae Make 'ys' theme use hg repo info too
1274a5e Added cabal freeze subcommand.
1ab0f77 Updated cabal commands for Cabal 1.20
859a37d Fixed typo in cabal plugin.
d3acea3 Updated cabal plugin with Cabal 1.18 commands.
33ef34b Fix gmt compdef
1af012d carton was renamed to cask
55c90b1 grunt completion courtesy of @yonchu: https://github.com/yonchu/grunt-zsh-completion
7fb1712 carton completion plugin

git-subtree-dir: repos/robbyrussell/oh-my-zsh
git-subtree-split: 6ddd44a341c77910ac64ec2f67ee762ecebcc82d

Showing 56 changed files with 2062 additions and 175 deletions Inline Diff

1 The MIT License 1 The MIT License
2 2
3 Copyright (c) 2009-2014 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors) 3 Copyright (c) 2009-2015 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
4 4
5 Permission is hereby granted, free of charge, to any person obtaining a copy 5 Permission is hereby granted, free of charge, to any person obtaining a copy
6 of this software and associated documentation files (the "Software"), to deal 6 of this software and associated documentation files (the "Software"), to deal
7 in the Software without restriction, including without limitation the rights 7 in the Software without restriction, including without limitation the rights
8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 copies of the Software, and to permit persons to whom the Software is 9 copies of the Software, and to permit persons to whom the Software is
10 furnished to do so, subject to the following conditions: 10 furnished to do so, subject to the following conditions:
11 11
12 The above copyright notice and this permission notice shall be included in 12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software. 13 all copies or substantial portions of the Software.
14 14
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 THE SOFTWARE. 21 THE SOFTWARE.
22 22
File was created 1 ![Oh My Zsh](https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png)
2
3
4 Oh My Zsh is an open source, community-driven framework for managing your [zsh](http://www.zsh.org/) configuration. That sounds boring. Let's try this again.
5
6 __Oh My Zsh is a way of life!__ Once installed, your terminal prompt will become the talk of the town _or your money back!_ Each time you interace with your command prompt, you'll be able take advantage of the hundreds of bundled plugins and pretty themes. Strangers will come up to you in cafés and ask you, _"that is amazing. are you some sort of genius?"_ Finally, you'll begin to get the sort of attention that you always felt that you deserved. ...or maybe you'll just use the time that you saved to start flossing more often.
7
8 To learn more, visit http://ohmyz.sh and/or follow [ohmyzsh](https://twitter.com/ohmyzsh) on twitter.
9
10 ## Getting Started
11
12
13 ### Prerequisites
14
15 __Disclaimer:__ _Oh My Zsh works best on Mac OS X and Linux._
16
17 * Unix-based operating system (Mac OS X or Linux)
18 * [Zsh](http://www.zsh.org) should be installed (v4.3.9 or more recent)
19 * This is commonly pre-installed. (`zsh --version` to confirm)
20 * `curl` or `wget` should be installed
21
22 ### Basic Installation
23
24 Oh My Zsh is installed by running one of the following commands in your terminal. You can install this via the command-line with either `curl` or `wget`.
25
26 #### via curl
27
28 `curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh`
29
30 #### via wget
31
32 `wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh`
33
34 ## Using Oh My Zsh
35
36 ### Plugins
37
38 Oh My Zsh comes with a shit load of plugins to take advantage of. You can take a look in the [plugins](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins) directory and/or the [wiki](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins) to see what's currently available.
39
40 #### Enabling Plugins
41
42 If you spot a plugin (or several) that you would like to use with Oh My Zsh, you will need to edit the `~/.zshrc` file. Once you open it with your favorite editor, you'll see a spot to list all the plugins that you'd like Oh My Zsh to load in initialization.
43
44 For example, this line might begin to look like...
45
46 `plugins=(git bundler osx rake ruby)`
47
48 #### Using Plugins
49
50 Most plugins (should! we're working on this) include a __README__, which documents how to use them.
51
52 ### Themes
53
54 We'll admit it. Early in the Oh My Zsh world... we may have gotten a far too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://wiki.github.com/robbyrussell/oh-my-zsh/themes) on the wiki. Check them out!
55
56 #### Selecting a Theme
57
58 _Robby's theme is the default one. It's not the fanciest one. It's not the simplest one. It's just right (for him)._
59
60 Once you find a theme that you want to use, you will need to edit the `~/.zshrc` file. You'll see an environment variable (all caps) in there that looks like:
61
62 `ZSH_THEME="robbyrussell"`
63
64 To use a different theme, simple change the value to match the name of your desired theme. For example:
65
66 `ZSH_THEME="agnoster"` (this is one of the fancy ones)
67
68 Open up a new terminal window and your prompt should look something like...
69
70 ## Advanced Topics
71
72 If you're the type that likes to get their hands dirty... these sections might resonate.
73
74 ### Advanced Installation
75
76 For those who want to install this manually and/or set custom paths.
77
78 #### Custom Directory
79
80 The default location is `~/.oh-my-zsh` (hidden in your home directory)
81
82 If you'd like to change the install directory with the `ZSH` environment variable, either by running `export ZSH=/your/path` before installing, or by setting it before the end of the install pipeline like this:
83
84 `curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | ZSH=~/.dotfiles/zsh sh`
85
86 #### Manual Installation
87
88 ##### 1. Clone the repository:
89
90 `git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh`
91
92 ##### 2. *Optionally*, backup your existing @~/.zshrc@ file:
93
94 `cp ~/.zshrc ~/.zshrc.orig`
95
96 ##### 3. Create a new zsh configuration file
97
98 You can create a new zsh config file by copying the template that we included for you.
99
100 `cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc`
101
102 ##### 4. Change your default shell
103
104 `chsh -s /bin/zsh`
105
106 ##### 5. Initialize your new zsh configuration
107
108 Once you open up a new terminal window, it should load zsh with Oh My Zsh's configuration.
109
110 ### Installation Problems
111
112 If you have any hiccups installing, here are a few common fixes.
113
114 * You _might_ need to modify your `PATH` in `~/.zshrc` if you're not able to find some commands after switching to `oh-my-zsh`.
115 * If you installed manually or changed the install location, check the `ZSH` environment variable in `~/.zshrc`.
116
117 ### Custom Plugins and Themes
118
119 If you want to override any of the default behaviors, just add a new file (ending in `.zsh`) in the `custom/` directory.
120
121 If you have many functions that go well together, you can put them as a `abcyzeae.plugin.zsh` file in the `custom/plugins/` directory and then enable this plugin.
122
123 If you would like to override the functionality of a plugin distributed with Oh My Zsh, create a plugin of the same name in the `custom/plugins/` directory and it will be loaded instead of the one in `plugins/`.
124
125 ## Getting Updates
126
127 By default, you will be prompted to check for upgrades every few weeks. If you would like `oh-my-zsh` to automatically upgrade itself without prompting you, set the following in your `~/.zshrc`:
128
129 `DISABLE_UPDATE_PROMPT=true`
130
131 To disable automatic upgrades, set the following in your `~/.zshrc`:
132
133 `DISABLE_AUTO_UPDATE=true`
134
135 ### Manual Updates
136
137 If you'd like to upgrade at any point in time (maybe someone just released a new plugin and you don't want to wait a week?)... you just need to run:
138
139 `upgrade_oh_my_zsh`
140
141 Magic!
142
143 ## Uninstalling Oh My Zsh
144
145 Oh My Zsh isn't for everyone. We'll miss you, but we want to make this an easy breakup.
146
147 If you want to uninstall `oh-my-zsh`, just run `uninstall_oh_my_zsh` from the command-line. It will remove itself and revert your previous `bash` or `zsh` configuration.
148
149 ## Contributing
150
151 I'm far from being a [Zsh](http://www.zsh.org/) expert and suspect there are many ways to improve – if you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
152
153 We also need people to test out pull-requests. So take a look through [the open issues](https://github.com/robbyrussell/oh-my-zsh/issues) and help where you can.
154
155 ### Do NOT Send Us Themes
156
157 We have (more than) enough themes for the time being. Please fork the project and add one in there – you can let people know how to grab it from there.
158
159 ## Contributors
160
161 Oh My Zsh has a vibrant community of happy users and delightful contributors. Without all the time and help from our contributors, it wouldn't be so awesome.
162
163 Thank you so much!
164
165 ## Follow Us
166
167 We have an [ohmyzsh](https://twitter.com/ohmyzsh) account. You should follow it.
168
169 ## Merchandise
170
171 We have [stickers](http://shop.planetargon.com/products/ohmyzsh-stickers-set-of-3-stickers) and [shirts](http://shop.planetargon.com/products/ohmyzsh-t-shirts) for you to show off your love of Oh My Zsh. Again, this will help you become the talk of the town!
172
173 ## LICENSE
174
175 Oh My Zsh is released under the [MIT license](https://github.com/robbyrussell/oh-my-zsh/blob/master/MIT-LICENSE.txt).
176
README.textile
1 !https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png! File was deleted
2
3 @oh-my-zsh@ is an open source, community-driven framework for managing your "Zsh":http://www.zsh.org/ configuration.
4
5 It comes bundled with a ton of helpful functions, helpers, plugins, themes, and a few things that make you shout…
6
7 bq. "OH MY ZSHELL!"
8
9 h2. Setup
10
11 @oh-my-zsh@ should work with any recent release of "Zsh":http://www.zsh.org/. The minimum recommended version is *4.3.9*.
12
13 If not already installed, you can install "Zsh":http://www.zsh.org/ using the command-line.
14
15 h3. The automatic installer… do you trust me?
16
17 You can install this via the command-line with either @curl@ or @wget@.
18
19 h4. via @curl@:
20
21 @curl -L http://install.ohmyz.sh | sh@
22
23 h4. via @wget@:
24
25 @wget --no-check-certificate http://install.ohmyz.sh -O - | sh@
26
27 h4. *Optionally*, change the install directory:
28
29 The default location is @~/.oh-my-zsh@ (hidden in your home directory).
30
31 You can change the install directory with the @ZSH@ environment variable, either by running @export ZSH=/your/path@ before installing, or by setting it before the end of the install pipeline like this:
32
33 @curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | ZSH=~/.dotfiles/zsh sh@
34
35 h3. The manual way
36
37 1. Clone the repository:
38
39 @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
40
41 2. *Optionally*, backup your existing @~/.zshrc@ file:
42
43 @cp ~/.zshrc ~/.zshrc.orig@
44
45 3. Create a new "Zsh":http://www.zsh.org/ config file by copying the "Zsh":http://www.zsh.org/ template we've provided:
46
47 @cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
48
49 4. Set "Zsh":http://www.zsh.org/ as your default shell:
50
51 @chsh -s /bin/zsh@
52
53 5. Start or restart "Zsh":http://www.zsh.org/ by opening a new command-line window.
54
55 h3. Problems?
56
57 You _might_ need to modify your @PATH@ in @~/.zshrc@ if you're not able to find some commands after switching to @oh-my-zsh@.
58
59 If you installed manually or changed the install location, check the @ZSH@ environment variable in @~/.zshrc@.
60
61 h2. Usage
62
63 * enable the plugins you want in your @~/.zshrc@ (take a look at the @plugins/@ directory and the "wiki":https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins to see what's available)
64 ** example: @plugins=(git osx ruby)@
65 * theme support: change the @ZSH_THEME@ environment variable in @~/.zshrc@
66 ** take a look at the @themes/@ directory and the "wiki":https://wiki.github.com/robbyrussell/oh-my-zsh/themes to see what comes bundled with @oh-my-zsh@
67 * & much, much more… take a look at the @lib/@ directory to see what @oh-my-zsh@ has to offer…
68
69 h2. Useful
70
71 The "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty useful for tips.
72
73 h3. Customization
74
75 If you want to override any of the default behaviors, just add a new file (ending in @.zsh@) in the @custom/@ directory.
76
77 If you have many functions that go well together, you can put them as a @*.plugin.zsh@ file in the @custom/plugins/@ directory and then enable this plugin (see '"Usage":https://github.com/robbyrussell/oh-my-zsh#usage' above).
78
79 If you would like to override the functionality of a plugin distributed with @oh-my-zsh@, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@.
80
81 h3. Updates
82
83 By default you will be prompted to check for upgrades. If you would like @oh-my-zsh@ to automatically upgrade itself without prompting you, set the following in your @~/.zshrc@:
84
85 @DISABLE_UPDATE_PROMPT=true@
86
87 To disable upgrades entirely, set the following in your @~/.zshrc@:
88
89 @DISABLE_AUTO_UPDATE=true@
90
91 To upgrade directly from the command-line, just run @upgrade_oh_my_zsh@.
92
93 h3. Uninstalling
94
95 If you want to uninstall @oh-my-zsh@, just run @uninstall_oh_my_zsh@ from the command-line and it'll remove itself and revert you to @bash@ (or your previous "Zsh":http://www.zsh.org/ configuration).
96
97 h2. Help out!
98
99 I'm far from being a "Zsh":http://www.zsh.org/ expert and suspect there are many ways to improve – if you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
100
101 h3. (Don't) send us your theme (for now)!
102
103 -I'm hoping to collect a bunch of themes – you can see existing ones in the @themes/@ directory.-
104
105 We have enough themes for the time being. Please fork the project and add on in there – you can let people know how to grab it from there.
106
107 h2. Contributors
108
109 This project wouldn't exist without all of our awesome users and contributors: "view our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors
110
111 Thank you so much!
112 1 !https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png!
1 # fixme - the load process here seems a bit bizarre 1 # fixme - the load process here seems a bit bizarre
2 2
3 unsetopt menu_complete # do not autoselect the first completion entry 3 unsetopt menu_complete # do not autoselect the first completion entry
4 unsetopt flowcontrol 4 unsetopt flowcontrol
5 setopt auto_menu # show completion menu on succesive tab press 5 setopt auto_menu # show completion menu on succesive tab press
6 setopt complete_in_word 6 setopt complete_in_word
7 setopt always_to_end 7 setopt always_to_end
8 8
9 WORDCHARS='' 9 WORDCHARS=''
10 10
11 zmodload -i zsh/complist 11 zmodload -i zsh/complist
12 12
13 ## case-insensitive (all),partial-word and then substring completion 13 ## case-insensitive (all),partial-word and then substring completion
14 if [ "x$CASE_SENSITIVE" = "xtrue" ]; then 14 if [ "x$CASE_SENSITIVE" = "xtrue" ]; then
15 zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' 15 zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
16 unset CASE_SENSITIVE 16 unset CASE_SENSITIVE
17 else 17 else
18 zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' 18 zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
19 fi 19 fi
20 20
21 zstyle ':completion:*' list-colors '' 21 zstyle ':completion:*' list-colors ''
22 22
23 # should this be in keybindings? 23 # should this be in keybindings?
24 bindkey -M menuselect '^o' accept-and-infer-next-history 24 bindkey -M menuselect '^o' accept-and-infer-next-history
25 25
26 zstyle ':completion:*:*:*:*:*' menu select 26 zstyle ':completion:*:*:*:*:*' menu select
27 zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' 27 zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
28 if [ "$OSTYPE[0,7]" = "solaris" ] 28 if [ "$OSTYPE[0,7]" = "solaris" ]
29 then 29 then
30 zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm" 30 zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm"
31 else 31 else
32 zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w" 32 zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w"
33 fi 33 fi
34 34
35 # disable named-directories autocompletion 35 # disable named-directories autocompletion
36 zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories 36 zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
37 cdpath=(.)
38 37
39 # Use caching so that commands like apt and dpkg complete are useable 38 # Use caching so that commands like apt and dpkg complete are useable
40 zstyle ':completion::complete:*' use-cache 1 39 zstyle ':completion::complete:*' use-cache 1
41 zstyle ':completion::complete:*' cache-path $ZSH_CACHE_DIR 40 zstyle ':completion::complete:*' cache-path $ZSH_CACHE_DIR
42 41
43 # Don't complete uninteresting users 42 # Don't complete uninteresting users
44 zstyle ':completion:*:*:*:users' ignored-patterns \ 43 zstyle ':completion:*:*:*:users' ignored-patterns \
45 adm amanda apache at avahi avahi-autoipd beaglidx bin cacti canna \ 44 adm amanda apache at avahi avahi-autoipd beaglidx bin cacti canna \
46 clamav daemon dbus distcache dnsmasq dovecot fax ftp games gdm \ 45 clamav daemon dbus distcache dnsmasq dovecot fax ftp games gdm \
47 gkrellmd gopher hacluster haldaemon halt hsqldb ident junkbust kdm \ 46 gkrellmd gopher hacluster haldaemon halt hsqldb ident junkbust kdm \
48 ldap lp mail mailman mailnull man messagebus mldonkey mysql nagios \ 47 ldap lp mail mailman mailnull man messagebus mldonkey mysql nagios \
49 named netdump news nfsnobody nobody nscd ntp nut nx obsrun openvpn \ 48 named netdump news nfsnobody nobody nscd ntp nut nx obsrun openvpn \
50 operator pcap polkitd postfix postgres privoxy pulse pvm quagga radvd \ 49 operator pcap polkitd postfix postgres privoxy pulse pvm quagga radvd \
51 rpc rpcuser rpm rtkit scard shutdown squid sshd statd svn sync tftp \ 50 rpc rpcuser rpm rtkit scard shutdown squid sshd statd svn sync tftp \
52 usbmux uucp vcsa wwwrun xfs '_*' 51 usbmux uucp vcsa wwwrun xfs '_*'
53 52
54 # ... unless we really want to. 53 # ... unless we really want to.
55 zstyle '*' single-ignored show 54 zstyle '*' single-ignored show
56 55
57 if [ "x$COMPLETION_WAITING_DOTS" = "xtrue" ]; then 56 if [ "x$COMPLETION_WAITING_DOTS" = "xtrue" ]; then
58 expand-or-complete-with-dots() { 57 expand-or-complete-with-dots() {
59 echo -n "\e[31m......\e[0m" 58 echo -n "\e[31m......\e[0m"
60 zle expand-or-complete 59 zle expand-or-complete
61 zle redisplay 60 zle redisplay
62 } 61 }
63 zle -N expand-or-complete-with-dots 62 zle -N expand-or-complete-with-dots
64 bindkey "^I" expand-or-complete-with-dots 63 bindkey "^I" expand-or-complete-with-dots
65 fi 64 fi
66 65
1 # Changing/making/removing directory 1 # Changing/making/removing directory
2 setopt auto_pushd 2 setopt auto_pushd
3 setopt pushd_ignore_dups 3 setopt pushd_ignore_dups
4 setopt pushdminus 4 setopt pushdminus
5 5
6 alias -g ...='../..' 6 alias -g ...='../..'
7 alias -g ....='../../..' 7 alias -g ....='../../..'
8 alias -g .....='../../../..' 8 alias -g .....='../../../..'
9 alias -g ......='../../../../..' 9 alias -g ......='../../../../..'
10 10
11 alias 1='cd -' 11 alias 1='cd -'
12 alias 2='cd -2' 12 alias 2='cd -2'
13 alias 3='cd -3' 13 alias 3='cd -3'
14 alias 4='cd -4' 14 alias 4='cd -4'
15 alias 5='cd -5' 15 alias 5='cd -5'
16 alias 6='cd -6' 16 alias 6='cd -6'
17 alias 7='cd -7' 17 alias 7='cd -7'
18 alias 8='cd -8' 18 alias 8='cd -8'
19 alias 9='cd -9' 19 alias 9='cd -9'
20 20
21 alias md='mkdir -p' 21 alias md='mkdir -p'
22 alias rd=rmdir 22 alias rd=rmdir
23 alias d='dirs -v | head -10' 23 alias d='dirs -v | head -10'
24 24
25 # List directory contents 25 # List directory contents
26 alias lsa='ls -lah' 26 alias lsa='ls -lah'
27 alias l='ls -la' 27 alias l='ls -lah'
28 alias ll='ls -l' 28 alias ll='ls -lh'
29 alias la='ls -lA' 29 alias la='ls -lAh'
30 30
31 # Push and pop directories on directory stack 31 # Push and pop directories on directory stack
32 alias pu='pushd' 32 alias pu='pushd'
33 alias po='popd' 33 alias po='popd'
34 34
1 # is x grep argument available? 1 # is x grep argument available?
2 grep-flag-available() { 2 grep-flag-available() {
3 echo | grep $1 "" >/dev/null 2>&1 3 echo | grep $1 "" >/dev/null 2>&1
4 } 4 }
5 5
6 GREP_OPTIONS=""
7
6 # color grep results 8 # color grep results
7 GREP_OPTIONS="--color=auto" 9 if grep-flag-available --color=auto; then
10 GREP_OPTIONS+=" --color=auto"
11 fi
8 12
9 # ignore VCS folders (if the necessary grep flags are available) 13 # ignore VCS folders (if the necessary grep flags are available)
10 VCS_FOLDERS="{.bzr,.cvs,.git,.hg,.svn}" 14 VCS_FOLDERS="{.bzr,.cvs,.git,.hg,.svn}"
11 15
12 if grep-flag-available --exclude-dir=.cvs; then 16 if grep-flag-available --exclude-dir=.cvs; then
13 GREP_OPTIONS+=" --exclude-dir=$VCS_FOLDERS" 17 GREP_OPTIONS+=" --exclude-dir=$VCS_FOLDERS"
14 elif grep-flag-available --exclude=.cvs; then 18 elif grep-flag-available --exclude=.cvs; then
15 GREP_OPTIONS+=" --exclude=$VCS_FOLDERS" 19 GREP_OPTIONS+=" --exclude=$VCS_FOLDERS"
16 fi 20 fi
17 21
18 # export grep settings 22 # export grep settings
19 alias grep="grep $GREP_OPTIONS" 23 alias grep="grep $GREP_OPTIONS"
20 24
21 # clean up 25 # clean up
22 unset GREP_OPTIONS 26 unset GREP_OPTIONS
23 unset VCS_FOLDERS 27 unset VCS_FOLDERS
24 unfunction grep-flag-available 28 unfunction grep-flag-available
25 29
plugins/bgnotify/README.md
File was created 1 # bgnotify zsh plugin
2
3 cross-platform background notifications for long running commands! Supports OSX and Ubuntu linux.
4
5 Standalone homepage: [t413/zsh-background-notify](https://github.com/t413/zsh-background-notify)
6
7 ----------------------------------
8
9 ## How to use!
10
11 Just add bgnotify to your plugins list in your `.zshrc`
12
13 - On OS X you'll need [terminal-notifer](https://github.com/alloy/terminal-notifier)
14 * `brew install terminal-notifier` (or `gem install terminal-notifier`)
15 - On ubuntu you're already all set!
16 - On windows you can use [notifu](http://www.paralint.com/projects/notifu/) or the Cygwin Ports libnotify package
17
18
19 ## Screenshots
20
21 **Linux**
22
23 ![screenshot from 2014-11-07 15 58 36](https://cloud.githubusercontent.com/assets/326829/4962187/256b465c-66da-11e4-927d-cc2fc105e31f.png)
24
25 **OS X**
26
27 ![screenshot 2014-11-08 14 15 12](https://cloud.githubusercontent.com/assets/326829/4965780/19fa3eac-6795-11e4-8ed6-0355711123a9.png)
28
29 **Windows**
30
31 ![screenshot from 2014-11-07 15 55 00](https://cloud.githubusercontent.com/assets/326829/4962159/a2625ca0-66d9-11e4-9e91-c5834913190e.png)
32
33
34 ## Configuration
35
36 One can configure a few things:
37
38 - `bgnotify_threshold` sets the notification threshold time (default 6 seconds)
39 - `function bgnotify_formatted` lets you change the notification
40
41 Use these by adding a function definition before the your call to source. Example:
42
43 ~~~ sh
44 bgnotify_threshold=4 ## set your own notification threshold
45
46 function bgnotify_formatted {
47 ## $1=exit_status, $2=command, $3=elapsed_time
48 [ $1 -eq 0 ] && title="Holy Smokes Batman!" || title="Holy Graf Zeppelin!"
49 bgnotify "$title -- after $3 s" "$2";
50 }
51
52 plugins=(git bgnotify) ## add to plugins list
53 source $ZSH/oh-my-zsh.sh ## existing source call
54 ~~~
55
plugins/bgnotify/bgnotify.plugin.zsh
File was created 1 #!/usr/bin/env zsh
2
3 ## setup ##
4
5 [[ -o interactive ]] || return #interactive only!
6 zmodload zsh/datetime || { print "can't load zsh/datetime"; return } # faster than date()
7 autoload -Uz add-zsh-hook || { print "can't add zsh hook!"; return }
8
9 (( ${+bgnotify_threshold} )) || bgnotify_threshold=5 #default 10 seconds
10
11
12 ## definitions ##
13
14 if ! (type bgnotify_formatted | grep -q 'function'); then
15 function bgnotify_formatted {
16 ## exit_status, command, elapsed_time
17 [ $1 -eq 0 ] && title="#win (took $3 s)" || title="#fail (took $3 s)"
18 bgnotify "$title" "$2"
19 }
20 fi
21
22 currentWindowId () {
23 if hash osascript 2>/dev/null; then #osx
24 osascript -e 'tell application (path to frontmost application as text) to id of front window' 2&> /dev/null || echo "0"
25 elif hash notify-send 2>/dev/null; then #ubuntu!
26 xprop -root | awk '/NET_ACTIVE_WINDOW/ { print $5; exit }'
27 else
28 echo $EPOCHSECONDS #fallback for windows
29 fi
30 }
31
32 bgnotify () {
33 if hash terminal-notifier 2>/dev/null; then #osx
34 terminal-notifier -message "$2" -title "$1"
35 elif hash growlnotify 2>/dev/null; then #osx growl
36 growlnotify -m $1 $2
37 elif hash notify-send 2>/dev/null; then #ubuntu!
38 notify-send $1 $2
39 elif hash notifu 2>/dev/null; then #cygwyn support!
40 notifu /m "$2" /p "$1"
41 fi
42 }
43
44
45 ## Zsh hooks ##
46
47 bgnotify_begin() {
48 bgnotify_timestamp=$EPOCHSECONDS
49 bgnotify_lastcmd=$1
50 bgnotify_windowid=$(currentWindowId)
51 }
52
53 bgnotify_end() {
54 didexit=$?
55 elapsed=$(( EPOCHSECONDS - bgnotify_timestamp ))
56 past_threshold=$(( elapsed >= bgnotify_threshold ))
57 if (( bgnotify_timestamp > 0 )) && (( past_threshold )); then
58 if [ $(currentWindowId) != "$bgnotify_windowid" ]; then
59 print -n "\a"
60 bgnotify_formatted "$didexit" "$bgnotify_lastcmd" "$elapsed"
61 fi
62 fi
63 bgnotify_timestamp=0 #reset it to 0!
64 }
65
66 add-zsh-hook preexec bgnotify_begin
67 add-zsh-hook precmd bgnotify_end
68
plugins/cabal/cabal.plugin.zsh
1 function cabal_sandbox_info() { 1 function cabal_sandbox_info() {
2 cabal_files=(*.cabal(N)) 2 cabal_files=(*.cabal(N))
3 if [ $#cabal_files -gt 0 ]; then 3 if [ $#cabal_files -gt 0 ]; then
4 if [ -f cabal.sandbox.config ]; then 4 if [ -f cabal.sandbox.config ]; then
5 echo "%{$fg[green]%}sandboxed%{$reset_color%}" 5 echo "%{$fg[green]%}sandboxed%{$reset_color%}"
6 else 6 else
7 echo "%{$fg[red]%}not sandboxed%{$reset_color%}" 7 echo "%{$fg[red]%}not sandboxed%{$reset_color%}"
8 fi 8 fi
9 fi 9 fi
10 } 10 }
11 11
12 function _cabal_commands() { 12 function _cabal_commands() {
13 local ret=1 state 13 local ret=1 state
14 _arguments ':subcommand:->subcommand' && ret=0 14 _arguments ':subcommand:->subcommand' && ret=0
15 15
16 case $state in 16 case $state in
17 subcommand) 17 subcommand)
18 subcommands=( 18 subcommands=(
19 "bench:Run the benchmark, if any (configure with UserHooks)" 19 "bench:Run the benchmark, if any (configure with UserHooks)"
20 "build:Make this package ready for installation" 20 "build:Compile all targets or specific target."
21 "check:Check the package for common mistakes" 21 "check:Check the package for common mistakes"
22 "clean:Clean up after a build" 22 "clean:Clean up after a build"
23 "copy:Copy teh files into the install locations" 23 "copy:Copy the files into the install locations"
24 "configure:Prepare to build the package" 24 "configure:Prepare to build the package"
25 "exec:Run a command with the cabal environment"
25 "fetch:Downloads packages for later installation" 26 "fetch:Downloads packages for later installation"
26 "haddock:Generate HAddock HTML documentation" 27 "freeze:Freeze dependencies."
28 "get:Gets a package's source code"
29 "haddock:Generate Haddock HTML documentation"
27 "help:Help about commands" 30 "help:Help about commands"
28 "hscolour:Generate HsColour colourised code, in HTML format" 31 "hscolour:Generate HsColour colourised code, in HTML format"
29 "info:Display detailed information about a particular package" 32 "info:Display detailed information about a particular package"
30 "init:Interactively create a .cabal file" 33 "init:Interactively create a .cabal file"
31 "install:Installs a list of packages" 34 "install:Installs a list of packages"
32 "list:List packages matching a search string" 35 "list:List packages matching a search string"
33 "register:Register this package with the compiler" 36 "register:Register this package with the compiler"
37 "repl:Open an interpreter session for the given target"
34 "report:Upload build reports to a remote server" 38 "report:Upload build reports to a remote server"
39 "run:Runs the compiled executable"
40 "sandbox:Create/modify/delete a sandbox"
35 "sdist:Generate a source distribution file (.tar.gz)" 41 "sdist:Generate a source distribution file (.tar.gz)"
36 "test:Run the test suite, if any (configure with UserHooks)" 42 "test:Run the test suite, if any (configure with UserHooks)"
37 "unpack:Unpacks packages for user inspection" 43 "unpack:Unpacks packages for user inspection"
38 "update:Updates list of known packages" 44 "update:Updates list of known packages"
39 "upload:Uploads source packages to Hackage" 45 "upload:Uploads source packages to Hackage"
40 ) 46 )
41 _describe -t subcommands 'cabal subcommands' subcommands && ret=0 47 _describe -t subcommands 'cabal subcommands' subcommands && ret=0
42 esac 48 esac
43 49
44 return ret 50 return ret
45 } 51 }
46 52
47 compdef _cabal_commands cabal 53 compdef _cabal_commands cabal
54
55 function _cab_commands() {
56 local ret=1 state
57 _arguments ':subcommand:->subcommand' && ret=0
58
59 case $state in
60 subcommand)
61 subcommands=(
62 "sync:Fetch the latest package index"
63 "install:Install packages"
64 "uninstall:Uninstall packages"
65 "installed:List installed packages"
66 "configure:Configure a cabal package"
67 "build:Build a cabal package"
68 "clean:Clean up a build directory"
69 "outdated:Display outdated packages"
70 "info:Display information of a package"
71 "sdist:Make tar.gz for source distribution"
72 "upload:Uploading tar.gz to HackageDB"
73 "get:Untar a package in the current directory"
74 "deps:Show dependencies of this package"
75 "revdeps:Show reverse dependencies of this package"
76 "check:Check consistency of packages"
77 "genpaths:Generate Paths_<pkg>.hs"
78 "search:Search available packages by package name"
79 "add:Add a source directory"
80 "test:Run tests"
81 "bench:Run benchmarks"
82 "doc:Generate manuals"
83 "ghci:Run GHCi (with a sandbox)"
84 "init:Initialize a sandbox"
85 "help:Display the help message of the command"
86 )
87 _describe -t subcommands 'cab subcommands' subcommands && ret=0
88 esac
89
90 return ret
91 }
92
93 command -v cab >/dev/null 2>&1 && { compdef _cab_commands cab }
48 94
plugins/cask/cask.plugin.zsh
File was created 1 if which cask &> /dev/null; then
2 source $(dirname $(which cask))/../etc/cask_completion.zsh
3 else
4 print "zsh cask plugin: cask not found"
5 fi
6
plugins/chucknorris/.gitignore
File was created 1 fortunes/chucknorris.dat
2
plugins/chucknorris/LICENSE
File was created 1 License: GPL v2
2 Thanks to http://www.k-lug.org/~kessler/projects.html for the fortune file.
3
plugins/chucknorris/chucknorris.plugin.zsh
File was created 1 if [ ! -f $ZSH/plugins/chucknorris/fortunes/chucknorris.dat ]; then
2 strfile $ZSH/plugins/chucknorris/fortunes/chucknorris $ZSH/plugins/chucknorris/fortunes/chucknorris.dat
3 fi
4
5 alias chuck="fortune -a $ZSH/plugins/chucknorris/fortunes"
6 alias chuck_cow="chuck | cowthink"
7
plugins/chucknorris/fortunes/chucknorris
File was created 1 Chuck Norris' tears cure cancer. Too bad he has never cried. Ever.
2 %
3 Chuck Norris does not sleep. He waits.
4 %
5 Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
6 %
7 The chief export of Chuck Norris is pain.
8 %
9 If you can see Chuck Norris, he can see you. If you can't see Chuck Norris, you may be only seconds away from death.
10 %
11 Chuck Norris has counted to infinity. Twice.
12 %
13 Chuck Norris does not hunt because the word hunting implies the probability of failure. Chuck Norris goes killing.
14 %
15 Chuck Norris' blood type is AK+. Ass-Kicking Positive. It is compatible only with heavy construction equipment, tanks, and fighter jets.
16 %
17 Chuck Norris is 1/8th Cherokee. This has nothing to do with ancestry, the man ate a fucking Indian.
18 %
19 In fine print on the last page of the Guinness Book of World Records it notes that all world records are held by Chuck Norris, and those listed in the book are simply the closest anyone else has ever gotten.
20 There is no chin behind Chuck Norris' beard. There is only another fist.
21 %
22 Chuck Norris does not teabag the ladies. He potato-sacks them.
23 Pluto is actually an orbiting group of British soldiers from the American Revolution who entered space after the Chuck gave them a roundhouse kick to the face.
24 %
25 When Chuck Norris goes to donate blood, he declines the syringe, and instead requests a hand gun and a bucket.
26 %
27 There are no steroids in baseball. Just players Chuck Norris has breathed on.
28 %
29 Chuck Norris once challenged Lance Armstrong in a "Who has more testicles?" contest. Chuck Norris won by 5.
30 %
31 Chuck Norris was the fourth wise man, who gave baby Jesus the gift of beard, which he carried with him until he died. The other three wise men were enraged by the preference that Jesus showed to Chuck's gift, and arranged to have him written out of the bible. All three died soon after of mysterious roundhouse-kick related injuries.
32 %
33 Chuck Norris sheds his skin twice a year.
34 %
35 When Chuck Norris calls 1-900 numbers, he doesnt get charged. He holds up the phone and money falls out.
36 %
37 Chuck Norris once ate a whole cake before his friends could tell him there was a stripper in it.
38 %
39 Some people like to eat frogs' legs. Chuck Norris likes to eat lizard legs. Hence, snakes.
40 %
41 There are no races, only countries of people Chuck Norris has beaten to different shades of black and blue.
42 %
43 When Chuck Norris was denied an Egg McMuffin at McDonald's because it was 10:35, he roundhouse kicked the store so hard it became a Wendy's.
44 %
45 Chuck Norris can't finish a "color by numbers" because his markers are filled with the blood of his victims. Unfortunately, all blood is dark red.
46 %
47 A Chuck Norris-delivered Roundhouse Kick is the preferred method of execution in 16 states.
48 %
49 When Chuck Norris falls in water, Chuck Norris doesn't get wet. Water gets Chuck Norris.
50 %
51 Scientists have estimated that the energy given off during the Big Bang is roughly equal to 1CNRhK (Chuck Norris Roundhouse Kick)
52 %
53 Chuck Norris' house has no doors, only walls that he walks through.
54 %
55 When Chuck Norris has sex with a man, it won't be because he is gay. It will be because he has run out of women.
56 %
57 How much wood would a woodchuck chuck if a woodchuck could Chuck Norris? ...All of it.
58 %
59 Chuck Norris doesn't actually write books, the words assemble themselves out of fear.
60 %
61 In honor of Chuck Norris, all McDonald's in Texas have an even larger size than the super-size. When ordering, just ask to be "Norrisized".
62 %
63 Chuck Norris CAN believe it's not butter.
64 %
65 If tapped, a Chuck Norris roundhouse kick could power the country of Australia for 44 minutes.
66 %
67 Chuck Norris can divide by zero.
68 %
69 The grass is always greener on the other side, unless Chuck Norris has been there. In that case the grass is most likely soaked in blood and tears.
70 %
71 A picture is worth a thousand words. A Chuck Norris is worth 1 billion words.
72 %
73 Newton's Third Law is wrong: Although it states that for each action, there is an equal and opposite reaction, there is no force equal in reaction to a Chuck Norris roundhouse kick.
74 %
75 Chuck Norris invented his own type of karate. It's called Chuck-Will-Kill.
76 %
77 When an episode of Walker Texas Ranger was aired in France, the French surrendered to Chuck Norris just to be on the safe side.
78 %
79 While urinating, Chuck Norris is easily capable of welding titanium.
80 %
81 Chuck Norris once sued the Houghton-Mifflin textbook company when it became apparent that their account of the war of 1812 was plagiarized from his autobiography.
82 %
83 When Chuck Norris talks, everybody listens. And dies.
84 %
85 When Steven Seagal kills a ninja, he only takes its hide. When Chuck Norris kills a ninja, he uses every part.
86 %
87 Wilt Chamberlain claims to have slept with more than 20,000 women in his lifetime. Chuck Norris calls this "a slow Tuesday."
88 %
89 Contrary to popular belief, there is indeed enough Chuck Norris to go around.
90 %
91 Chuck Norris doesnt shave; he kicks himself in the face. The only thing that can cut Chuck Norris is Chuck Norris.
92 %
93 For some, the left testicle is larger than the right one. For Chuck Norris, each testicle is larger than the other one.
94 %
95 Chuck Norris always knows the EXACT location of Carmen SanDiego.
96 %
97 When taking the SAT, write "Chuck Norris" for every answer. You will score over 8000.
98 %
99 Chuck Norris invented black. In fact, he invented the entire spectrum of visible light. Except pink. Tom Cruise invented pink.
100 %
101 When you're Chuck Norris, anything + anything is equal to 1. One roundhouse kick to the face.
102 %
103 Chuck Norris has the greatest Poker-Face of all time. He won the 1983 World Series of Poker, despite holding only a Joker, a Get out of Jail Free Monopoloy card, a 2 of clubs, 7 of spades and a green #4 card from the game UNO.
104 %
105 On his birthday, Chuck Norris randomly selects one lucky child to be thrown into the sun.
106 %
107 Nobody doesn't like Sara Lee. Except Chuck Norris.
108 %
109 Chuck Norris doesn't throw up if he drinks too much. Chuck Norris throws down!
110 %
111 In the beginning there was nothing...then Chuck Norris Roundhouse kicked that nothing in the face and said "Get a job". That is the story of the universe.
112 %
113 Chuck Norris has 12 moons. One of those moons is the Earth.
114 %
115 Chuck Norris grinds his coffee with his teeth and boils the water with his own rage.
116 %
117 Archeologists unearthed an old english dictionary dating back to the year 1236. It defined "victim" as "one who has encountered Chuck Norris"
118 %
119 Chuck Norris ordered a Big Mac at Burger King, and got one.
120 %
121 Chuck Norris and Mr. T walked into a bar. The bar was instantly destroyed, as that level of awesome cannot be contained in one building.
122 %
123 If you Google search "Chuck Norris getting his ass kicked" you will generate zero results. It just doesn't happen.
124 %
125 Chuck Norris can drink an entire gallon of milk in thirty-seven seconds.
126 %
127 Little known medical fact: Chuck Norris invented the Caesarean section when he roundhouse-kicked his way out of his monther's womb.
128 %
129 Chuck Norris doesn't bowl strikes, he just knocks down one pin and the other nine faint.
130 The show Survivor had the original premise of putting people on an island with Chuck Norris. There were no survivors, and nobody is brave enough to go to the island to retrieve the footage.
131 %
132 It takes Chuck Norris 20 minutes to watch 60 Minutes.
133 %
134 You know how they say if you die in your dream then you will die in real life? In actuality, if you dream of death then Chuck Norris will find you and kill you.
135 %
136 Chuck Norris has a deep and abiding respect for human life... unless it gets in his way.
137 %
138 The Bermuda Triangle used to be the Bermuda Square, until Chuck Norris Roundhouse kicked one of the corners off.
139 %
140 There are no weapons of mass destruction in Iraq, Chuck Norris lives in Oklahoma.
141 %
142 Chuck Norris doesn't believe in Germany.
143 %
144 When Chuck Norris is in a crowded area, he doesn't walk around people. He walks through them.
145 %
146 Chuck Norris once ate an entire bottle of sleeping pills. They made him blink.
147 %
148 James Cameron wanted Chuck Norris to play the Terminator. However, upon reflection, he realized that would have turned his movie into a documentary, so he went with Arnold Schwarzenegger.
149 %
150 Chuck Norris can touch MC Hammer.
151 %
152 Thousands of years ago Chuck Norris came across a bear. It was so terrified that it fled north into the arctic. It was also so terrified that all of its decendents now have white hair.
153 %
154 Chuck Norris played Russian Roulette with a fully loaded gun and won.
155 %
156 It takes 14 puppeteers to make Chuck Norris smile, but only 2 to make him destroy an orphanage.
157 %
158 Chuck Norris is responsible for China's over-population. He hosted a Karate tournament in Beijing and all women within 1,000 miles became pregnant instantly.
159 %
160 Some people wear Superman pajamas. Superman wears Chuck Norris pajamas.
161 %
162 Chuck Norris once worked as a weatherman for the San Diego evening news. Every night he would make the same forecast: Partly cloudy with a 75% chance of Pain.
163 %
164 Simply by pulling on both ends, Chuck Norris can stretch diamonds back into coal.
165 %
166 When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
167 %
168 Chuck Norris invented the bolt-action rifle, liquor, sexual intercourse, and football-- in that order.
169 %
170 A high tide means Chuck Norris is flying over your coast. The tide is caused by God pissing his pants.
171 %
172 Chuck Norris keeps his friends close and his enemies closer. Close enough to drop them with one round house kick to the face.
173 %
174 There is in fact an "I" in Norris, but there is no "team"? not even close.
175 %
176 Scotty in Star Trek often says "Ye cannae change the laws of physics." This is untrue. Chuck Norris can change the laws of physics. With his fists.
177 %
178 An anagram for Walker Texas Ranger is KARATE WRANGLER SEX. I don't know what that is, but it sounds AWESOME.
179 %
180 Chuck Norris doesn't stub his toes. He accidentally destroys chairs, bedframes, and sidewalks.
181 %
182 Using his trademark roundhouse kick, Chuck Norris once made a fieldgoal in RJ Stadium in Tampa Bay from the 50 yard line of Qualcomm stadium in San Diego.
183 %
184 Chuck Norris roundhouse kicks don't really kill people. They wipe out their entire existence from the space-time continuum.
185 %
186 Chuck Norris does not own a stove, oven, or microwave , because revenge is a dish best served cold.
187 %
188 Tom Clancy has to pay royalties to Chuck Norris because "The Sum of All Fears" is the name of Chuck Norris' autobiography.
189 %
190 Chuck Norris can slam a revolving door.
191 %
192 Chuck Norris is expected to win gold in every swimming competition at the 2008 Beijing Olympics, even though Chuck Norris does not swim. This is because when Chuck Norris enters the water, the water gets out of his way and Chuck Norris simply walks across the pool floor.
193 %
194 Chuck Norris built a better mousetrap, but the world was too frightened to beat a path to his door.
195 %
196 The original draft of The Lord of the Rings featured Chuck Norris instead of Frodo Baggins. It was only 5 pages long, as Chuck roundhouse-kicked Sauron's ass halfway through the first chapter.
197 %
198 Hellen Keller's favorite color is Chuck Norris.
199 %
200 Chuck Norris eats beef jerky and craps gunpowder. Then, he uses that gunpowder to make a bullet, which he uses to kill a cow and make more beef jerky. Some people refer to this as the "Circle of Life."
201 %
202 If, by some incredible space-time paradox, Chuck Norris would ever fight himself, he'd win. Period.
203 %
204 Chuck Norris is currently suing myspace for taking the name of what he calls everything around you.
205 %
206 The crossing lights in Chuck Norris's home town say "Die slowly" and "die quickly". They each have a picture of Chuck Norris punching or kicking a pedestrian.
207 %
208 Science Fact: Roundhouse kicks are comprised primarily of an element called Chucktanium.
209 %
210 The Sherman tank was originaly called the Norris tank until Chuck Norris decided it wasn't tough enough to be associated with him. The Army, for fear of Chuck Norris, renamed the tank and promised to develop a weapon more fitting of his name. To date, no weapon created has been badass enough to be named after Chuck Norris.
211 %
212 Chuck Norris proved that we are alone in the universe. We weren't before his first space expedition.
213 %
214 Superman once watched an episode of Walker, Texas Ranger. He then cried himself to sleep.
215 %
216 Chuck Norris doesn't step on toes. Chuck Norris steps on necks.
217 %
218 The movie "Delta Force" was extremely hard to make because Chuck had to downplay his abilities. The first few cuts were completely unbelievable.
219 %
220 Movie trivia: The movie "Invasion U.S.A." is, in fact, a documentary.
221 %
222 Chuck Norris does not "style" his hair. It lays perfectly in place out of sheer terror.
223 %
224 There is no such thing as global warming. Chuck Norris was cold, so he turned the sun up.
225 %
226 A study showed the leading causes of death in the United States are:
227 1:Heart disease
228 2:Chuck Norris
229 3:Cancer
230 %
231 It's widely believed that Jesus was Chuck Norris' stunt double for crucifixion due to the fact that it is impossible for nails to pierce Chuck Norris' skin.
232 %
233 Chuck Norris did in fact, build Rome in a day.
234 %
235 Along with his black belt, Chuck Norris often chooses to wear brown shoes. No one has DARED call him on it. Ever.
236 %
237 Anytime someone is elected president in the United States, they must ask permission from Chuck Norris to live in the White House. The reason for this is because Chuck Norris had won every Federal, State, and Local election since 1777. He just allows others to run the country in his place.
238 %
239 Once you go Norris, you are physically unable to go back.
240 %
241 Ninjas want to grow up to be just like Chuck Norris. But usually they grow up just to be killed by Chuck Norris.
242 %
243 Chuck Norris once sued Burger King after they refused to put razor wire in his Whopper Jr, insisting that that actually is "his" way.
244 %
245 The last thing you hear before Chuck Norris gives you a roundhouse kick? No one knows because dead men tell no tales.
246 %
247 Chuck Norris doesn't play god. Playing is for children.
248 %
249 As a teen, Chuck Norris had sex with every nun in a convent tucked away in the hills of Tuscany. Nine months later the nuns gave birth to the 1972 Miami Dolphins, the only undefeated and untied team in professional football history.
250 %
251 Chuck Norris is the only person in the world that can actually email a roundhouse kick.
252 %
253 Chuck Norris won super bowls VII and VIII singlehandedly before unexpectedly retiring to pursue a career in ass-kicking.
254 %
255 Wo hu cang long. The translation from Mandarin Chinese reads: "Crouching Chuck, Hidden Norris"
256 %
257 Chuck Norris can set ants on fire with a magnifying glass. At night.
258 %
259 Some kids play Kick the can. Chuck Norris played Kick the keg.
260 %
261 'Icy-Hot' is too weak for Chuck Norris. After a workout, Chuck Norris rubs his muscles down with liquid-hot MAGMA.
262 %
263 Chuck Norris cannot love, he can only not kill.
264 %
265 When Chuck Norris was a baby, he didn't suck his mother's breast. His mother served him whiskey, straight out of the bottle.
266 %
267 According to Einstein's theory of relativity, Chuck Norris can actually roundhouse kick you yesterday.
268 %
269 Chuck Norris once pulled out a single hair from his beard and skewered three men through the heart with it.
270 %
271 In an act of great philanthropy, Chuck made a generous donation to the American Cancer Society. He donated 6,000 dead bodies for scientific research.
272 %
273 Chuck Norris' favourite cut of meat is the roundhouse.
274 %
275 When J. Robert Oppenheimer said "I am become death, the destroyer Of worlds", He was not referring to the atomic bomb. He was referring to the Chuck Norris halloween costume he was wearing.
276 %
277 Chuck Norris recently had the idea to sell his urine as a canned beverage. We know this beverage as Red Bull.
278 %
279 In a recent survey it was discovered the 94% of American women lost their virginity to Chuck Norris. The other 6% were incredibly fat or ugly.
280 %
281 Chuck Norris invented a language that incorporates karate and roundhouse kicks. So next time Chuck Norris is kicking your ass, don't be offended or hurt, he may be just trying to tell you he likes your hat.
282 %
283 If at first you don't succeed, you're not Chuck Norris.
284 If Chuck Norris were a calendar, every month would be named Chucktober, and every day he'd kick your ass.
285 %
286 Fear is not the only emotion Chuck Norris can smell. He can also detect hope, as in "I hope I don't get a roundhouse kick from Chuck Norris."
287 Too late, asshole.
288 %
289 Chuck Norris's show is called Walker: Texas Ranger, because Chuck Norris doesn't run.
290 %
291 MacGyver can build an airplane out of gum and paper clips, but Chuck Norris can roundhouse-kick his head through a wall and take it.
292 %
293 Behind every successful man, there is a woman. Behind every dead man, there is Chuck Norris.
294 %
295 What's known as the UFC, or Ultimate Fighting Championship, doesn't use its full name, which happens to be "Ultimate Fighting Championship, Non-Chuck-Norris-Division".
296 %
297 Chuck Norris brushes his teeth with a mixture of iron shavings, industrial paint remover, and wood-grain alcohol.
298 %
299 The easiest way to determine Chuck Norris' age is to cut him in half and count the rings.
300 %
301 There is endless debate about the existence of the human soul. Well it does exist, and Chuck Norris finds it delicious.
302 %
303 Most boots are made for walkin'. Chuck Norris' boots ain't that merciful.
304 %
305 The US did not boycott the 1980 Summer Olympics in Moscow due to political reasons: Chuck Norris killed the entire US team with a single round-house kick during TaeKwonDo practice.
306 %
307 Chuck Norris wears a live rattlesnake as a condom.
308 %
309 When the movie Pulp Fiction was filmed they had to borrow Chuck Norris's wallet... It's the one that says "Bad Mother Fucker" on it
310 %
311 The Bible was originally titled "Chuck Norris and Friends"
312 %
313 Chuck Norris began selling the Total Gym as an ill-fated attempt to make his day-to-day opponents less laughably pathetic.
314 %
315 Do you know why Baskin Robbins only has 31 flavors? Because Chuck Norris doesn't like Fudge Ripple.
316 %
317 When Chuck Norris says "More cowbell", he fucking MEANS it.
318 %
319 On the set of Walker Texas Ranger Chuck Norris brought a dying lamb back to life by nuzzling it with his beard. As the onlookers gathered, the lamb sprang to life. Chuck Norris then roundhouse kicked it, killing it instantly. This was just to prove that the good Chuck giveth, and the good Chuck, he taketh away.
320 %
321 Chuck Norris was what Willis was talkin' about.
322 %
323 Google won't search for Chuck Norris because it knows you don't find Chuck Norris, he finds you.
324 %
325 Chuck Norris can lead a horse to water AND make it drink.
326 %
327 Nagasaki never had a bomb dropped on it. Chuck Norris jumped out of a plane and punched the ground.
328 %
329 It is scientifically impossible for Chuck Norris to have had a mortal father. The most popular theory is that he went back in time and fathered himself.
330 %
331 Chuck Norris destroyed the periodic table, because Chuck Norris only recognizes the element of surprise.
332 %
333 It is believed dinosaurs are extinct due to a giant meteor. That's true if you want to call Chuck Norris a giant meteor.
334 %
335 Chuck Norris shot the sheriff, but he round house kicked the deputy.
336 %
337 That's not Chuck Norris doing push-ups -- that's Chuck Norris moving the Earth away from the path of a deadly asteroid.
338 %
339 Chuck Norris can judge a book by its cover.
340 %
341 Nothing can escape the gravity of a black hole, except for Chuck Norris. Chuck Norris eats black holes. They taste like chicken.
342 %
343 Chuck Norris does not play the lottery. It doesn't have nearly enough balls.
344 %
345 Q: How many Chuck Norris' does it take to change a light bulb?
346 A: None, Chuck Norris prefers to kill in the dark.
347 %
348 As President Roosevelt said: "We have nothing to fear but fear itself. And Chuck Norris."
349 %
350 Chuck Norris just says "no" to drugs. If he said "yes", it would collapse Colombia's infrastructure.
351 %
352 Since 1940, the year Chuck Norris was born, roundhouse-kick related deaths have increased 13,000 percent. 
353 %
354 Crime does not pay - unless you are an undertaker following Walker, Texas Ranger, on a routine patrol.
355 %
356 Chuck Norris invented the internet? just so he had a place to store his porn.
357 %
358 Chuck Norris does not own a house. He walks into random houses and people move.
359 %
360 It is better to give than to receive. This is especially true of a Chuck Norris roundhouse kick.
361 %
362 Chuck Norris is the only person to ever win a staring contest against Ray Charles and Stevie Wonder at the same time.
363 %
364 Industrial logging isn't the cause of deforestation. Chuck Norris needs toothpicks.
365 %
366 Chuck Norris smells what the Rock is cooking... because the Rock is Chuck Norris' personal chef.
367 %
368 When Chuck Norris plays Oregon Trail, his family does not die from cholera or dysentery, but rather, roundhouse kicks to the face. He also requires no wagon, since he carries the oxen, axels, and buffalo meat on his back. He always makes it to Oregon before you.
369 %
370 Chuck Norris is the reason why Waldo is hiding.
371 %
372 "Brokeback Mountain" is not just a movie. It's also what Chuck Norris calls the pile of dead ninjas in his front yard.
373 %
374 When God said, "let there be light", Chuck Norris said, "say 'please'."
375 %
376 Chuck Norris does not eat. Food understands that the only safe haven from Chuck Norris' fists is inside his own body.
377 %
378 One day Chuck Norris walked down the street with a massive erection. There were no survivors.
379 %
380 Chuck Norris built a time machine and went back in time to stop the JFK assassination. As Oswald shot, Chuck met all three bullets with his beard, deflecting them. JFK's head exploded out of sheer amazement.
381 %
382 Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
383 %
384 Chuck Norris uses a night light. Not because Chuck Norris is afraid of the dark, but the dark is afraid of Chuck Norris.
385 %
386 Chuck Norris is not capable of hitting a target on the broad side of a barn. Every time he tries, the whole damn barn falls down.
387 %
388 Before each filming of Walker: Texas Ranger, Chuck Norris is injected with fourteen times the lethal dose of elephant tranquilzer. This is, of course, to limit his strength and mobility, in an attempt to lower the fatality rate of the actors he fights.
389 %
390 When Bruce Banner gets mad, he turns into the Hulk. When the Hulk gets mad, he turns into Chuck Norris.
391 %
392 Chuck Norris kills anyone that asks, "You want fries with that" because by now everyone should know that Chuck doesn't ever want fries with anything. Ever.
393 %
394 Chuck Norris once kicked a horse in the chin. Its decendants are known today as Giraffes.
395 %
396 Sticks and stones may break your bones, but a Chuck Norris glare will liquefy your kidneys.
397 %
398 Human cloning is outlawed because if Chuck Norris were cloned, then it would be possible for a Chuck Norris roundhouse kick to meet another chuck Norris roundhouse kick. Physicists theorize that this contact would end the universe.
399 %
400 Chuck Norris once went skydiving, but promised never to do it again. One Grand Canyon is enough.
401 %
402 Chuck Norris's version of a "chocolate milkshake" is a raw porterhouse wrapped around ten Hershey bars, and doused in diesel fuel.
403 %
404 If Chuck Norris round-house kicks you, you will die. If Chuck Norris' misses you with the round-house kick, the wind behind the kick will tear out your pancreas.
405 %
406 In a fight between Batman and Darth Vader, the winner would be Chuck Norris.
407 %
408 Chuck Norris puts his pants on one leg at a time, just like the rest of us. The only difference is, then he fucking kills people.
409 %
410 Everybody loves Raymond. Except Chuck Norris.
411 %
412 Contrary to popular belief, the Titanic didn't hit an iceberg. The ship was off course and accidentally ran into Chuck Norris while he was doing the backstroke across the Atlantic.
413 %
414 Chuck Norris got his drivers license at the age of 16. Seconds.
415 %
416 The original title for Alien vs. Predator was Alien and Predator vs Chuck Norris. The film was cancelled shortly after going into preproduction. No one would pay nine dollars to see a movie fourteen seconds long.
417 %
418 Chuck Norris' sperm is so badass, he had sex with Nicole Kidman, and 7 months later she prematurely gave birth to a Ford Excursion.
419 %
420 Chuck Norris can win at solitaire with only 18 cards.
421 %
422 Chuck Norris once shat blood - the blood of 11,940 natives he had killed and eaten.
423 %
424 Maslow's theory of higher needs does not apply to Chuck Norris. He only has two needs: killing people and finding people to kill.
425 %
426 The truth will set you free. Unless Chuck Norris has you, in which case, forget it buddy!
427 %
428 For most people, home is where the heart is. For Chuck Norris, home is where he stores his collection of human skulls.
429 %
430 Kryptonite has been found to contain trace elements of Chuck Norris roundhouse kicks to the face. This is why it is so deadly to Superman.
431 %
432 Saddam Hussein was not found hiding in a "hole." Saddam was roundhouse-kicked in the head by Chuck Norris in Kansas, which sent him through the earth, stopping just short of the surface of Iraq.
433 %
434 Coroners refer to dead people as "ABC's". Already Been Chucked.
435 %
436 Chuck Norris doesn't look both ways before he crosses the street... he just roundhouses any cars that get too close.
437 %
438 Chuck Norris does not have to answer the phone. His beard picks up the incoming electrical impulses and translates them into audible sound.
439 %
440 How many roundhouse kicks does it take to get to the center of a tootsie pop? Just one. From Chuck Norris.
441 %
442 Chuck Norris doesnt wear a watch, HE decides what time it is.
443 %
444 The phrase 'break a leg' was originally coined by Chuck Norris's co-stars in Walker, Texas Ranger as a good luck charm, indicating that a broken leg might be the worst extent of their injuries. This never proved to be the case.
445 %
446 When chuck Norris does division, there are no remainders.
447 %
448 If you rearrange the letters in "Chuck Norris", they also spell "Crush Rock In". The words "with his fists" are understood.
449 %
450 Never look a gift Chuck Norris in the mouth, because he will bite your damn eyes off.
451 %
452 Give a man a fish, and you will feed him for a day. Give a man anything that is better than a fish, and Chuck Norris will beat his ass and take it.
453 %
454 Chuck Norris used to play baseball. When Babe Ruth was hailed as the better player, Chuck Norris killed him with a baseball bat to the throat. Lou Gehrig got off easy.
455 %
456 The original title for Star Wars was "Skywalker: Texas Ranger". Starring Chuck Norris.
457 %
458 Guantuanamo Bay, Cuba, is the military code-word for "Chuck Norris' basement".
459 %
460 The phrase 'balls to the wall' was originally conceived to describe Chuck Norris entering any building smaller than an aircraft hangar.
461 %
462 Chuck Norris' roundhouse kick is so powerful, it can be seen from outer space by the naked eye.
463 %
464 Ozzy Osbourne bites the heads off of bats. Chuck Norris bites the heads off of Siberian Tigers.
465 %
466 He who lives by the sword, dies by the sword. He who lives by Chuck Norris, dies by the roundhouse kick.
467 %
468 The best-laid plans of mice and men often go awry. Even the worst-laid plans of Chuck Norris come off without a hitch.
469 %
470 The phrase 'dead ringer' refers to someone who sits behind Chuck Norris in a movie theater and forgets to turn their cell phone off.
471 %
472 Chuck Norris' Roundhouse kick is so powerful, that on the set of Sidekicks he single-footedly destroyed Jonathan Brandis' Career.
473 %
474 Staring at Chuck Norris for extended periods of time without proper eye protection will cause blindess, and possibly foot sized brusies on the face.
475 %
476 Chuck Norris can taste lies.
477 %
478 Chuck Norris does not kick ass and take names. In fact, Chuck Norris kicks ass and assigns the corpse a number. It is currently recorded to be in the billions.
479 %
480 One time, Chuck Norris accidentally stubbed his toe. It destroyed the entire state of Ohio.
481 %
482 Little Miss Muffet sat on her tuffet, until Chuck Norris roundhouse kicked her into a glacier.
483 %
484 In 1990, Chuck Norris founded the non-profit organization "Kick Drugs Out of America". If the organization's name were "Roundhouse Kick Drugs out of America", there wouldn't be any drugs in the Western Hemisphere. Anywhere.
485 %
486 Chuck Norris can blow bubbles with beef jerky.
487 %
488 They had to edit the first ending of 'Lone Wolf McQuade' after Chuck Norris kicked David Carradine's ass, then proceeded to barbecue and eat him.
489 %
490 Chuck Norris does, in fact, live in a round house.
491 %
492 Chuck Norris was once on Jeopardy. This show is notable in that it was the first occasion in Jeopardy history that Alex Trebek had appeared without a mustache. And a head.
493 %
494 When Chuck Norris works out on the Total Gym, the Total Gym feels like it's been raped.
495 %
496 4 out of 5 doctors fail to recommend Chuck Norris as a solution to most problems. Also, 80% of doctors die unexplained, needlessly brutal deaths.
497 %
498 Chuck Norris can skeletize a cow in two minutes.
499 %
500 The only sure things are Death and Taxes?and when Chuck Norris goes to work for the IRS, they'll be the same thing.
501 Chuck Norris' first job was as a paperboy. There were no survivors.
502 %
503 With the rising cost of gasoline, Chuck Norris is beginning to worry about his drinking habit.
504 %
505 The square root of Chuck Norris is pain. Do not try to square Chuck Norris, the result is death.
506 %
507 Chuck Norris' testicles do not produce sperm. They produce tiny white ninjas that recognize only one mission: seek and destroy.
508 %
509 To be or not to be? That is the question. The answer? Chuck Norris.
510 %
511 Chuck Norris has never been in a fight, ever. Do you call one roundhouse kick to the face a fight?
512 %
513 There are two types of people in the world... people that suck, and Chuck Norris.
514 %
515 Chuck Norris never wet his bed as a child. The bed wet itself out of fear.
516 %
517 If you were somehow able to land a punch on Chuck Norris your entire arm would shatter upon impact. This is only in theory, since, come on, who in their right mind would try this?
518 %
519 70% of a human's weight is water. 70% of Chuck Norris' weight is his dick.
520 %
521 Jean-Claude Van Damme once kicked Chuck Norris' ass. He was then awakened from his dream by a roundhouse kick to the face.
522 %
523 The pie scene in "American Pie" is based on a dare Chuck Norris took when he was younger. However, in Chuck Norris' case, the "pie" was the molten crater of an active volcano.
524 %
525 Chuck Norris uses 8'x10' sheets of plywood as toilet paper.
526 %
527 Noah was the only man notified before Chuck Norris relieved himself in the Atlantic Ocean.
528 %
529 Chuck Norris once invited all of the other badasses from TV to duke it out in order to see who was the supreme badass. Only two showed up-- Jack Bauer and MacGyver.
530 %
531
532 %
533 MacGyver immediately tried to make a bomb out of some Q-Tips and Gatorade, but Chuck Norris roundhouse-kicked him in the solar plexus. MacGyver promptly threw up his own heart.
534 %
535 Jack Bauer tried to use his detailed knowledge of torture techniques, but to no avail: Chuck Norris thrives on pain. Chuck Norris then ripped off Jack Bauer's arm and beat him to death with it. Game, set, match.
536 %
537 Chuck Norris eats steak for every single meal. Most times he forgets to kill the cow.
538 %
539 The First Law of Thermodynamics states that energy can neither be created nor destroyed... unless it meets Chuck Norris.
540 %
541 Chuck Norris doesn't go on the internet, he has every internet site stored in his memory. He refreshes webpages by blinking.
542 %
543 Fact: Chuck Norris doesn't consider it sex if the woman survives.
544 %
545 It is said that looking into Chuck Norris' eyes will reveal your future. Unfortunately, everybody's future is always the same: death by a roundhouse-kick to the face.
546 %
547 Chuck Norris knows everything there is to know - Except for the definition of mercy.
548 %
549 Scientifically speaking, it is impossible to charge Chuck Norris with "obstruction of justice." This is because even Chuck Norris cannot be in two places at the same time.
550 %
551 Chuck Norris never has to wax his skis because they're always slick with blood.
552 %
553 When you say "no one's perfect", Chuck Norris takes this as a personal insult.
554 %
555 Chuck Norris can win a game of Trivial Pursuit with one roll of the dice, and without answering a single question... just a nod of the head, and a stroke of the beard.
556 %
557 182,000 Americans die from Chuck Norris-related accidents every year.
558 %
559 Paper beats rock, rock beats scissors, and scissors beats paper, but Chuck Norris beats all 3 at the same time.
560 %
561 Jesus can walk on water, but Chuck Norris can walk on Jesus.
562 %
563 All roads lead to Chuck Norris. And by the transitive property, a roundhouse kick to the face.
564 %
565 If you're driving down the road and you think Chuck Norris just cut you off, you better thank your lucky stars it wasn't the other way around.
566 %
567 July 4th is Independence day. And the day Chuck Norris was born. Coincidence? i think not.
568 %
569 Chuck Norris never goes to the dentist because his teeth are unbreakable. His enemies never go to the dentist because they have no teeth.
570 %
571 In the medical community, death is referred to as "Chuck Norris Disease"
572 %
573 Chuck Norris was once in a knife fight, and the knife lost.
574 %
575 If you work in an office with Chuck Norris, don't ask him for his three-hole-punch.
576 %
577 In the Words of Julius Caesar, "Veni, Vidi, Vici, Chuck Norris". Translation: I came, I saw, and I was roundhouse-kicked inthe face by Chuck Norris.
578 %
579 The First rule of Chuck Norris is: you do not talk about Chuck Norris.
580 %
581 Chuck Norris is widely predicted to be first black president. If you're thinking to yourself, "But Chuck Norris isn't black", then you are dead wrong. And stop being a racist.
582 %
583 When Chuck Norris plays Monopoly, it affects the actual world economy.
584 %
585 Chuck Norris can be unlocked on the hardest level of Tekken. But only Chuck Norris is skilled enough to unlock himself. Then he roundhouse kicks the Playstation back to Japan.
586 %
587 Chuck Norris drinks napalm to quell his heartburn.
588 %
589 Every time someone uses the word "intense", Chuck Norris always replies "you know what else is intense?" followed by a roundhouse kick to the face.
590 %
591 As an infant, Chuck Norris' parents gave him a toy hammer. He gave the world Stonehenge.
592 %
593 Chuck Norris once ordered a steak in a restaurant. The steak did what it was told.
594 %
595 Most people fear the Reaper. Chuck Norris considers him "a promising Rookie".
596 %
597 There are only two things that can cut diamonds: other diamonds, and Chuck Norris.
598 %
599 President Roosevelt once rode his horse 100 miles. Chuck Norris carried his the same distance in half the time.
600 %
601 Chuck Norris once ate four 30lb bowling balls without chewing.
602 %
603 What many people dont know is chuck norris is the founder of planned parenthood. Not even unborn children can escape his wrath.
604 %
605 Chuck Norris was banned from competitive bullriding after a 1992 exhibition in San Antonio, when he rode the bull 1,346 miles from Texas to Milwaukee Wisconsin to pick up his dry cleaning.
606 %
607 Chuck Norris qualified with a top speed of 324 mph at the Daytona 500, without a car.
608 %
609 Chuck Norris likes his coffee half and half: half coffee grounds, half wood-grain alcohol.
610 %
611 Chuck Norris uses tabasco sauce instead of visine.
612 %
613 The chemical formula for the highly toxic cyanide ion is CN-. These are also Chuck Norris' initials. This is not a coincidence.
614 %
615 Chuck Norris' credit cards have no limit. Last weekend, he maxed them out.
616 %
617 Think of a hot woman. Chuck Norris did her.
618 %
619 A man once claimed Chuck Norris kicked his ass twice, but it was promptly dismissed as false - no one could survive it the first time.
620 %
621 Chuck Norris sleeps with a pillow under his gun.
622 %
623 Chuck Norris owns a chain of fast-food restaurants throughout the southwest. They serve nothing but barbecue-flavored ice cream and Hot Pockets.
624 %
625 Chuck Norris doesn't chew gum. Chuck Norris chews tin foil.
626 %
627 Aliens DO indeed exist. They just know better than to visit a planet that Chuck Norris is on.
628 %
629 When in a bar, you can order a drink called a "Chuck Norris". It is also known as a "Bloody Mary", if your name happens to be Mary.
630 %
631 Every time Chuck Norris smiles, someone dies. Unless he smiles while he's roundhouse kicking someone in the face. Then two people die.
632 %
633 Some people ask for a Kleenex when they sneeze, Chuck Norris asks for a body bag.
634 %
635 There's an order to the universe: space, time, Chuck Norris.... Just kidding, Chuck Norris is first.
636 %
637 A man once asked Chuck Norris if his real name is "Charles". Chuck Norris did not respond, he simply stared at him until he exploded.
638 %
639 Chuck Norris starts everyday with a protein shake made from Carnation Instant Breakfast, one dozen eggs, pure Colombian cocaine, and rattlesnake venom. He injects it directly into his neck with a syringe.
640 %
641 In a tagteam match, Chuck Norris was teamed with Hulk Hogan against King Kong Bundy and Andre The Giant. He pinned all 3 at the same time.
642 %
643 Chuck Norris doesn't see dead people. He makes people dead.
644 %
645 Chuck Norris is the only person who can simultaneously hold and fire FIVE Uzis: One in each hand, one in each foot -- and the 5th one he roundhouse-kicks into the air, so that it sprays bullets.
646 %
647 For undercover police work, Chuck Norris pins his badge underneath his shirt, directly into his chest.
648 %
649 In the X-Men movies, none of the X-Men super-powers are done with special effects. Chuck Norris is the stuntman for every character.
650 %
651 We live in an expanding universe. All of it is trying to get away from Chuck Norris.
652 %
653 Chuck Norris went looking for a bar but couldn't find one. He walked to a vacant lot and sat there. Sure enough within an hour an a half someone constructed a bar around him. He then ordered a shot, drank it, and then burned the place to the ground. Chuck Norris yelled over the roar of the flames, "always leave things the way you found em!"
654 %
655 It is said that every time you masturbate, God kills a kitten. Every time God masturbates, Chuck Norris kills a lion.
656 %
657 The word 'Kill' was invented by Chuck Norris. Other words were 'Die', 'Beer', and 'What'.
658 %
659 Chuck Norris is a vegetarian. Meaning, he does not eat animals until first he puts them into vegetative state with his fists.
660 %
661 The 11th commandment is "Thou shalt not piss off Chuck Norris" This commandment is rarely enforced, as it is impossible to accomplish.
662 %
663 Chuck Norris is his own line at the DMV.
664 %
665 Two wrongs don't make a right. Unless you're Chuck Norris. Then two wrongs make a roundhouse kick to the face.
666 %
667 Who let the dogs out? Chuck Norris let the dogs out... and then roundhouse kicked them through an Oldsmobile.
668 %
669 Chuck Norris can do a roundhouse kick faster than the speed of light. This means that if you turn on a light switch, you will be dead before the lightbulb turns on.
670 %
671 When Chuck Norris goes to out to eat, he orders a whole chicken, but he only eats its soul.
672 %
673 Chuck Norris sold his soul to the devil for his rugged good looks and unparalleled martial arts ability. Shortly after the transaction was finalized, Chuck roundhouse-kicked the devil in the face and took his soul back. The devil, who appreciates irony, couldn't stay mad and admitted he should have seen it coming. They now play poker every second Wednesday of the month.
674 %
675 Chuck Norris has never won an Academy Award for acting... because he's not acting.
676 %
677 If Chuck Norris wants your opinion, he'll beat it into you.
678 %
679 Not everyone that Chuck Norris is mad at gets killed. Some get away. They are called astronauts.
680 %
681 Chuck Norris has to register every part of his body as a separate lethal weapon. His spleen is considered a concealed weapon in over 50 states.
682 %
683 A movie scene depicting Chuck Norris losing a fight with Bruce Lee was the product of history's most expensive visual effect. When adjusted for inflation, the effect cost more than the Gross National Product of Paraguay.
684 %
685 Godzilla is a Japanese rendition of Chuck Norris' first visit to Tokyo.
686 %
687 They once made a Chuck Norris toilet paper, but there was a problem-- It wouldn't take shit from anybody.
688 %
689 Chuck Norris once rode a nine foot grizzly bear through an automatic car wash, instead of taking a shower.
690 %
691 "Sweating bullets" is literally what happens when Chuck Norris gets too hot.
692 %
693 Chuck Norris' sperm can be seen with the naked eye. Each one is the size of a quarter.
694 %
695 After taking a steroids test doctors informed Chuck Norris that he had tested positive. He laughed upon receiving this information, and said "of course my urine tested positive, what do you think they make steroids from?"
696 %
697 Chuck Norris doesn't daydream. He's too busy giving other people nightmares.
698 %
699 When Arnold says the line "I'll be back" in the first Terminator movie it is implied that is he going to ask Chuck Norris for help.
700 %
701 There are no such things as tornados. Chuck Norris just hates trailer parks.
702 %
703 Chuck Norris' Penis is a third degree blackbelt, and an honorable 32nd-degree mason.
704 %
705 Chuck Norris does not follow fashion trends, they follow him. But then he turns around and kicks their ass. Nobody follows Chuck Norris.
706 %
707 The phrase 'break a leg' was originally coined by Chuck Norris's co-stars in Walker, Texas Ranger as a good luck charm indicating that a broken leg might be the worst extent of their injuries. This never proved to be the case.
708 %
709 Chuck Norris' roundhouse kick is so powerful, it can be seen from outer space by the naked eye.
710 %
711 Diamonds are not, despite popular belief, carbon. They are, in fact, Chuck Norris fecal matter. This was proven a recently, when scientific analysis revealed what appeared to be Jean-Claude Van Damme bone fragments inside the Hope Diamond.
712 %
713 Chuck Norris once participated in the running of the bulls. He walked.
714 %
715 The Drummer for Def Leppard's only got one arm. Chuck Norris needed a back scratcher.
716 %
717 Chuck Norris was the orginal sculptor of Mount Rushmore. He completed the entire project using only a bottle opener and a drywall trowel.
718 %
719 Chuck Norris once rode a bull, and nine months later it had a calf.
720 %
721 Chuck Norris once lost the remote, but maintained control of the TV by yelling at it in between bites of his "Filet of Child" sandwich.
722 %
723 For Spring Break '05, Chuck Norris drove to Madagascar, riding a chariot pulled by two electric eels.
724 %
725 The Manhattan Project was not intended to create nuclear weapons, it was meant to recreate the destructive power in a Chuck Norris Roundhouse Kick. They didn't even come close.
726 %
727 Chuck Norris has banned rainbows from the state of North Dakota.
728 %
729 Divide Chuck Norris by zero and you will in fact get one........one bad-ass motherfucker that is.
730 %
731 TNT was originally developed by Chuck Norris to cure indigestion.
732 %
733 After returning from World War 2 unscathed, Bob Dole was congratulated by Chuck Norris with a handshake. The rest is history.
734 %
735 Chuck Norris runs on batteries. Specifically, Die Hards.
736 %
737 "Let the Bodies Hit the Floor" was originally written as Chuck Norris' theme song.
738 %
739 Chuck Norris will never have a heart attack. His heart isn't nearly foolish enough to attack him.
740 %
741 Only Chuck Norris can prevent forest fires.
742 %
743 When Chuck Norris makes a burrito, its main ingredient is real toes.
744 %
745 Chuck Norris is not Irish. His hair is soaked in the blood of his victims.
746 %
747 In the movie "The Matrix", Chuck Norris is the Matrix. If you pay close attention in the green "falling code" scenes, you can make out the faint texture of his beard.
748 %
749 Chuck Norris' dick is so big, it has it's own dick, and that dick is still bigger than yours.
750 %
751 They say curiosity killed the cat. This is false. Chuck Norris killed the cat. Every single one of them.
752 %
753 There is no such thing as a lesbian, just a woman who has never met Chuck Norris.
754 %
755 Chuck Norris crossed the road. No one has ever dared question his motives.
756 %
757 When Chuck Norris was born, he immediately had sex with the first nurse he saw. He was her first. She was his third. That afternoon.
758 %
759 One time, at band camp, Chuck Norris ate a percussionist.
760 %
761 Chuck Norris doesn't say "who's your daddy", because he knows the answer.
762 %
763 Chuck Norris originally wrote the first dictionary. The definition for each word is as follows - A swift roundhouse kick to the face.
764 %
765 Love does not hurt. Chuck Norris does.
766 %
767 The term "Cleveland Steamer" got its name from Chuck Norris, when he took a dump while visiting the Rock and Roll Hall of fame and buried northern Ohio under a glacier of fecal matter.
768 %
769 Chuck Norris once round-house kicked a salesman. Over the phone.
770 %
771 The pen is mighter than the sword, but only if the pen is held by Chuck Norris.
772 %
773 Chuck Norris doesn't kill two birds with one stone. Chuck Norris kills all birds, with two stones. The ones in his pants.
774 %
775 Chuck Norris knows the last digit of pi.
776 %
777 Those aren't credits that roll after Walker Texas Ranger. It is actually a list of fatalities that occurred during the making of the episode.
778 %
779 The air around Chuck Norris is always a balmy 78 degrees.
780 %
781 When Chuck Norris wants an egg, he cracks open a chicken.
782 %
783 Chuck Norris plays racquetball with a waffle iron and a bowling ball.
784 %
785 According to the Bible, God created the universe in six days. Before that, Chuck Norris created God by snapping his fingers.
786 %
787 Chuck Norris doesn't believe in ravioli. He stuffs a live turtle with beef and smothers it in pig's blood.
788 %
789 Count from one to ten. That's how long it would take Chuck Norris to kill you...Fourty seven times.
790 %
791 The 1972 Miami Dolphins lost one game, it was an exhibition game vs. Chuck Norris and three seven year old girls. Chuck Norris won with a roundhouse-kick to the face in overtime.
792 %
793 Chuck Norris is not Politically Correct. He is just Correct. Always.
794 %
795 Mr. T pities the fool. Chuck Norris rips the fool's fucking head off.
796 %
797 Chuck Norris had to stop washing his clothes in the ocean. The tsunamis were killing people.
798 %
799 Chuck Norris has volunteered to remain on earth after the Rapture; he will spend his time fighting the Anti-Christ.
800 %
801 They were going to release a Chuck Norris edition of Clue, but the answer always turns out to be "Chuck Norris. In The Library. With a Roundhouse Kick."
802 %
803 Chuck Norris is the only known mammal in history to have an opposable thumb. On his penis.
804 %
805 A man once taunted Chuck Norris with a bag of Lay's potato chips, saying "Betcha can't eat just one!" Chuck Norris proceeded to eat the chips, the bag, and the man in one deft move.
806 %
807 Chuck Norris' favorite cereal is Kellogg's Nails 'N' Gravel.
808 %
809 In the first Jurassic Park movie, the Tyrannosaurus Rex wasn't chasing the jeep. Chuck Norris was chasing the Tyrannosaurus AND the jeep.
810 %
811 Chuck Norris has never been accused of murder for the simple fact that his roundhouse kicks are recognized world-wide as "acts of God."
812 %
813 "Brokeback Mountain" is not just a movie. It's also what Chuck Norris calls the pile of dead ninjas in his front yard.
814 %
815 Chuck Norris does not wear a condom. Because there is no such thing as protection from Chuck Norris.
816 %
817 Chuck Norris once had sex with a cigarette machine in the Osaka airport.
818 %
819 Rules of fighting: 1) Don't bring a knife to a gun fight. 2) Don't bring a gun to a Chuck Norris fight.
820 %
821 Chuck Norris is the only man who has, literally, beaten the odds. With his fists.
822 %
823 In ancient China there is a legend that one day a child will be born from a dragon, grow to be a man, and vanquish evil from the land. That man is not Chuck Norris, because Chuck Norris killed that man.
824 %
825 Chuck Norris wipes his ass with chain mail and sandpaper.
826 %
827 When you play Monopoly with Chuck Norris, you do not pass go, and you do not collect two hundred dollars. You will be lucky if you make it out alive.
828 %
829 Chuck Norris describes human beings as "a sociable holder for blood and guts".
830 %
831 Chuck Norris once got into a fight with a one-armed Ninja. Seeing that he had an unfair advantage, Chuck Norris ripped both of his arms off and one of his legs. He then roundhouse-kicked the ninja in the head, killing him instantly, and proceeded to sow his limbs back on using only a rusty tent spike and bailing wire.
832 %
833 Chuck Norris likes his ice like he likes his skulls: crushed.
834 %
835 Chuck Norris can kick through all 6 degrees of separation, hitting anyone, anywhere, in the face, at any time.
836 %
837 Most tough men eat nails for breakfast. chuck Norris does all of his grocery shopping at Home Depot.
838 %
839 Chuck Norris did not "lose" his virginity, he stalked it and then destroyed it with extreme prejudice.
840 %
841 Everything King Midas touches turnes to gold. Everything Chuck Norris touches turns up dead.
842 %
843 Chuck Norris' pulse is measured on the richter scale.
844 %
845 Most people know that Descarte said, "I think, therefore I am." What most people don't know is that that quote continues, "...afraid of Chuck Norris."
846 %
847 Chuck Norris once roundhouse-kicked a ten dollar bill into 200 nickels.
848 %
849 For every movie about Vietnam starring Chuck Norris, the historical duration of the war decreases. Just 3 more "Missing in Action" sequels, and that war will have never actually existed.
850 %
851 Chuck Norris' penis has a Hemi.
852 %
853 Chuck Norris enjoys a good practical joke. His favorite is where he removes your lower intestine and pretends to make a balloon animal out of it. Then he cracks your skull open with a Volvo for not complimenting him on his balloon animal.
854 %
855 Chuck Norris CAN in fact 'raise the roof'. And he can do it with one hand.
856 %
857 Kenny G is allowed to live because Chuck Norris doesn't kill women.
858 %
859 Life is not, in fact, like a box of chocolates. It is more like a box of Chuck Norris, roundhouse kicking you in the face. And if you receive a box of Chuck Norris, you ALWAYS know what you are going to get.
860 %
861 For Chuck Norris, every street is "one way". HIS WAY.
862 %
863 There are now five cup sizes at Starbucks: Short, Tall, Grande, Venti, and Chuck Norris.
864 %
865 During the Vietnam War, Chuck Norris allowed himself to be captured. For torture, they made him eat his own entrails. He asked for seconds.
866 %
867 Chuck Norris once created a flamethrower by urinating into a lighter.
868 %
869 Instead of having a cigarette after sex, Chuck Norris heads outside and brands his cattle.
870 %
871 Chuck Norris actually built the stairway to heaven.
872 %
873 Whoever said "only the good die young" was probably in Chuck Norris's kindergarten class.
874 %
875 Chuck Norris once skewered a man with the Eiffel tower.
876 %
877 The best part of waking up, is not Folgers in your cup, but knowing that Chuck Norris didn't kill you in your sleep.
878 %
879 Chuck Norris doesn't own a can opener, he just chews through the can.
880 %
881 Occam's Razor says that the simplest answer tends to be the correct one. Norris' Razor involves a flick of the wrist and a Columbian Necktie.
882 %
883 Chuck Norris needs a monkeywrench and a blowtorch to masturbate.
884 %
885 Proponents of higher-order theories of consciousness argue that consciousness is explained by the relation between two levels of mental states in which a higher-order mental state takes another mental state. If you mention this to Chuck Norris, expect an explosive roundhouse kick to the face for spouting too much fancy-talk.
886 %
887 Chuck Norris invented all 32 letters of the alphabet.
888 %
889 Remember The Ultimate Warrior? He quit wrestling because Chuck Norris wanted his nickname back.
890 %
891 If a tree falls in the forest, does anybody hear? Yes. Chuck Norris hears it. Chuck Norris can hear everything. Chuck Norris can hear the shrieking terror in your soul.
892 %
893 Chuck Norris actually owns IBM. It was an extremely hostile takeover.
894 %
895 He, who laughs last, laughs best. He who laughs at Chuck Norris ? dies.
896 %
897 Chuck Norris is like a dog, not only because he can smell fear, but because he can piss on whatever the fuck he wants.
898 %
899 Chuck Norris can jump-start a car using jumper cables attached to his nipples.
900 %
901 Chuck Norris neither melts in your mouth nor in your hand. He shreds your trachea before ravaging your soul with a combination of chocolate, whickey, roundhouse kicks and death. Oh, and pain. Lots of pain.
902 %
903 Chuck Norris doesn't have blood. He is filled with magma.
904 %
905
plugins/composer/composer.plugin.zsh
1 # ------------------------------------------------------------------------------ 1 # ------------------------------------------------------------------------------
2 # FILE: composer.plugin.zsh 2 # FILE: composer.plugin.zsh
3 # DESCRIPTION: oh-my-zsh composer plugin file. 3 # DESCRIPTION: oh-my-zsh composer plugin file.
4 # AUTHOR: Daniel Gomes (me@danielcsgomes.com) 4 # AUTHOR: Daniel Gomes (me@danielcsgomes.com)
5 # VERSION: 1.0.0 5 # VERSION: 1.0.0
6 # ------------------------------------------------------------------------------ 6 # ------------------------------------------------------------------------------
7 7
8 # Composer basic command completion 8 # Composer basic command completion
9 _composer_get_command_list () { 9 _composer_get_command_list () {
10 $_comp_command1 --no-ansi | sed "1,/Available commands/d" | awk '/^\s*[a-z]+/ { print $1 }' 10 $_comp_command1 --no-ansi | sed "1,/Available commands/d" | awk '/^[ \t]*[a-z]+/ { print $1 }'
11 } 11 }
12 12
13 _composer_get_required_list () { 13 _composer_get_required_list () {
14 $_comp_command1 show -s --no-ansi | sed '1,/requires/d' | awk 'NF > 0 && !/^requires \(dev\)/{ print $1 }' 14 $_comp_command1 show -s --no-ansi | sed '1,/requires/d' | awk 'NF > 0 && !/^requires \(dev\)/{ print $1 }'
15 } 15 }
16 16
17 _composer () { 17 _composer () {
18 local curcontext="$curcontext" state line 18 local curcontext="$curcontext" state line
19 typeset -A opt_args 19 typeset -A opt_args
20 _arguments \ 20 _arguments \
21 '1: :->command'\ 21 '1: :->command'\
22 '*: :->args' 22 '*: :->args'
23 23
24 case $state in 24 case $state in
25 command) 25 command)
26 compadd $(_composer_get_command_list) 26 compadd $(_composer_get_command_list)
27 ;; 27 ;;
28 *) 28 *)
29 compadd $(_composer_get_required_list) 29 compadd $(_composer_get_required_list)
30 ;; 30 ;;
31 esac 31 esac
32 } 32 }
33 33
34 compdef _composer composer 34 compdef _composer composer
35 compdef _composer composer.phar 35 compdef _composer composer.phar
36 36
37 # Aliases 37 # Aliases
38 alias c='composer' 38 alias c='composer'
39 alias csu='composer self-update' 39 alias csu='composer self-update'
40 alias cu='composer update' 40 alias cu='composer update'
41 alias cr='composer require' 41 alias cr='composer require'
42 alias ci='composer install' 42 alias ci='composer install'
43 alias ccp='composer create-project' 43 alias ccp='composer create-project'
44 alias cdu='composer dump-autoload' 44 alias cdu='composer dump-autoload'
45 alias cgu='composer global update' 45 alias cgu='composer global update'
46 alias cgr='composer global require' 46 alias cgr='composer global require'
47 47
48 # install composer in the current directory 48 # install composer in the current directory
49 alias cget='curl -s https://getcomposer.org/installer | php' 49 alias cget='curl -s https://getcomposer.org/installer | php'
50 50
51 # Add Composer's global binaries to PATH 51 # Add Composer's global binaries to PATH
52 export PATH=$PATH:~/.composer/vendor/bin 52 export PATH=$PATH:~/.composer/vendor/bin
53 53
plugins/docker/_docker
1 #compdef docker 1 #compdef docker
2 2
3 # Docker autocompletion for oh-my-zsh 3 # Docker autocompletion for oh-my-zsh
4 # Requires: Docker installed 4 # Requires: Docker installed
5 # Author: Azaan (@aeonazaan) 5 # Author: Azaan (@aeonazaan)
6 # Updates: Bob Maerten (@bobmaerten) for Docker v0.9+ 6 # Updates: Bob Maerten (@bobmaerten) for Docker v0.9+
7 # Paul van den Berg (@bergvandenp) for Docker v1.3+ 7 # Paul van den Berg (@bergvandenp) for Docker v1.3+
8 8
9 9
10 # ----- Helper functions 10 # ----- Helper functions
11 # Output a selectable list of all running docker containers 11 # Output a selectable list of all running docker containers
12 __docker_containers() { 12 __docker_containers() {
13 declare -a cont_cmd 13 declare -a cont_cmd
14 cont_cmd=($(docker ps | awk 'NR>1{print $1":[CON("$1")"$2"("$3")]"}')) 14 cont_cmd=($(docker ps | awk 'NR>1{print $NF":[CON("$1")"$2"("$3")]"}'))
15 _describe 'containers' cont_cmd 15 _describe 'containers' cont_cmd
16 } 16 }
17 17
18 # output a selectable list of all docker images 18 # output a selectable list of all docker images
19 __docker_images() { 19 __docker_images() {
20 declare -a img_cmd 20 declare -a img_cmd
21 img_cmd=($(docker images | awk 'NR>1{print $1}')) 21 img_cmd=($(docker images | awk 'NR>1{print $1}'))
22 _describe 'images' img_cmd 22 _describe 'images' img_cmd
23 } 23 }
24 24
25 # ----- Commands 25 # ----- Commands
26 # Seperate function for each command, makes extension easier later 26 # Seperate function for each command, makes extension easier later
27 # --------------------------- 27 # ---------------------------
28 __attach() { 28 __attach() {
29 _arguments \ 29 _arguments \
30 '--no-stdin[Do not attach stdin]' \ 30 '--no-stdin[Do not attach stdin]' \
31 '--sig-proxy[Proxify all received signal to the process (even in non-tty mode)]' 31 '--sig-proxy[Proxify all received signal to the process (even in non-tty mode)]'
32 __docker_containers 32 __docker_containers
33 } 33 }
34 34
35 __build() { 35 __build() {
36 _arguments \ 36 _arguments \
37 '--no-cache[Do not use cache when building the image]' \ 37 '--no-cache[Do not use cache when building the image]' \
38 '(-q,--quiet)'{-q,--quiet}'[Suppress the verbose output generated by the containers]' \ 38 '(-q,--quiet)'{-q,--quiet}'[Suppress the verbose output generated by the containers]' \
39 '--rm[Remove intermediate containers after a successful build]' \ 39 '--rm[Remove intermediate containers after a successful build]' \
40 '(-t,--tag=)'{-t,--tag=}'[Repository name (and optionally a tag) to be applied to the resulting image in case of success]' \ 40 '(-t,--tag=)'{-t,--tag=}'[Repository name (and optionally a tag) to be applied to the resulting image in case of success]' \
41 '*:files:_files' 41 '*:files:_files'
42 } 42 }
43 43
44 __commit() { 44 __commit() {
45 _arguments \ 45 _arguments \
46 '(-a,--author=)'{-a,--author=}'[Author (eg. "John Hannibal Smith <hannibal@a-team.com>"]' \ 46 '(-a,--author=)'{-a,--author=}'[Author (eg. "John Hannibal Smith <hannibal@a-team.com>"]' \
47 '(-m,--message=)'{-m,--message=}'[Commit message]' \ 47 '(-m,--message=)'{-m,--message=}'[Commit message]' \
48 '--run=[Config automatically applied when the image is run.]' 48 '--run=[Config automatically applied when the image is run.]'
49 __docker_containers 49 __docker_containers
50 } 50 }
51 51
52 __cp() { 52 __cp() {
53 __docker_containers 53 __docker_containers
54 } 54 }
55 55
56 __diff() { 56 __diff() {
57 __docker_containers 57 __docker_containers
58 } 58 }
59 59
60 __events() { 60 __events() {
61 _arguments \ 61 _arguments \
62 '--since=[Show previously created events and then stream.]' 62 '--since=[Show previously created events and then stream.]'
63 } 63 }
64 64
65 __export() { 65 __export() {
66 __docker_containers 66 __docker_containers
67 } 67 }
68 68
69 __history() { 69 __history() {
70 _arguments \ 70 _arguments \
71 '--no-trunc=[Don''t truncate output]' \ 71 '--no-trunc=[Don''t truncate output]' \
72 '(-q,--quiet)'{-q,--quiet}'[Only show numeric IDs]' 72 '(-q,--quiet)'{-q,--quiet}'[Only show numeric IDs]'
73 __docker_images 73 __docker_images
74 } 74 }
75 75
76 __images() { 76 __images() {
77 _arguments \ 77 _arguments \
78 '(-a,--all)'{-a,--all}'[Show all images (by default filter out the intermediate images used to build)]' \ 78 '(-a,--all)'{-a,--all}'[Show all images (by default filter out the intermediate images used to build)]' \
79 '--no-trunc[Don''t truncate output]' \ 79 '--no-trunc[Don''t truncate output]' \
80 '(-q,--quiet=)'{-q,--quiet=}'[Only show numeric IDs]' \ 80 '(-q,--quiet=)'{-q,--quiet=}'[Only show numeric IDs]' \
81 '(-t,--tree=)'{-t,--tree=}'[Output graph in tree format]' \ 81 '(-t,--tree=)'{-t,--tree=}'[Output graph in tree format]' \
82 '(-v,--viz=)'{-v,--viz=}'[Output graph in graphviz format]' 82 '(-v,--viz=)'{-v,--viz=}'[Output graph in graphviz format]'
83 __docker_images 83 __docker_images
84 } 84 }
85 85
86 __import() { 86 __import() {
87 _arguments '*:files:_files' 87 _arguments '*:files:_files'
88 } 88 }
89 89
90 __info() { 90 __info() {
91 # no arguments 91 # no arguments
92 } 92 }
93 93
94 __insert() { 94 __insert() {
95 __docker_images 95 __docker_images
96 _arguments '*:files:_files' 96 _arguments '*:files:_files'
97 } 97 }
98 98
99 __inspect() { 99 __inspect() {
100 __docker_images 100 __docker_images
101 __docker_containers 101 __docker_containers
102 } 102 }
103 103
104 __kill() { 104 __kill() {
105 __docker_containers 105 __docker_containers
106 } 106 }
107 107
108 __load() { 108 __load() {
109 _arguments '*:files:_files' 109 _arguments '*:files:_files'
110 } 110 }
111 111
112 __login() { 112 __login() {
113 _arguments \ 113 _arguments \
114 '(-e,--email=)'{-e,-email=}'[Email]' \ 114 '(-e,--email=)'{-e,-email=}'[Email]' \
115 '(-p,--password=)'{-p,-password=}'[Password]' \ 115 '(-p,--password=)'{-p,-password=}'[Password]' \
116 '(-u,--username=)'{-u,-username=}'[Username]' 116 '(-u,--username=)'{-u,-username=}'[Username]'
117 } 117 }
118 118
119 __logs() { 119 __logs() {
120 _arguments \ 120 _arguments \
121 '(-f,--follow)'{-f,-follow}'[Follow log output]' 121 '(-f,--follow)'{-f,-follow}'[Follow log output]'
122 __docker_containers 122 __docker_containers
123 } 123 }
124 124
125 __port() { 125 __port() {
126 __docker_containers 126 __docker_containers
127 } 127 }
128 128
129 __top() { 129 __top() {
130 __docker_containers 130 __docker_containers
131 } 131 }
132 132
133 __ps() { 133 __ps() {
134 _arguments \ 134 _arguments \
135 '(-a,--all)'{-a,--all}'[Show all containers. Only running containers are shown by default.]' \ 135 '(-a,--all)'{-a,--all}'[Show all containers. Only running containers are shown by default.]' \
136 '--before-id=[Show only container created before Id, include non-running ones.]' \ 136 '--before-id=[Show only container created before Id, include non-running ones.]' \
137 '(-l,--latest)'{-l,--latest}'[Show only the latest created container, include non-running ones.]' \ 137 '(-l,--latest)'{-l,--latest}'[Show only the latest created container, include non-running ones.]' \
138 '-n=[Show n last created containers, include non-running ones. default=-1.]' \ 138 '-n=[Show n last created containers, include non-running ones. default=-1.]' \
139 '--no-trunc[Don''t truncate output]' \ 139 '--no-trunc[Don''t truncate output]' \
140 '(-q,--quiet)'{-q,--quiet}'[Only display numeric IDs]' \ 140 '(-q,--quiet)'{-q,--quiet}'[Only display numeric IDs]' \
141 '(-s,--size)'{-s,--size}'[Display sizes]' \ 141 '(-s,--size)'{-s,--size}'[Display sizes]' \
142 '--since-id=[Show only containers created since Id, include non-running ones.]' 142 '--since-id=[Show only containers created since Id, include non-running ones.]'
143 } 143 }
144 144
145 __pull() { 145 __pull() {
146 _arguments \ 146 _arguments \
147 '(-t,--tag=)'{-t,--tag=}'[Download tagged image in repository]' 147 '(-t,--tag=)'{-t,--tag=}'[Download tagged image in repository]'
148 } 148 }
149 149
150 __push() { 150 __push() {
151 # no arguments 151 # no arguments
152 } 152 }
153 153
154 __restart() { 154 __restart() {
155 _arguments \ 155 _arguments \
156 '(-t,--time=)'{-t,--time=}'[Number of seconds to try to stop for before killing the container. Once killed it will then be restarted. Default=10]' 156 '(-t,--time=)'{-t,--time=}'[Number of seconds to try to stop for before killing the container. Once killed it will then be restarted. Default=10]'
157 __docker_containers 157 __docker_containers
158 } 158 }
159 159
160 __rm() { 160 __rm() {
161 _arguments \ 161 _arguments \
162 '(-f,--force=)'{-f,--force=}'[Force removal of running container]' \ 162 '(-f,--force=)'{-f,--force=}'[Force removal of running container]' \
163 '(-l,--link=)'{-l,--link=}'[Remove the specified link and not the underlying container]' \ 163 '(-l,--link=)'{-l,--link=}'[Remove the specified link and not the underlying container]' \
164 '(-v,--volumes=)'{-v,--volumes=}'[Remove the volumes associated to the container]' 164 '(-v,--volumes=)'{-v,--volumes=}'[Remove the volumes associated to the container]'
165 __docker_containers 165 __docker_containers
166 } 166 }
167 167
168 __rmi() { 168 __rmi() {
169 _arguments \ 169 _arguments \
170 '(-f,--force=)'{-f,--force=}'[Force]' 170 '(-f,--force=)'{-f,--force=}'[Force]'
171 __docker_images 171 __docker_images
172 } 172 }
173 173
174 __run() { 174 __run() {
175 _arguments \ 175 _arguments \
176 '(-P,--publish-all=)'{-P,--publish-all=}'[Publish all exposed ports to the host interfaces]' \ 176 '(-P,--publish-all=)'{-P,--publish-all=}'[Publish all exposed ports to the host interfaces]' \
177 '(-a,--attach=)'{-a,--attach=}'[Attach to stdin, stdout or stderr.]' \ 177 '(-a,--attach=)'{-a,--attach=}'[Attach to stdin, stdout or stderr.]' \
178 '(-c,--cpu-shares=)'{-c,--cpu-shares=}': CPU shares (relative weight)]' \ 178 '(-c,--cpu-shares=)'{-c,--cpu-shares=}': CPU shares (relative weight)]' \
179 '--cidfile=[Write the container ID to the file]' \ 179 '--cidfile=[Write the container ID to the file]' \
180 '(-d,--detach=)'{-d,--detach=}'[Detached mode: Run container in the background, print new container id]' \ 180 '(-d,--detach=)'{-d,--detach=}'[Detached mode: Run container in the background, print new container id]' \
181 '--dns=[Set custom dns servers]' \ 181 '--dns=[Set custom dns servers]' \
182 '(-e,--env=)'{-e,--env=}'[Set environment variables]' \ 182 '(-e,--env=)'{-e,--env=}'[Set environment variables]' \
183 '--entrypoint=[Overwrite the default entrypoint of the image]' \ 183 '--entrypoint=[Overwrite the default entrypoint of the image]' \
184 '--expose=[Expose a port from the container without publishing it to your host]' \ 184 '--expose=[Expose a port from the container without publishing it to your host]' \
185 '(-h,--hostname=)'{-h,--hostname=}'[Container host name]' \ 185 '(-h,--hostname=)'{-h,--hostname=}'[Container host name]' \
186 '(-i,--interactive=)'{-i,--interactive=}'[Keep stdin open even if not attached]' \ 186 '(-i,--interactive=)'{-i,--interactive=}'[Keep stdin open even if not attached]' \
187 '--link=[Add link to another container (name:alias)]' \ 187 '--link=[Add link to another container (name:alias)]' \
188 '--lxc-conf=[Add custom lxc options -lxc-conf="lxc.cgroup.cpuset.cpus = 0,1"]' \ 188 '--lxc-conf=[Add custom lxc options -lxc-conf="lxc.cgroup.cpuset.cpus = 0,1"]' \
189 '(-m,--memory=)'{-m,--memory=}'[Memory limit (format: <number><optional unit>, where unit = b, k, m or g)]' \ 189 '(-m,--memory=)'{-m,--memory=}'[Memory limit (format: <number><optional unit>, where unit = b, k, m or g)]' \
190 '(-n,--networking=)'{-n,--networking=}'[Enable networking for this container]' \ 190 '(-n,--networking=)'{-n,--networking=}'[Enable networking for this container]' \
191 '--name=[Assign a name to the container]' \ 191 '--name=[Assign a name to the container]' \
192 '(-p,--publish=)'{-p,--publish=}'[Publish a container''s port to the host (format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort) (use "docker port" to see the actual mapping)]' \ 192 '(-p,--publish=)'{-p,--publish=}'[Publish a container''s port to the host (format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort) (use "docker port" to see the actual mapping)]' \
193 '--privileged=[Give extended privileges to this container]' \ 193 '--privileged=[Give extended privileges to this container]' \
194 '--rm=[Automatically remove the container when it exits (incompatible with -d)]' \ 194 '--rm=[Automatically remove the container when it exits (incompatible with -d)]' \
195 '--sig-proxy=[Proxify all received signal to the process (even in non-tty mode)]' \ 195 '--sig-proxy=[Proxify all received signal to the process (even in non-tty mode)]' \
196 '(-t,--tty=)'{-t,--tty=}'[Allocate a pseudo-tty]' \ 196 '(-t,--tty=)'{-t,--tty=}'[Allocate a pseudo-tty]' \
197 '(-u,--user=)'{-u,--user=}'[Username or UID]' \ 197 '(-u,--user=)'{-u,--user=}'[Username or UID]' \
198 '(-v,--volume=)'{-v,--volume=}'[Bind mount a volume (e.g. from the host: -v /host:/container, from docker: -v /container)]' \ 198 '(-v,--volume=)'{-v,--volume=}'[Bind mount a volume (e.g. from the host: -v /host:/container, from docker: -v /container)]' \
199 '--volumes-from=[Mount volumes from the specified container(s)]' \ 199 '--volumes-from=[Mount volumes from the specified container(s)]' \
200 '(-w,--workdir=)'{-w,--workdir=}'[Working directory inside the container]' 200 '(-w,--workdir=)'{-w,--workdir=}'[Working directory inside the container]'
201 __docker_images 201 __docker_images
202 } 202 }
203 203
204 __search() { 204 __search() {
205 _arguments \ 205 _arguments \
206 '--no-trunc=[Don''t truncate output]' \ 206 '--no-trunc=[Don''t truncate output]' \
207 '-s,--stars=)'{-s,--stars=}'[Only displays with at least xxx stars]' \ 207 '-s,--stars=)'{-s,--stars=}'[Only displays with at least xxx stars]' \
208 '-t,--trusted=)'{-t,--trusted=}'[Only show trusted builds]' 208 '-t,--trusted=)'{-t,--trusted=}'[Only show trusted builds]'
209 } 209 }
210 210
211 __save() { 211 __save() {
212 __docker_images 212 __docker_images
213 } 213 }
214 214
215 __start() { 215 __start() {
216 _arguments \ 216 _arguments \
217 '(-a,--attach=)'{-a,--attach=}'[Attach container''s stdout/stderr and forward all signals to the process]' \ 217 '(-a,--attach=)'{-a,--attach=}'[Attach container''s stdout/stderr and forward all signals to the process]' \
218 '(-i,--interactive=)'{-i,--interactive=}'[Attach container''s stdin]' 218 '(-i,--interactive=)'{-i,--interactive=}'[Attach container''s stdin]'
219 __docker_containers 219 __docker_containers
220 } 220 }
221 221
222 __stats() {
223 __docker_containers
224 }
225
222 __stop() { 226 __stop() {
223 _arguments \ 227 _arguments \
224 '(-t,--time=)'{-t,--time=}'[Number of seconds to wait for the container to stop before killing it.]' 228 '(-t,--time=)'{-t,--time=}'[Number of seconds to wait for the container to stop before killing it.]'
225 __docker_containers 229 __docker_containers
226 } 230 }
227 231
228 __tag() { 232 __tag() {
229 _arguments \ 233 _arguments \
230 '(-f,--force=)'{-f,--force=}'[Force]' 234 '(-f,--force=)'{-f,--force=}'[Force]'
231 __docker_images 235 __docker_images
232 } 236 }
233 237
234 __version() { 238 __version() {
235 # no arguments 239 # no arguments
236 } 240 }
237 241
238 __wait() { 242 __wait() {
239 __docker_containers 243 __docker_containers
240 } 244 }
241 245
242 __exec() { 246 __exec() {
243 _arguments \ 247 _arguments \
244 '(-d,--detach=)'{-d,--detach=}'[Detached mode: run command in the background]' \ 248 '(-d,--detach=)'{-d,--detach=}'[Detached mode: run command in the background]' \
245 '(-i,--interactive=)'{-i,--interactive=}'[Keep STDIN open even if not attached]' \ 249 '(-i,--interactive=)'{-i,--interactive=}'[Keep STDIN open even if not attached]' \
246 '(-t,--tty=)'{-t,--tty=}'[Allocate a pseudo-TTY]' 250 '(-t,--tty=)'{-t,--tty=}'[Allocate a pseudo-TTY]'
247 __docker_containers 251 __docker_containers
248 } 252 }
249 253
250 # end commands --------- 254 # end commands ---------
251 # ---------------------- 255 # ----------------------
252 256
253 local -a _1st_arguments 257 local -a _1st_arguments
254 _1st_arguments=( 258 _1st_arguments=(
255 "attach":"Attach to a running container" 259 "attach":"Attach to a running container"
256 "build":"Build a container from a Dockerfile" 260 "build":"Build a container from a Dockerfile"
257 "commit":"Create a new image from a container's changes" 261 "commit":"Create a new image from a container's changes"
258 "cp":"Copy files/folders from the containers filesystem to the host path" 262 "cp":"Copy files/folders from the containers filesystem to the host path"
259 "diff":"Inspect changes on a container's filesystem" 263 "diff":"Inspect changes on a container's filesystem"
260 "events":"Get real time events from the server" 264 "events":"Get real time events from the server"
261 "export":"Stream the contents of a container as a tar archive" 265 "export":"Stream the contents of a container as a tar archive"
262 "history":"Show the history of an image" 266 "history":"Show the history of an image"
263 "images":"List images" 267 "images":"List images"
264 "import":"Create a new filesystem image from the contents of a tarball" 268 "import":"Create a new filesystem image from the contents of a tarball"
265 "info":"Display system-wide information" 269 "info":"Display system-wide information"
266 "insert":"Insert a file in an image" 270 "insert":"Insert a file in an image"
267 "inspect":"Return low-level information on a container" 271 "inspect":"Return low-level information on a container"
268 "kill":"Kill a running container" 272 "kill":"Kill a running container"
269 "load":"Load an image from a tar archive" 273 "load":"Load an image from a tar archive"
270 "login":"Register or Login to the docker registry server" 274 "login":"Register or Login to the docker registry server"
271 "logs":"Fetch the logs of a container" 275 "logs":"Fetch the logs of a container"
272 "port":"Lookup the public-facing port which is NAT-ed to PRIVATE_PORT" 276 "port":"Lookup the public-facing port which is NAT-ed to PRIVATE_PORT"
273 "ps":"List containers" 277 "ps":"List containers"
274 "pull":"Pull an image or a repository from the docker registry server" 278 "pull":"Pull an image or a repository from the docker registry server"
275 "push":"Push an image or a repository to the docker registry server" 279 "push":"Push an image or a repository to the docker registry server"
276 "restart":"Restart a running container" 280 "restart":"Restart a running container"
277 "rm":"Remove one or more containers" 281 "rm":"Remove one or more containers"
278 "rmi":"Remove one or more images" 282 "rmi":"Remove one or more images"
279 "run":"Run a command in a new container" 283 "run":"Run a command in a new container"
280 "save":"Save an image to a tar archive" 284 "save":"Save an image to a tar archive"
281 "search":"Search for an image in the docker index" 285 "search":"Search for an image in the docker index"
282 "start":"Start a stopped container" 286 "start":"Start a stopped container"
287 "stats":"Display a live stream of one or more containers' resource usage statistics"
283 "stop":"Stop a running container" 288 "stop":"Stop a running container"
284 "tag":"Tag an image into a repository" 289 "tag":"Tag an image into a repository"
285 "top":"Lookup the running processes of a container" 290 "top":"Lookup the running processes of a container"
286 "version":"Show the docker version information" 291 "version":"Show the docker version information"
287 "wait":"Block until a container stops, then print its exit code" 292 "wait":"Block until a container stops, then print its exit code"
288 "exec":"Run a task inside a running container" 293 "exec":"Run a task inside a running container"
289 ) 294 )
290 295
291 _arguments '*:: :->command' 296 _arguments '*:: :->command'
292 297
293 if (( CURRENT == 1 )); then 298 if (( CURRENT == 1 )); then
294 _describe -t commands "docker command" _1st_arguments 299 _describe -t commands "docker command" _1st_arguments
295 return 300 return
296 fi 301 fi
297 302
298 local -a _command_args 303 local -a _command_args
299 case "$words[1]" in 304 case "$words[1]" in
300 attach) 305 attach)
301 __attach ;; 306 __attach ;;
302 build) 307 build)
303 __build ;; 308 __build ;;
304 commit) 309 commit)
305 __commit ;; 310 __commit ;;
306 cp) 311 cp)
307 __cp ;; 312 __cp ;;
308 diff) 313 diff)
309 __diff ;; 314 __diff ;;
310 events) 315 events)
311 __events ;; 316 __events ;;
312 export) 317 export)
313 __export ;; 318 __export ;;
314 history) 319 history)
315 __history ;; 320 __history ;;
316 images) 321 images)
317 __images ;; 322 __images ;;
318 import) 323 import)
319 __import ;; 324 __import ;;
320 info) 325 info)
321 __info ;; 326 __info ;;
322 insert) 327 insert)
323 __insert ;; 328 __insert ;;
324 inspect) 329 inspect)
325 __inspect ;; 330 __inspect ;;
326 kill) 331 kill)
327 __kill ;; 332 __kill ;;
328 load) 333 load)
329 __load ;; 334 __load ;;
330 login) 335 login)
331 __login ;; 336 __login ;;
332 logs) 337 logs)
333 __logs ;; 338 __logs ;;
334 port) 339 port)
335 __port ;; 340 __port ;;
336 ps) 341 ps)
337 __ps ;; 342 __ps ;;
338 pull) 343 pull)
339 __pull ;; 344 __pull ;;
340 push) 345 push)
341 __push ;; 346 __push ;;
342 restart) 347 restart)
343 __restart ;; 348 __restart ;;
344 rm) 349 rm)
345 __rm ;; 350 __rm ;;
346 rmi) 351 rmi)
347 __rmi ;; 352 __rmi ;;
348 run) 353 run)
349 __run ;; 354 __run ;;
350 save) 355 save)
351 __save ;; 356 __save ;;
352 search) 357 search)
353 __search ;; 358 __search ;;
359 stats)
360 __stats ;;
354 start) 361 start)
355 __start ;; 362 __start ;;
356 stop) 363 stop)
357 __stop ;; 364 __stop ;;
358 tag) 365 tag)
359 __tag ;; 366 __tag ;;
360 top) 367 top)
361 __top ;; 368 __top ;;
362 version) 369 version)
363 __version ;; 370 __version ;;
364 wait) 371 wait)
365 __wait ;; 372 __wait ;;
366 exec) 373 exec)
367 __exec ;; 374 __exec ;;
368 esac 375 esac
369 376
plugins/ember-cli/README.md
File was created 1 # Ember-cli
2
3 **Maintainer:** [BilalBudhani](http://www.github.com/BilalBudhani)
4
5 Ember-cli (http://www.ember-cli.com/)
6
7 ### List of Aliases
8
9 alias es='ember serve'
10 alias ea='ember addon'
11 alias eb='ember build'
12 alias ed='ember destroy'
13 alias eg='ember generate'
14 alias eh='ember help'
15 alias ein='ember init'
16 alias eia='ember install:addon'
17 alias eib='ember install:bower'
18 alias ein='ember install:npm'
19 alias ei='ember install'
20 alias et='ember test'
21 alias eu='ember update'
22 alias ev='ember version'
23
plugins/ember-cli/ember-cli.plugin.zsh
File was created 1 # Ember ClI
2 # visit http://www.ember-cli.com/ to view user guid
3
4 alias es='ember serve'
5 alias ea='ember addon'
6 alias eb='ember build'
7 alias ed='ember destroy'
8 alias eg='ember generate'
9 alias eh='ember help'
10 alias ein='ember init'
11 alias eia='ember install:addon'
12 alias eib='ember install:bower'
13 alias ein='ember install:npm'
14 alias ei='ember install'
15 alias et='ember test'
16 alias eu='ember update'
17
18 # version
19 alias ev='ember version'
20
plugins/git-flow/git-flow.plugin.zsh
1 #!zsh 1 #!zsh
2 # 2 #
3 # Installation 3 # Installation
4 # ------------ 4 # ------------
5 # 5 #
6 # To achieve git-flow completion nirvana: 6 # To achieve git-flow completion nirvana:
7 # 7 #
8 # 0. Update your zsh's git-completion module to the newest verion. 8 # 0. Update your zsh's git-completion module to the newest version.
9 # From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD 9 # From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD
10 # 10 #
11 # 1. Install this file. Either: 11 # 1. Install this file. Either:
12 # 12 #
13 # a. Place it in your .zshrc: 13 # a. Place it in your .zshrc:
14 # 14 #
15 # b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in 15 # b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in
16 # your .zshrc: 16 # your .zshrc:
17 # 17 #
18 # source ~/.git-flow-completion.zsh 18 # source ~/.git-flow-completion.zsh
19 # 19 #
20 # c. Or, use this file as a oh-my-zsh plugin. 20 # c. Or, use this file as an oh-my-zsh plugin.
21 # 21 #
22 22
23 #Alias 23 #Alias
24 alias gf='git flow' 24 alias gf='git flow'
25 alias gcd='git checkout develop' 25 alias gcd='git checkout develop'
26 alias gch='git checkout hotfix' 26 alias gch='git checkout hotfix'
27 alias gcr='git checkout release' 27 alias gcr='git checkout release'
28 28
29 _git-flow () 29 _git-flow ()
30 { 30 {
31 local curcontext="$curcontext" state line 31 local curcontext="$curcontext" state line
32 typeset -A opt_args 32 typeset -A opt_args
33 33
34 _arguments -C \ 34 _arguments -C \
35 ':command:->command' \ 35 ':command:->command' \
36 '*::options:->options' 36 '*::options:->options'
37 37
38 case $state in 38 case $state in
39 (command) 39 (command)
40 40
41 local -a subcommands 41 local -a subcommands
42 subcommands=( 42 subcommands=(
43 'init:Initialize a new git repo with support for the branching model.' 43 'init:Initialize a new git repo with support for the branching model.'
44 'feature:Manage your feature branches.' 44 'feature:Manage your feature branches.'
45 'release:Manage your release branches.' 45 'release:Manage your release branches.'
46 'hotfix:Manage your hotfix branches.' 46 'hotfix:Manage your hotfix branches.'
47 'support:Manage your support branches.' 47 'support:Manage your support branches.'
48 'version:Shows version information.' 48 'version:Shows version information.'
49 ) 49 )
50 _describe -t commands 'git flow' subcommands 50 _describe -t commands 'git flow' subcommands
51 ;; 51 ;;
52 52
53 (options) 53 (options)
54 case $line[1] in 54 case $line[1] in
55 55
56 (init) 56 (init)
57 _arguments \ 57 _arguments \
58 -f'[Force setting of gitflow branches, even if already configured]' 58 -f'[Force setting of gitflow branches, even if already configured]'
59 ;; 59 ;;
60 60
61 (version) 61 (version)
62 ;; 62 ;;
63 63
64 (hotfix) 64 (hotfix)
65 __git-flow-hotfix 65 __git-flow-hotfix
66 ;; 66 ;;
67 67
68 (release) 68 (release)
69 __git-flow-release 69 __git-flow-release
70 ;; 70 ;;
71 71
72 (feature) 72 (feature)
73 __git-flow-feature 73 __git-flow-feature
74 ;; 74 ;;
75 esac 75 esac
76 ;; 76 ;;
77 esac 77 esac
78 } 78 }
79 79
80 __git-flow-release () 80 __git-flow-release ()
81 { 81 {
82 local curcontext="$curcontext" state line 82 local curcontext="$curcontext" state line
83 typeset -A opt_args 83 typeset -A opt_args
84 84
85 _arguments -C \ 85 _arguments -C \
86 ':command:->command' \ 86 ':command:->command' \
87 '*::options:->options' 87 '*::options:->options'
88 88
89 case $state in 89 case $state in
90 (command) 90 (command)
91 91
92 local -a subcommands 92 local -a subcommands
93 subcommands=( 93 subcommands=(
94 'start:Start a new release branch.' 94 'start:Start a new release branch.'
95 'finish:Finish a release branch.' 95 'finish:Finish a release branch.'
96 'list:List all your release branches. (Alias to `git flow release`)' 96 'list:List all your release branches. (Alias to `git flow release`)'
97 'publish: public' 97 'publish: public'
98 'track: track' 98 'track: track'
99 ) 99 )
100 _describe -t commands 'git flow release' subcommands 100 _describe -t commands 'git flow release' subcommands
101 _arguments \ 101 _arguments \
102 -v'[Verbose (more) output]' 102 -v'[Verbose (more) output]'
103 ;; 103 ;;
104 104
105 (options) 105 (options)
106 case $line[1] in 106 case $line[1] in
107 107
108 (start) 108 (start)
109 _arguments \ 109 _arguments \
110 -F'[Fetch from origin before performing finish]'\ 110 -F'[Fetch from origin before performing finish]'\
111 ':version:__git_flow_version_list' 111 ':version:__git_flow_version_list'
112 ;; 112 ;;
113 113
114 (finish) 114 (finish)
115 _arguments \ 115 _arguments \
116 -F'[Fetch from origin before performing finish]' \ 116 -F'[Fetch from origin before performing finish]' \
117 -s'[Sign the release tag cryptographically]'\ 117 -s'[Sign the release tag cryptographically]'\
118 -u'[Use the given GPG-key for the digital signature (implies -s)]'\ 118 -u'[Use the given GPG-key for the digital signature (implies -s)]'\
119 -m'[Use the given tag message]'\ 119 -m'[Use the given tag message]'\
120 -p'[Push to $ORIGIN after performing finish]'\ 120 -p'[Push to $ORIGIN after performing finish]'\
121 -k'[Keep branch after performing finish]'\ 121 -k'[Keep branch after performing finish]'\
122 -n"[Don't tag this release]"\ 122 -n"[Don't tag this release]"\
123 ':version:__git_flow_version_list' 123 ':version:__git_flow_version_list'
124 ;; 124 ;;
125 125
126 (publish) 126 (publish)
127 _arguments \ 127 _arguments \
128 ':version:__git_flow_version_list'\ 128 ':version:__git_flow_version_list'\
129 ;; 129 ;;
130 130
131 (track) 131 (track)
132 _arguments \ 132 _arguments \
133 ':version:__git_flow_version_list'\ 133 ':version:__git_flow_version_list'\
134 ;; 134 ;;
135 135
136 *) 136 *)
137 _arguments \ 137 _arguments \
138 -v'[Verbose (more) output]' 138 -v'[Verbose (more) output]'
139 ;; 139 ;;
140 esac 140 esac
141 ;; 141 ;;
142 esac 142 esac
143 } 143 }
144 144
145 __git-flow-hotfix () 145 __git-flow-hotfix ()
146 { 146 {
147 local curcontext="$curcontext" state line 147 local curcontext="$curcontext" state line
148 typeset -A opt_args 148 typeset -A opt_args
149 149
150 _arguments -C \ 150 _arguments -C \
151 ':command:->command' \ 151 ':command:->command' \
152 '*::options:->options' 152 '*::options:->options'
153 153
154 case $state in 154 case $state in
155 (command) 155 (command)
156 156
157 local -a subcommands 157 local -a subcommands
158 subcommands=( 158 subcommands=(
159 'start:Start a new hotfix branch.' 159 'start:Start a new hotfix branch.'
160 'finish:Finish a hotfix branch.' 160 'finish:Finish a hotfix branch.'
161 'list:List all your hotfix branches. (Alias to `git flow hotfix`)' 161 'list:List all your hotfix branches. (Alias to `git flow hotfix`)'
162 ) 162 )
163 _describe -t commands 'git flow hotfix' subcommands 163 _describe -t commands 'git flow hotfix' subcommands
164 _arguments \ 164 _arguments \
165 -v'[Verbose (more) output]' 165 -v'[Verbose (more) output]'
166 ;; 166 ;;
167 167
168 (options) 168 (options)
169 case $line[1] in 169 case $line[1] in
170 170
171 (start) 171 (start)
172 _arguments \ 172 _arguments \
173 -F'[Fetch from origin before performing finish]'\ 173 -F'[Fetch from origin before performing finish]'\
174 ':hotfix:__git_flow_version_list'\ 174 ':hotfix:__git_flow_version_list'\
175 ':branch-name:__git_branch_names' 175 ':branch-name:__git_branch_names'
176 ;; 176 ;;
177 177
178 (finish) 178 (finish)
179 _arguments \ 179 _arguments \
180 -F'[Fetch from origin before performing finish]' \ 180 -F'[Fetch from origin before performing finish]' \
181 -s'[Sign the release tag cryptographically]'\ 181 -s'[Sign the release tag cryptographically]'\
182 -u'[Use the given GPG-key for the digital signature (implies -s)]'\ 182 -u'[Use the given GPG-key for the digital signature (implies -s)]'\
183 -m'[Use the given tag message]'\ 183 -m'[Use the given tag message]'\
184 -p'[Push to $ORIGIN after performing finish]'\ 184 -p'[Push to $ORIGIN after performing finish]'\
185 -k'[Keep branch after performing finish]'\ 185 -k'[Keep branch after performing finish]'\
186 -n"[Don't tag this release]"\ 186 -n"[Don't tag this release]"\
187 ':hotfix:__git_flow_hotfix_list' 187 ':hotfix:__git_flow_hotfix_list'
188 ;; 188 ;;
189 189
190 *) 190 *)
191 _arguments \ 191 _arguments \
192 -v'[Verbose (more) output]' 192 -v'[Verbose (more) output]'
193 ;; 193 ;;
194 esac 194 esac
195 ;; 195 ;;
196 esac 196 esac
197 } 197 }
198 198
199 __git-flow-feature () 199 __git-flow-feature ()
200 { 200 {
201 local curcontext="$curcontext" state line 201 local curcontext="$curcontext" state line
202 typeset -A opt_args 202 typeset -A opt_args
203 203
204 _arguments -C \ 204 _arguments -C \
205 ':command:->command' \ 205 ':command:->command' \
206 '*::options:->options' 206 '*::options:->options'
207 207
208 case $state in 208 case $state in
209 (command) 209 (command)
210 210
211 local -a subcommands 211 local -a subcommands
212 subcommands=( 212 subcommands=(
213 'start:Start a new feature branch.' 213 'start:Start a new feature branch.'
214 'finish:Finish a feature branch.' 214 'finish:Finish a feature branch.'
215 'list:List all your feature branches. (Alias to `git flow feature`)' 215 'list:List all your feature branches. (Alias to `git flow feature`)'
216 'publish: publish' 216 'publish: publish'
217 'track: track' 217 'track: track'
218 'diff: diff' 218 'diff: diff'
219 'rebase: rebase' 219 'rebase: rebase'
220 'checkout: checkout' 220 'checkout: checkout'
221 'pull: pull' 221 'pull: pull'
222 ) 222 )
223 _describe -t commands 'git flow feature' subcommands 223 _describe -t commands 'git flow feature' subcommands
224 _arguments \ 224 _arguments \
225 -v'[Verbose (more) output]' 225 -v'[Verbose (more) output]'
226 ;; 226 ;;
227 227
228 (options) 228 (options)
229 case $line[1] in 229 case $line[1] in
230 230
231 (start) 231 (start)
232 _arguments \ 232 _arguments \
233 -F'[Fetch from origin before performing finish]'\ 233 -F'[Fetch from origin before performing finish]'\
234 ':feature:__git_flow_feature_list'\ 234 ':feature:__git_flow_feature_list'\
235 ':branch-name:__git_branch_names' 235 ':branch-name:__git_branch_names'
236 ;; 236 ;;
237 237
238 (finish) 238 (finish)
239 _arguments \ 239 _arguments \
240 -F'[Fetch from origin before performing finish]' \ 240 -F'[Fetch from origin before performing finish]' \
241 -r'[Rebase instead of merge]'\ 241 -r'[Rebase instead of merge]'\
242 -k'[Keep branch after performing finish]'\ 242 -k'[Keep branch after performing finish]'\
243 ':feature:__git_flow_feature_list' 243 ':feature:__git_flow_feature_list'
244 ;; 244 ;;
245 245
246 (publish) 246 (publish)
247 _arguments \ 247 _arguments \
248 ':feature:__git_flow_feature_list'\ 248 ':feature:__git_flow_feature_list'\
249 ;; 249 ;;
250 250
251 (track) 251 (track)
252 _arguments \ 252 _arguments \
253 ':feature:__git_flow_feature_list'\ 253 ':feature:__git_flow_feature_list'\
254 ;; 254 ;;
255 255
256 (diff) 256 (diff)
257 _arguments \ 257 _arguments \
258 ':branch:__git_flow_feature_list'\ 258 ':branch:__git_flow_feature_list'\
259 ;; 259 ;;
260 260
261 (rebase) 261 (rebase)
262 _arguments \ 262 _arguments \
263 -i'[Do an interactive rebase]' \ 263 -i'[Do an interactive rebase]' \
264 ':branch:__git_flow_feature_list' 264 ':branch:__git_flow_feature_list'
265 ;; 265 ;;
266 266
267 (checkout) 267 (checkout)
268 _arguments \ 268 _arguments \
269 ':branch:__git_flow_feature_list'\ 269 ':branch:__git_flow_feature_list'\
270 ;; 270 ;;
271 271
272 (pull) 272 (pull)
273 _arguments \ 273 _arguments \
274 ':remote:__git_remotes'\ 274 ':remote:__git_remotes'\
275 ':branch:__git_flow_feature_list' 275 ':branch:__git_flow_feature_list'
276 ;; 276 ;;
277 277
278 *) 278 *)
279 _arguments \ 279 _arguments \
280 -v'[Verbose (more) output]' 280 -v'[Verbose (more) output]'
281 ;; 281 ;;
282 esac 282 esac
283 ;; 283 ;;
284 esac 284 esac
285 } 285 }
286 286
287 __git_flow_version_list () 287 __git_flow_version_list ()
288 { 288 {
289 local expl 289 local expl
290 declare -a versions 290 declare -a versions
291 291
292 versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}}) 292 versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}})
293 __git_command_successful || return 293 __git_command_successful || return
294 294
295 _wanted versions expl 'version' compadd $versions 295 _wanted versions expl 'version' compadd $versions
296 } 296 }
297 297
298 __git_flow_feature_list () 298 __git_flow_feature_list ()
299 { 299 {
300 local expl 300 local expl
301 declare -a features 301 declare -a features
302 302
303 features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}}) 303 features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}})
304 __git_command_successful || return 304 __git_command_successful || return
305 305
306 _wanted features expl 'feature' compadd $features 306 _wanted features expl 'feature' compadd $features
307 } 307 }
308 308
309 __git_remotes () { 309 __git_remotes () {
310 local expl gitdir remotes 310 local expl gitdir remotes
311 311
312 gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) 312 gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
313 __git_command_successful || return 313 __git_command_successful || return
314 314
315 remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]}) 315 remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
316 __git_command_successful || return 316 __git_command_successful || return
317 317
318 # TODO: Should combine the two instead of either or. 318 # TODO: Should combine the two instead of either or.
319 if (( $#remotes > 0 )); then 319 if (( $#remotes > 0 )); then
320 _wanted remotes expl remote compadd $* - $remotes 320 _wanted remotes expl remote compadd $* - $remotes
321 else 321 else
322 _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*" 322 _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
323 fi 323 fi
324 } 324 }
325 325
326 __git_flow_hotfix_list () 326 __git_flow_hotfix_list ()
327 { 327 {
328 local expl 328 local expl
329 declare -a hotfixes 329 declare -a hotfixes
330 330
331 hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}}) 331 hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}})
332 __git_command_successful || return 332 __git_command_successful || return
333 333
334 _wanted hotfixes expl 'hotfix' compadd $hotfixes 334 _wanted hotfixes expl 'hotfix' compadd $hotfixes
335 } 335 }
336 336
337 __git_branch_names () { 337 __git_branch_names () {
338 local expl 338 local expl
339 declare -a branch_names 339 declare -a branch_names
340 340
341 branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) 341 branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
342 __git_command_successful || return 342 __git_command_successful || return
343 343
344 _wanted branch-names expl branch-name compadd $* - $branch_names 344 _wanted branch-names expl branch-name compadd $* - $branch_names
345 } 345 }
346 346
347 __git_command_successful () { 347 __git_command_successful () {
348 if (( ${#pipestatus:#0} > 0 )); then 348 if (( ${#pipestatus:#0} > 0 )); then
349 _message 'not a git repository' 349 _message 'not a git repository'
350 return 1 350 return 1
351 fi 351 fi
352 return 0 352 return 0
353 } 353 }
354 354
355 zstyle ':completion:*:*:git:*' user-commands flow:'description for foo' 355 zstyle ':completion:*:*:git:*' user-commands flow:'description for foo'
356 356
plugins/git-hubflow/git-hubflow.plugin.zsh
1 #!zsh 1 #!zsh
2 # 2 #
3 # Installation 3 # Installation
4 # ------------ 4 # ------------
5 # 5 #
6 # To achieve git-hubflow completion nirvana: 6 # To achieve git-hubflow completion nirvana:
7 # 7 #
8 # 0. Update your zsh's git-completion module to the newest verion. 8 # 0. Update your zsh's git-completion module to the newest version.
9 # From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD 9 # From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD
10 # 10 #
11 # 1. Install this file. Either: 11 # 1. Install this file. Either:
12 # 12 #
13 # a. Place it in your .zshrc: 13 # a. Place it in your .zshrc:
14 # 14 #
15 # b. Or, copy it somewhere (e.g. ~/.git-hubflow-completion.zsh) and put the following line in 15 # b. Or, copy it somewhere (e.g. ~/.git-hubflow-completion.zsh) and put the following line in
16 # your .zshrc: 16 # your .zshrc:
17 # 17 #
18 # source ~/.git-hubflow-completion.zsh 18 # source ~/.git-hubflow-completion.zsh
19 # 19 #
20 # c. Or, use this file as a oh-my-zsh plugin. 20 # c. Or, use this file as an oh-my-zsh plugin.
21 # 21 #
22 22
23 _git-hf () 23 _git-hf ()
24 { 24 {
25 local curcontext="$curcontext" state line 25 local curcontext="$curcontext" state line
26 typeset -A opt_args 26 typeset -A opt_args
27 27
28 _arguments -C \ 28 _arguments -C \
29 ':command:->command' \ 29 ':command:->command' \
30 '*::options:->options' 30 '*::options:->options'
31 31
32 case $state in 32 case $state in
33 (command) 33 (command)
34 34
35 local -a subcommands 35 local -a subcommands
36 subcommands=( 36 subcommands=(
37 'init:Initialize a new git repo with support for the branching model.' 37 'init:Initialize a new git repo with support for the branching model.'
38 'feature:Manage your feature branches.' 38 'feature:Manage your feature branches.'
39 'release:Manage your release branches.' 39 'release:Manage your release branches.'
40 'hotfix:Manage your hotfix branches.' 40 'hotfix:Manage your hotfix branches.'
41 'support:Manage your support branches.' 41 'support:Manage your support branches.'
42 'update:Pull upstream changes down into your master and develop branches.' 42 'update:Pull upstream changes down into your master and develop branches.'
43 'version:Shows version information.' 43 'version:Shows version information.'
44 ) 44 )
45 _describe -t commands 'git hf' subcommands 45 _describe -t commands 'git hf' subcommands
46 ;; 46 ;;
47 47
48 (options) 48 (options)
49 case $line[1] in 49 case $line[1] in
50 50
51 (init) 51 (init)
52 _arguments \ 52 _arguments \
53 -f'[Force setting of gitflow branches, even if already configured]' 53 -f'[Force setting of gitflow branches, even if already configured]'
54 ;; 54 ;;
55 55
56 (version) 56 (version)
57 ;; 57 ;;
58 58
59 (hotfix) 59 (hotfix)
60 __git-hf-hotfix 60 __git-hf-hotfix
61 ;; 61 ;;
62 62
63 (release) 63 (release)
64 __git-hf-release 64 __git-hf-release
65 ;; 65 ;;
66 66
67 (feature) 67 (feature)
68 __git-hf-feature 68 __git-hf-feature
69 ;; 69 ;;
70 esac 70 esac
71 ;; 71 ;;
72 esac 72 esac
73 } 73 }
74 74
75 __git-hf-release () 75 __git-hf-release ()
76 { 76 {
77 local curcontext="$curcontext" state line 77 local curcontext="$curcontext" state line
78 typeset -A opt_args 78 typeset -A opt_args
79 79
80 _arguments -C \ 80 _arguments -C \
81 ':command:->command' \ 81 ':command:->command' \
82 '*::options:->options' 82 '*::options:->options'
83 83
84 case $state in 84 case $state in
85 (command) 85 (command)
86 86
87 local -a subcommands 87 local -a subcommands
88 subcommands=( 88 subcommands=(
89 'start:Start a new release branch.' 89 'start:Start a new release branch.'
90 'finish:Finish a release branch.' 90 'finish:Finish a release branch.'
91 'list:List all your release branches. (Alias to `git hf release`)' 91 'list:List all your release branches. (Alias to `git hf release`)'
92 'cancel:Cancel release' 92 'cancel:Cancel release'
93 'push:Push release to github' 93 'push:Push release to github'
94 'pull:Pull release from github' 94 'pull:Pull release from github'
95 'track:Track release' 95 'track:Track release'
96 ) 96 )
97 _describe -t commands 'git hf release' subcommands 97 _describe -t commands 'git hf release' subcommands
98 _arguments \ 98 _arguments \
99 -v'[Verbose (more) output]' 99 -v'[Verbose (more) output]'
100 ;; 100 ;;
101 101
102 (options) 102 (options)
103 case $line[1] in 103 case $line[1] in
104 104
105 (start) 105 (start)
106 _arguments \ 106 _arguments \
107 -F'[Fetch from origin before performing finish]'\ 107 -F'[Fetch from origin before performing finish]'\
108 ':version:__git_hf_version_list' 108 ':version:__git_hf_version_list'
109 ;; 109 ;;
110 110
111 (finish) 111 (finish)
112 _arguments \ 112 _arguments \
113 -F'[Fetch from origin before performing finish]' \ 113 -F'[Fetch from origin before performing finish]' \
114 -s'[Sign the release tag cryptographically]'\ 114 -s'[Sign the release tag cryptographically]'\
115 -u'[Use the given GPG-key for the digital signature (implies -s)]'\ 115 -u'[Use the given GPG-key for the digital signature (implies -s)]'\
116 -m'[Use the given tag message]'\ 116 -m'[Use the given tag message]'\
117 -p'[Push to $ORIGIN after performing finish]'\ 117 -p'[Push to $ORIGIN after performing finish]'\
118 -k'[Keep branch after performing finish]'\ 118 -k'[Keep branch after performing finish]'\
119 -n"[Don't tag this release]"\ 119 -n"[Don't tag this release]"\
120 ':version:__git_hf_version_list' 120 ':version:__git_hf_version_list'
121 ;; 121 ;;
122 122
123 *) 123 *)
124 _arguments \ 124 _arguments \
125 -v'[Verbose (more) output]' 125 -v'[Verbose (more) output]'
126 ;; 126 ;;
127 esac 127 esac
128 ;; 128 ;;
129 esac 129 esac
130 } 130 }
131 131
132 __git-hf-hotfix () 132 __git-hf-hotfix ()
133 { 133 {
134 local curcontext="$curcontext" state line 134 local curcontext="$curcontext" state line
135 typeset -A opt_args 135 typeset -A opt_args
136 136
137 _arguments -C \ 137 _arguments -C \
138 ':command:->command' \ 138 ':command:->command' \
139 '*::options:->options' 139 '*::options:->options'
140 140
141 case $state in 141 case $state in
142 (command) 142 (command)
143 143
144 local -a subcommands 144 local -a subcommands
145 subcommands=( 145 subcommands=(
146 'start:Start a new hotfix branch.' 146 'start:Start a new hotfix branch.'
147 'finish:Finish a hotfix branch.' 147 'finish:Finish a hotfix branch.'
148 'list:List all your hotfix branches. (Alias to `git hf hotfix`)' 148 'list:List all your hotfix branches. (Alias to `git hf hotfix`)'
149 'publish:Publish the hotfix branch.' 149 'publish:Publish the hotfix branch.'
150 'track:Track the hotfix branch.' 150 'track:Track the hotfix branch.'
151 'pull:Pull the hotfix from github.' 151 'pull:Pull the hotfix from github.'
152 'push:Push the hotfix to github.' 152 'push:Push the hotfix to github.'
153 'cancel:Cancel the hotfix.' 153 'cancel:Cancel the hotfix.'
154 ) 154 )
155 _describe -t commands 'git hf hotfix' subcommands 155 _describe -t commands 'git hf hotfix' subcommands
156 _arguments \ 156 _arguments \
157 -v'[Verbose (more) output]' 157 -v'[Verbose (more) output]'
158 ;; 158 ;;
159 159
160 (options) 160 (options)
161 case $line[1] in 161 case $line[1] in
162 162
163 (start) 163 (start)
164 _arguments \ 164 _arguments \
165 -F'[Fetch from origin before performing finish]'\ 165 -F'[Fetch from origin before performing finish]'\
166 ':hotfix:__git_hf_version_list'\ 166 ':hotfix:__git_hf_version_list'\
167 ':branch-name:__git_branch_names' 167 ':branch-name:__git_branch_names'
168 ;; 168 ;;
169 169
170 (finish) 170 (finish)
171 _arguments \ 171 _arguments \
172 -F'[Fetch from origin before performing finish]' \ 172 -F'[Fetch from origin before performing finish]' \
173 -s'[Sign the release tag cryptographically]'\ 173 -s'[Sign the release tag cryptographically]'\
174 -u'[Use the given GPG-key for the digital signature (implies -s)]'\ 174 -u'[Use the given GPG-key for the digital signature (implies -s)]'\
175 -m'[Use the given tag message]'\ 175 -m'[Use the given tag message]'\
176 -p'[Push to $ORIGIN after performing finish]'\ 176 -p'[Push to $ORIGIN after performing finish]'\
177 -k'[Keep branch after performing finish]'\ 177 -k'[Keep branch after performing finish]'\
178 -n"[Don't tag this release]"\ 178 -n"[Don't tag this release]"\
179 ':hotfix:__git_hf_hotfix_list' 179 ':hotfix:__git_hf_hotfix_list'
180 ;; 180 ;;
181 181
182 *) 182 *)
183 _arguments \ 183 _arguments \
184 -v'[Verbose (more) output]' 184 -v'[Verbose (more) output]'
185 ;; 185 ;;
186 esac 186 esac
187 ;; 187 ;;
188 esac 188 esac
189 } 189 }
190 190
191 __git-hf-feature () 191 __git-hf-feature ()
192 { 192 {
193 local curcontext="$curcontext" state line 193 local curcontext="$curcontext" state line
194 typeset -A opt_args 194 typeset -A opt_args
195 195
196 _arguments -C \ 196 _arguments -C \
197 ':command:->command' \ 197 ':command:->command' \
198 '*::options:->options' 198 '*::options:->options'
199 199
200 case $state in 200 case $state in
201 (command) 201 (command)
202 202
203 local -a subcommands 203 local -a subcommands
204 subcommands=( 204 subcommands=(
205 'list:List all your feature branches. (Alias to `git hf feature`)' 205 'list:List all your feature branches. (Alias to `git hf feature`)'
206 'start:Start a new feature branch' 206 'start:Start a new feature branch'
207 'finish:Finish a feature branch' 207 'finish:Finish a feature branch'
208 'submit:submit' 208 'submit:submit'
209 'track:track' 209 'track:track'
210 'diff:Diff' 210 'diff:Diff'
211 'rebase:Rebase feature branch against develop' 211 'rebase:Rebase feature branch against develop'
212 'checkout:Checkout feature' 212 'checkout:Checkout feature'
213 'pull:Pull feature branch from github' 213 'pull:Pull feature branch from github'
214 'push:Push feature branch to github' 214 'push:Push feature branch to github'
215 'cancel:Cancel feature' 215 'cancel:Cancel feature'
216 ) 216 )
217 _describe -t commands 'git hf feature' subcommands 217 _describe -t commands 'git hf feature' subcommands
218 _arguments \ 218 _arguments \
219 -v'[Verbose (more) output]' 219 -v'[Verbose (more) output]'
220 ;; 220 ;;
221 221
222 (options) 222 (options)
223 case $line[1] in 223 case $line[1] in
224 224
225 (start) 225 (start)
226 _arguments \ 226 _arguments \
227 -F'[Fetch from origin before performing finish]'\ 227 -F'[Fetch from origin before performing finish]'\
228 ':feature:__git_hf_feature_list'\ 228 ':feature:__git_hf_feature_list'\
229 ':branch-name:__git_branch_names' 229 ':branch-name:__git_branch_names'
230 ;; 230 ;;
231 231
232 (finish) 232 (finish)
233 _arguments \ 233 _arguments \
234 -F'[Fetch from origin before performing finish]' \ 234 -F'[Fetch from origin before performing finish]' \
235 -r'[Rebase instead of merge]'\ 235 -r'[Rebase instead of merge]'\
236 ':feature:__git_hf_feature_list' 236 ':feature:__git_hf_feature_list'
237 ;; 237 ;;
238 238
239 (publish) 239 (publish)
240 _arguments \ 240 _arguments \
241 ':feature:__git_hf_feature_list'\ 241 ':feature:__git_hf_feature_list'\
242 ;; 242 ;;
243 243
244 (track) 244 (track)
245 _arguments \ 245 _arguments \
246 ':feature:__git_hf_feature_list'\ 246 ':feature:__git_hf_feature_list'\
247 ;; 247 ;;
248 248
249 (diff) 249 (diff)
250 _arguments \ 250 _arguments \
251 ':branch:__git_branch_names'\ 251 ':branch:__git_branch_names'\
252 ;; 252 ;;
253 253
254 (rebase) 254 (rebase)
255 _arguments \ 255 _arguments \
256 -i'[Do an interactive rebase]' \ 256 -i'[Do an interactive rebase]' \
257 ':branch:__git_branch_names' 257 ':branch:__git_branch_names'
258 ;; 258 ;;
259 259
260 (checkout) 260 (checkout)
261 _arguments \ 261 _arguments \
262 ':branch:__git_hf_feature_list'\ 262 ':branch:__git_hf_feature_list'\
263 ;; 263 ;;
264 264
265 (pull) 265 (pull)
266 _arguments \ 266 _arguments \
267 ':remote:__git_remotes'\ 267 ':remote:__git_remotes'\
268 ':branch:__git_branch_names' 268 ':branch:__git_branch_names'
269 ;; 269 ;;
270 270
271 *) 271 *)
272 _arguments \ 272 _arguments \
273 -v'[Verbose (more) output]' 273 -v'[Verbose (more) output]'
274 ;; 274 ;;
275 esac 275 esac
276 ;; 276 ;;
277 esac 277 esac
278 } 278 }
279 279
280 __git_hf_version_list () 280 __git_hf_version_list ()
281 { 281 {
282 local expl 282 local expl
283 declare -a versions 283 declare -a versions
284 284
285 versions=(${${(f)"$(_call_program versions git hf release list 2> /dev/null | tr -d ' |*')"}}) 285 versions=(${${(f)"$(_call_program versions git hf release list 2> /dev/null | tr -d ' |*')"}})
286 __git_command_successful || return 286 __git_command_successful || return
287 287
288 _wanted versions expl 'version' compadd $versions 288 _wanted versions expl 'version' compadd $versions
289 } 289 }
290 290
291 __git_hf_feature_list () 291 __git_hf_feature_list ()
292 { 292 {
293 local expl 293 local expl
294 declare -a features 294 declare -a features
295 295
296 features=(${${(f)"$(_call_program features git hf feature list 2> /dev/null | tr -d ' |*')"}}) 296 features=(${${(f)"$(_call_program features git hf feature list 2> /dev/null | tr -d ' |*')"}})
297 __git_command_successful || return 297 __git_command_successful || return
298 298
299 _wanted features expl 'feature' compadd $features 299 _wanted features expl 'feature' compadd $features
300 } 300 }
301 301
302 __git_remotes () { 302 __git_remotes () {
303 local expl gitdir remotes 303 local expl gitdir remotes
304 304
305 gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) 305 gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
306 __git_command_successful || return 306 __git_command_successful || return
307 307
308 remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]}) 308 remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
309 __git_command_successful || return 309 __git_command_successful || return
310 310
311 # TODO: Should combine the two instead of either or. 311 # TODO: Should combine the two instead of either or.
312 if (( $#remotes > 0 )); then 312 if (( $#remotes > 0 )); then
313 _wanted remotes expl remote compadd $* - $remotes 313 _wanted remotes expl remote compadd $* - $remotes
314 else 314 else
315 _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*" 315 _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
316 fi 316 fi
317 } 317 }
318 318
319 __git_hf_hotfix_list () 319 __git_hf_hotfix_list ()
320 { 320 {
321 local expl 321 local expl
322 declare -a hotfixes 322 declare -a hotfixes
323 323
324 hotfixes=(${${(f)"$(_call_program hotfixes git hf hotfix list 2> /dev/null | tr -d ' |*')"}}) 324 hotfixes=(${${(f)"$(_call_program hotfixes git hf hotfix list 2> /dev/null | tr -d ' |*')"}})
325 __git_command_successful || return 325 __git_command_successful || return
326 326
327 _wanted hotfixes expl 'hotfix' compadd $hotfixes 327 _wanted hotfixes expl 'hotfix' compadd $hotfixes
328 } 328 }
329 329
330 __git_branch_names () { 330 __git_branch_names () {
331 local expl 331 local expl
332 declare -a branch_names 332 declare -a branch_names
333 333
334 branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) 334 branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
335 __git_command_successful || return 335 __git_command_successful || return
336 336
337 _wanted branch-names expl branch-name compadd $* - $branch_names 337 _wanted branch-names expl branch-name compadd $* - $branch_names
338 } 338 }
339 339
340 __git_command_successful () { 340 __git_command_successful () {
341 if (( ${#pipestatus:#0} > 0 )); then 341 if (( ${#pipestatus:#0} > 0 )); then
342 _message 'not a git repository' 342 _message 'not a git repository'
343 return 1 343 return 1
344 fi 344 fi
345 return 0 345 return 0
346 } 346 }
347 347
348 zstyle ':completion:*:*:git:*' user-commands flow:'description for foo' 348 zstyle ':completion:*:*:git:*' user-commands flow:'description for foo'
349 349
plugins/git/git.plugin.zsh
1 # Aliases 1 # Aliases
2 alias g='git' 2 alias g='git'
3 compdef g=git 3 compdef g=git
4 alias gst='git status' 4 alias gst='git status'
5 compdef _git gst=git-status 5 compdef _git gst=git-status
6 alias gd='git diff' 6 alias gd='git diff'
7 compdef _git gd=git-diff 7 compdef _git gd=git-diff
8 alias gdc='git diff --cached' 8 alias gdc='git diff --cached'
9 compdef _git gdc=git-diff 9 compdef _git gdc=git-diff
10 alias gdt='git diff-tree --no-commit-id --name-only -r' 10 alias gdt='git diff-tree --no-commit-id --name-only -r'
11 compdef _git gdc=git diff-tree --no-commit-id --name-only -r 11 compdef _git gdc=git diff-tree --no-commit-id --name-only -r
12 alias gl='git pull' 12 alias gl='git pull'
13 compdef _git gl=git-pull 13 compdef _git gl=git-pull
14 alias gup='git pull --rebase' 14 alias gup='git pull --rebase'
15 compdef _git gup=git-fetch 15 compdef _git gup=git-fetch
16 alias gp='git push' 16 alias gp='git push'
17 compdef _git gp=git-push 17 compdef _git gp=git-push
18 alias gd='git diff' 18 alias gd='git diff'
19 gdv() { git diff -w "$@" | view - } 19 gdv() { git diff -w "$@" | view - }
20 compdef _git gdv=git-diff 20 compdef _git gdv=git-diff
21 alias gdt='git difftool' 21 alias gdt='git difftool'
22 alias gc='git commit -v' 22 alias gc='git commit -v'
23 compdef _git gc=git-commit 23 compdef _git gc=git-commit
24 alias gc!='git commit -v --amend' 24 alias gc!='git commit -v --amend'
25 compdef _git gc!=git-commit 25 compdef _git gc!=git-commit
26 alias gca='git commit -v -a' 26 alias gca='git commit -v -a'
27 compdef _git gc=git-commit 27 compdef _git gc=git-commit
28 alias gca!='git commit -v -a --amend' 28 alias gca!='git commit -v -a --amend'
29 compdef _git gca!=git-commit 29 compdef _git gca!=git-commit
30 alias gcmsg='git commit -m' 30 alias gcmsg='git commit -m'
31 compdef _git gcmsg=git-commit 31 compdef _git gcmsg=git-commit
32 alias gco='git checkout' 32 alias gco='git checkout'
33 compdef _git gco=git-checkout 33 compdef _git gco=git-checkout
34 alias gcm='git checkout master' 34 alias gcm='git checkout master'
35 alias gr='git remote' 35 alias gr='git remote'
36 compdef _git gr=git-remote 36 compdef _git gr=git-remote
37 alias grv='git remote -v' 37 alias grv='git remote -v'
38 compdef _git grv=git-remote 38 compdef _git grv=git-remote
39 alias grmv='git remote rename' 39 alias grmv='git remote rename'
40 compdef _git grmv=git-remote 40 compdef _git grmv=git-remote
41 alias grrm='git remote remove' 41 alias grrm='git remote remove'
42 compdef _git grrm=git-remote 42 compdef _git grrm=git-remote
43 alias grset='git remote set-url' 43 alias grset='git remote set-url'
44 compdef _git grset=git-remote 44 compdef _git grset=git-remote
45 alias grup='git remote update' 45 alias grup='git remote update'
46 compdef _git grset=git-remote 46 compdef _git grset=git-remote
47 alias grbi='git rebase -i' 47 alias grbi='git rebase -i'
48 compdef _git grbi=git-rebase 48 compdef _git grbi=git-rebase
49 alias grbc='git rebase --continue' 49 alias grbc='git rebase --continue'
50 compdef _git grbc=git-rebase 50 compdef _git grbc=git-rebase
51 alias grba='git rebase --abort' 51 alias grba='git rebase --abort'
52 compdef _git grba=git-rebase 52 compdef _git grba=git-rebase
53 alias gb='git branch' 53 alias gb='git branch'
54 compdef _git gb=git-branch 54 compdef _git gb=git-branch
55 alias gba='git branch -a' 55 alias gba='git branch -a'
56 compdef _git gba=git-branch 56 compdef _git gba=git-branch
57 alias gbr='git branch --remote' 57 alias gbr='git branch --remote'
58 alias gcount='git shortlog -sn' 58 alias gcount='git shortlog -sn'
59 compdef gcount=git 59 compdef gcount=git
60 alias gcl='git config --list' 60 alias gcl='git config --list'
61 alias gcp='git cherry-pick' 61 alias gcp='git cherry-pick'
62 compdef _git gcp=git-cherry-pick 62 compdef _git gcp=git-cherry-pick
63 alias glg='git log --stat --max-count=10' 63 alias glg='git log --stat --max-count=10'
64 compdef _git glg=git-log 64 compdef _git glg=git-log
65 alias glgg='git log --graph --max-count=10' 65 alias glgg='git log --graph --max-count=10'
66 compdef _git glgg=git-log 66 compdef _git glgg=git-log
67 alias glgga='git log --graph --decorate --all' 67 alias glgga='git log --graph --decorate --all'
68 compdef _git glgga=git-log 68 compdef _git glgga=git-log
69 alias glo='git log --oneline --decorate --color' 69 alias glo='git log --oneline --decorate --color'
70 compdef _git glo=git-log 70 compdef _git glo=git-log
71 alias glog='git log --oneline --decorate --color --graph' 71 alias glog='git log --oneline --decorate --color --graph'
72 compdef _git glog=git-log 72 compdef _git glog=git-log
73 alias gss='git status -s' 73 alias gss='git status -s'
74 compdef _git gss=git-status 74 compdef _git gss=git-status
75 alias ga='git add' 75 alias ga='git add'
76 compdef _git ga=git-add 76 compdef _git ga=git-add
77 alias gap='git add --patch' 77 alias gap='git add --patch'
78 alias gaa='git add --all'
78 alias gm='git merge' 79 alias gm='git merge'
79 compdef _git gm=git-merge 80 compdef _git gm=git-merge
80 alias grh='git reset HEAD' 81 alias grh='git reset HEAD'
81 alias grhh='git reset HEAD --hard' 82 alias grhh='git reset HEAD --hard'
82 alias gclean='git reset --hard && git clean -dfx' 83 alias gclean='git reset --hard && git clean -dfx'
83 alias gwc='git whatchanged -p --abbrev-commit --pretty=medium' 84 alias gwc='git whatchanged -p --abbrev-commit --pretty=medium'
84 85
85 # Sign and verify commits with GPG 86 # Sign and verify commits with GPG
86 alias gcs='git commit -S' 87 alias gcs='git commit -S'
87 compdef _git gcs=git-commit 88 compdef _git gcs=git-commit
88 alias gsps='git show --pretty=short --show-signature' 89 alias gsps='git show --pretty=short --show-signature'
89 compdef _git gsps=git-show 90 compdef _git gsps=git-show
90 91
91 # Sign and verify tags with GPG 92 # Sign and verify tags with GPG
92 alias gts='git tag -s' 93 alias gts='git tag -s'
93 compdef _git gts=git-tag 94 compdef _git gts=git-tag
94 alias gvt='git verify-tag' 95 alias gvt='git verify-tag'
95 compdef _git gvt=git verify-tag 96 compdef _git gvt=git verify-tag
96 97
97 #remove the gf alias 98 #remove the gf alias
98 #alias gf='git ls-files | grep' 99 #alias gf='git ls-files | grep'
99 100
100 alias gpoat='git push origin --all && git push origin --tags' 101 alias gpoat='git push origin --all && git push origin --tags'
101 alias gmt='git mergetool --no-prompt' 102 alias gmt='git mergetool --no-prompt'
102 compdef _git gm=git-mergetool 103 compdef _git gmt=git-mergetool
103 104
104 alias gg='git gui citool' 105 alias gg='git gui citool'
105 alias gga='git gui citool --amend' 106 alias gga='git gui citool --amend'
106 alias gk='gitk --all --branches' 107 alias gk='gitk --all --branches'
107 108
108 alias gsts='git stash show --text' 109 alias gsts='git stash show --text'
109 alias gsta='git stash' 110 alias gsta='git stash'
110 alias gstp='git stash pop' 111 alias gstp='git stash pop'
111 alias gstd='git stash drop' 112 alias gstd='git stash drop'
112 113
113 # Will cd into the top of the current repository 114 # Will cd into the top of the current repository
114 # or submodule. 115 # or submodule.
115 alias grt='cd $(git rev-parse --show-toplevel || echo ".")' 116 alias grt='cd $(git rev-parse --show-toplevel || echo ".")'
116 117
117 # Git and svn mix 118 # Git and svn mix
118 alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' 119 alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
119 compdef git-svn-dcommit-push=git 120 compdef git-svn-dcommit-push=git
120 121
121 alias gsr='git svn rebase' 122 alias gsr='git svn rebase'
122 alias gsd='git svn dcommit' 123 alias gsd='git svn dcommit'
123 # 124 #
124 # Will return the current branch name 125 # Will return the current branch name
125 # Usage example: git pull origin $(current_branch) 126 # Usage example: git pull origin $(current_branch)
126 # 127 #
127 function current_branch() { 128 function current_branch() {
128 ref=$(git symbolic-ref HEAD 2> /dev/null) || \ 129 ref=$(git symbolic-ref HEAD 2> /dev/null) || \
129 ref=$(git rev-parse --short HEAD 2> /dev/null) || return 130 ref=$(git rev-parse --short HEAD 2> /dev/null) || return
130 echo ${ref#refs/heads/} 131 echo ${ref#refs/heads/}
131 } 132 }
132 133
133 function current_repository() { 134 function current_repository() {
134 ref=$(git symbolic-ref HEAD 2> /dev/null) || \ 135 ref=$(git symbolic-ref HEAD 2> /dev/null) || \
135 ref=$(git rev-parse --short HEAD 2> /dev/null) || return 136 ref=$(git rev-parse --short HEAD 2> /dev/null) || return
136 echo $(git remote -v | cut -d':' -f 2) 137 echo $(git remote -v | cut -d':' -f 2)
137 } 138 }
138 139
139 # these aliases take advantage of the previous function 140 # these aliases take advantage of the previous function
140 alias ggpull='git pull origin $(current_branch)' 141 alias ggpull='git pull origin $(current_branch)'
141 compdef ggpull=git 142 compdef ggpull=git
142 alias ggpur='git pull --rebase origin $(current_branch)' 143 alias ggpur='git pull --rebase origin $(current_branch)'
143 compdef ggpur=git 144 compdef ggpur=git
144 alias ggpush='git push origin $(current_branch)' 145 alias ggpush='git push origin $(current_branch)'
145 compdef ggpush=git 146 compdef ggpush=git
146 alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' 147 alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
147 compdef ggpnp=git 148 compdef ggpnp=git
148 149
149 # Pretty log messages 150 # Pretty log messages
150 function _git_log_prettily(){ 151 function _git_log_prettily(){
151 if ! [ -z $1 ]; then 152 if ! [ -z $1 ]; then
152 git log --pretty=$1 153 git log --pretty=$1
153 fi 154 fi
154 } 155 }
155 alias glp="_git_log_prettily" 156 alias glp="_git_log_prettily"
156 compdef _git glp=git-log 157 compdef _git glp=git-log
157 158
158 # Work In Progress (wip) 159 # Work In Progress (wip)
159 # These features allow to pause a branch development and switch to another one (wip) 160 # These features allow to pause a branch development and switch to another one (wip)
160 # When you want to go back to work, just unwip it 161 # When you want to go back to work, just unwip it
161 # 162 #
162 # This function return a warning if the current branch is a wip 163 # This function return a warning if the current branch is a wip
163 function work_in_progress() { 164 function work_in_progress() {
164 if $(git log -n 1 2>/dev/null | grep -q -c "\-\-wip\-\-"); then 165 if $(git log -n 1 2>/dev/null | grep -q -c "\-\-wip\-\-"); then
165 echo "WIP!!" 166 echo "WIP!!"
166 fi 167 fi
167 } 168 }
168 # these alias commit and uncomit wip branches 169 # these alias commit and uncomit wip branches
169 alias gwip='git add -A; git ls-files --deleted -z | xargs -r0 git rm; git commit -m "--wip--"' 170 alias gwip='git add -A; git ls-files --deleted -z | xargs -r0 git rm; git commit -m "--wip--"'
170 alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1' 171 alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
171 172
172 # these alias ignore changes to file 173 # these alias ignore changes to file
173 alias gignore='git update-index --assume-unchanged' 174 alias gignore='git update-index --assume-unchanged'
174 alias gunignore='git update-index --no-assume-unchanged' 175 alias gunignore='git update-index --no-assume-unchanged'
175 # list temporarily ignored files 176 # list temporarily ignored files
176 alias gignored='git ls-files -v | grep "^[[:lower:]]"' 177 alias gignored='git ls-files -v | grep "^[[:lower:]]"'
177
178
179
plugins/golang/golang.plugin.zsh
1 # install in /etc/zsh/zshrc or your personal .zshrc 1 # install in /etc/zsh/zshrc or your personal .zshrc
2 2
3 # gc 3 # gc
4 prefixes=(5 6 8) 4 prefixes=(5 6 8)
5 for p in $prefixes; do 5 for p in $prefixes; do
6 compctl -g "*.${p}" ${p}l 6 compctl -g "*.${p}" ${p}l
7 compctl -g "*.go" ${p}g 7 compctl -g "*.go" ${p}g
8 done 8 done
9 9
10 # standard go tools 10 # standard go tools
11 compctl -g "*.go" gofmt 11 compctl -g "*.go" gofmt
12 12
13 # gccgo 13 # gccgo
14 compctl -g "*.go" gccgo 14 compctl -g "*.go" gccgo
15 15
16 # go tool 16 # go tool
17 __go_tool_complete() { 17 __go_tool_complete() {
18 typeset -a commands build_flags 18 typeset -a commands build_flags
19 commands+=( 19 commands+=(
20 'build[compile packages and dependencies]' 20 'build[compile packages and dependencies]'
21 'clean[remove object files]' 21 'clean[remove object files]'
22 'doc[run godoc on package sources]' 22 'doc[run godoc on package sources]'
23 'env[print Go environment information]' 23 'env[print Go environment information]'
24 'fix[run go tool fix on packages]' 24 'fix[run go tool fix on packages]'
25 'fmt[run gofmt on package sources]' 25 'fmt[run gofmt on package sources]'
26 'generate[generate Go files by processing source]'
26 'get[download and install packages and dependencies]' 27 'get[download and install packages and dependencies]'
27 'help[display help]' 28 'help[display help]'
28 'install[compile and install packages and dependencies]' 29 'install[compile and install packages and dependencies]'
29 'list[list packages]' 30 'list[list packages]'
30 'run[compile and run Go program]' 31 'run[compile and run Go program]'
31 'test[test packages]' 32 'test[test packages]'
32 'tool[run specified go tool]' 33 'tool[run specified go tool]'
33 'version[print Go version]' 34 'version[print Go version]'
34 'vet[run go tool vet on packages]' 35 'vet[run go tool vet on packages]'
35 ) 36 )
36 if (( CURRENT == 2 )); then 37 if (( CURRENT == 2 )); then
37 # explain go commands 38 # explain go commands
38 _values 'go tool commands' ${commands[@]} 39 _values 'go tool commands' ${commands[@]}
39 return 40 return
40 fi 41 fi
41 build_flags=( 42 build_flags=(
42 '-a[force reinstallation of packages that are already up-to-date]' 43 '-a[force reinstallation of packages that are already up-to-date]'
43 '-n[print the commands but do not run them]' 44 '-n[print the commands but do not run them]'
44 '-p[number of parallel builds]:number' 45 '-p[number of parallel builds]:number'
45 '-race[enable data race detection]' 46 '-race[enable data race detection]'
46 '-x[print the commands]' 47 '-x[print the commands]'
47 '-work[print temporary directory name and keep it]' 48 '-work[print temporary directory name and keep it]'
48 '-ccflags[flags for 5c/6c/8c]:flags' 49 '-ccflags[flags for 5c/6c/8c]:flags'
49 '-gcflags[flags for 5g/6g/8g]:flags' 50 '-gcflags[flags for 5g/6g/8g]:flags'
50 '-ldflags[flags for 5l/6l/8l]:flags' 51 '-ldflags[flags for 5l/6l/8l]:flags'
51 '-gccgoflags[flags for gccgo]:flags' 52 '-gccgoflags[flags for gccgo]:flags'
52 '-compiler[name of compiler to use]:name' 53 '-compiler[name of compiler to use]:name'
53 '-installsuffix[suffix to add to package directory]:suffix' 54 '-installsuffix[suffix to add to package directory]:suffix'
54 '-tags[list of build tags to consider satisfied]:tags' 55 '-tags[list of build tags to consider satisfied]:tags'
55 ) 56 )
56 __go_list() { 57 __go_list() {
57 local expl importpaths 58 local expl importpaths
58 declare -a importpaths 59 declare -a importpaths
59 importpaths=($(go list ${words[$CURRENT]}... 2>/dev/null)) 60 importpaths=($(go list ${words[$CURRENT]}... 2>/dev/null))
60 _wanted importpaths expl 'import paths' compadd "$@" - "${importpaths[@]}" 61 _wanted importpaths expl 'import paths' compadd "$@" - "${importpaths[@]}"
61 } 62 }
62 case ${words[2]} in 63 case ${words[2]} in
63 clean|doc) 64 clean|doc)
64 _arguments -s -w : '*:importpaths:__go_list' 65 _arguments -s -w : '*:importpaths:__go_list'
65 ;; 66 ;;
66 fix|fmt|list|vet) 67 fix|fmt|list|vet)
67 _alternative ':importpaths:__go_list' ':files:_path_files -g "*.go"' 68 _alternative ':importpaths:__go_list' ':files:_path_files -g "*.go"'
68 ;; 69 ;;
69 install) 70 install)
70 _arguments -s -w : ${build_flags[@]} \ 71 _arguments -s -w : ${build_flags[@]} \
71 "-v[show package names]" \ 72 "-v[show package names]" \
72 '*:importpaths:__go_list' 73 '*:importpaths:__go_list'
73 ;; 74 ;;
74 get) 75 get)
75 _arguments -s -w : \ 76 _arguments -s -w : \
76 ${build_flags[@]} 77 ${build_flags[@]}
77 ;; 78 ;;
78 build) 79 build)
79 _arguments -s -w : \ 80 _arguments -s -w : \
80 ${build_flags[@]} \ 81 ${build_flags[@]} \
81 "-v[show package names]" \ 82 "-v[show package names]" \
82 "-o[output file]:file:_files" \ 83 "-o[output file]:file:_files" \
83 "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }" 84 "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
84 ;; 85 ;;
85 test) 86 test)
86 _arguments -s -w : \ 87 _arguments -s -w : \
87 ${build_flags[@]} \ 88 ${build_flags[@]} \
88 "-c[do not run, compile the test binary]" \ 89 "-c[do not run, compile the test binary]" \
89 "-i[do not run, install dependencies]" \ 90 "-i[do not run, install dependencies]" \
90 "-v[print test output]" \ 91 "-v[print test output]" \
91 "-x[print the commands]" \ 92 "-x[print the commands]" \
92 "-short[use short mode]" \ 93 "-short[use short mode]" \
93 "-parallel[number of parallel tests]:number" \ 94 "-parallel[number of parallel tests]:number" \
94 "-cpu[values of GOMAXPROCS to use]:number list" \ 95 "-cpu[values of GOMAXPROCS to use]:number list" \
95 "-run[run tests and examples matching regexp]:regexp" \ 96 "-run[run tests and examples matching regexp]:regexp" \
96 "-bench[run benchmarks matching regexp]:regexp" \ 97 "-bench[run benchmarks matching regexp]:regexp" \
97 "-benchmem[print memory allocation stats]" \ 98 "-benchmem[print memory allocation stats]" \
98 "-benchtime[run each benchmark until taking this long]:duration" \ 99 "-benchtime[run each benchmark until taking this long]:duration" \
99 "-blockprofile[write goroutine blocking profile to file]:file" \ 100 "-blockprofile[write goroutine blocking profile to file]:file" \
100 "-blockprofilerate[set sampling rate of goroutine blocking profile]:number" \ 101 "-blockprofilerate[set sampling rate of goroutine blocking profile]:number" \
101 "-timeout[kill test after that duration]:duration" \ 102 "-timeout[kill test after that duration]:duration" \
102 "-cpuprofile[write CPU profile to file]:file:_files" \ 103 "-cpuprofile[write CPU profile to file]:file:_files" \
103 "-memprofile[write heap profile to file]:file:_files" \ 104 "-memprofile[write heap profile to file]:file:_files" \
104 "-memprofilerate[set heap profiling rate]:number" \ 105 "-memprofilerate[set heap profiling rate]:number" \
105 "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }" 106 "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
106 ;; 107 ;;
107 help) 108 help)
108 _values "${commands[@]}" \ 109 _values "${commands[@]}" \
109 'gopath[GOPATH environment variable]' \ 110 'gopath[GOPATH environment variable]' \
110 'packages[description of package lists]' \ 111 'packages[description of package lists]' \
111 'remote[remote import path syntax]' \ 112 'remote[remote import path syntax]' \
112 'testflag[description of testing flags]' \ 113 'testflag[description of testing flags]' \
113 'testfunc[description of testing functions]' 114 'testfunc[description of testing functions]'
114 ;; 115 ;;
115 run) 116 run)
116 _arguments -s -w : \ 117 _arguments -s -w : \
117 ${build_flags[@]} \ 118 ${build_flags[@]} \
118 '*:file:_path_files -g "*.go"' 119 '*:file:_path_files -g "*.go"'
119 ;; 120 ;;
120 tool) 121 tool)
121 if (( CURRENT == 3 )); then 122 if (( CURRENT == 3 )); then
122 _values "go tool" $(go tool) 123 _values "go tool" $(go tool)
123 return 124 return
124 fi 125 fi
125 case ${words[3]} in 126 case ${words[3]} in
126 [568]g) 127 [568]g)
127 _arguments -s -w : \ 128 _arguments -s -w : \
128 '-I[search for packages in DIR]:includes:_path_files -/' \ 129 '-I[search for packages in DIR]:includes:_path_files -/' \
129 '-L[show full path in file:line prints]' \ 130 '-L[show full path in file:line prints]' \
130 '-S[print the assembly language]' \ 131 '-S[print the assembly language]' \
131 '-V[print the compiler version]' \ 132 '-V[print the compiler version]' \
132 '-e[no limit on number of errors printed]' \ 133 '-e[no limit on number of errors printed]' \
133 '-h[panic on an error]' \ 134 '-h[panic on an error]' \
134 '-l[disable inlining]' \ 135 '-l[disable inlining]' \
135 '-m[print optimization decisions]' \ 136 '-m[print optimization decisions]' \
136 '-o[file specify output file]:file' \ 137 '-o[file specify output file]:file' \
137 '-p[assumed import path for this code]:importpath' \ 138 '-p[assumed import path for this code]:importpath' \
138 '-u[disable package unsafe]' \ 139 '-u[disable package unsafe]' \
139 "*:file:_files -g '*.go'" 140 "*:file:_files -g '*.go'"
140 ;; 141 ;;
141 [568]l) 142 [568]l)
142 local O=${words[3]%l} 143 local O=${words[3]%l}
143 _arguments -s -w : \ 144 _arguments -s -w : \
144 '-o[file specify output file]:file' \ 145 '-o[file specify output file]:file' \
145 '-L[search for packages in DIR]:includes:_path_files -/' \ 146 '-L[search for packages in DIR]:includes:_path_files -/' \
146 "*:file:_files -g '*.[ao$O]'" 147 "*:file:_files -g '*.[ao$O]'"
147 ;; 148 ;;
148 dist) 149 dist)
149 _values "dist tool" banner bootstrap clean env install version 150 _values "dist tool" banner bootstrap clean env install version
150 ;; 151 ;;
151 *) 152 *)
152 # use files by default 153 # use files by default
153 _files 154 _files
154 ;; 155 ;;
155 esac 156 esac
156 ;; 157 ;;
157 esac 158 esac
158 } 159 }
159 160
160 compdef __go_tool_complete go 161 compdef __go_tool_complete go
161 162
162 # aliases 163 # aliases
163 alias gfa='go fmt . ./...' 164 alias gfa='go fmt . ./...'
164 165
plugins/grunt/grunt.plugin.zsh
File was created 1 #compdef grunt
2 #autoload
3 # -----------------------------------------------------------------------------
4 # _grunt
5 #
6 # Completion script for grunt.
7 # - https://github.com/gruntjs/grunt
8 # - https://github.com/gruntjs/grunt-cli
9 #
10 # -----------------------------------------------------------------------------
11 #
12 # Version : 0.1.2
13 # Author : Yonchu <yuyuchu3333@gmail.com>
14 # License : MIT License
15 # Repository : https://github.com/yonchu/grunt-zsh-completion
16 # Last Change : 20 Aug 2014.
17 #
18 # Copyright (c) 2013 Yonchu.
19 #
20 # -----------------------------------------------------------------------------
21 # USAGE
22 # -----
23 #
24 # Enable caching:
25 #
26 # If you want to use the cache, set the followings in your .zshrc:
27 #
28 # zstyle ':completion:*' use-cache yes
29 #
30 #
31 # Settings:
32 #
33 # - Show grunt file path:
34 # zstyle ':completion::complete:grunt::options:' show_grunt_path yes
35 #
36 # - Cache expiration days (default: 7):
37 # zstyle ':completion::complete:grunt::options:' expire 1
38 #
39 # - Not update options cache if target gruntfile is changed.
40 # zstyle ':completion::complete:grunt::options:' no_update_options yes
41 #
42 # Note that if you change the zstyle settings,
43 # you should delete the cache file and restart zsh.
44 #
45 # $ rm ~/.zcompcache/grunt
46 # $ exec zsh
47 #
48 # -----------------------------------------------------------------------------
49
50 function __grunt() {
51 local curcontext="$curcontext" update_policy state
52 local show_grunt_path update_msg gruntfile opts tasks
53
54 # Setup cache-policy.
55 zstyle -s ":completion:${curcontext}:" cache-policy update_policy
56 if [[ -z $update_policy ]]; then
57 zstyle ":completion:${curcontext}:" cache-policy __grunt_caching_policy
58 fi
59
60 # Check show_path option.
61 zstyle -b ":completion:${curcontext}:options:" show_grunt_path show_grunt_path
62
63 # Get current gruntfile.
64 gruntfile=$(__grunt_get_gruntfile)
65
66 # Initialize opts and tasks.
67 opts=()
68 tasks=()
69
70 # Add help options.
71 opts+=('(- 1 *)'{-h,--help}'[Display this help text.]')
72
73 ## Complete without gruntfile.
74 if [[ ! -f $gruntfile ]]; then
75 _arguments "${opts[@]}"
76 return
77 fi
78
79 ## Complete with gruntfile.
80 # Retrieve cache.
81 if ! __grunt_update_cache "$gruntfile"; then
82 update_msg=' (cache updated)'
83 fi
84
85 # Make optioins completion.
86 if [[ ${#__grunt_opts} -gt 0 ]]; then
87 opts+=("${__grunt_opts[@]}")
88 fi
89
90 # Complete arguments.
91 _arguments \
92 "${opts[@]}" \
93 '*: :->tasks' \
94 && return
95
96 case $state in
97 tasks)
98 if [[ $show_grunt_path == 'yes' ]]; then
99 update_msg="$update_msg: ${${gruntfile/#$HOME/~}%/}"
100 fi
101 # Make tasks completion.
102 if [[ ${#__grunt_tasks} -gt 0 ]]; then
103 tasks+=("${__grunt_tasks[@]}")
104 _describe -t grunt-task "$verbose grunt task$update_msg" tasks || return 1
105 fi
106 ;;
107 esac
108
109 return 0
110 }
111
112 # Cache policy:
113 # The cache file name: grunt
114 # The cache variable name: __grunt_version __grunt_gruntfile __grunt_opts __grunt_tasks
115 function __grunt_update_cache() {
116 # TODO
117 local version='0.1.2'
118 local is_updating=0
119 local gruntfile="$1"
120 local grunt_info no_update_options cache_path
121
122 # Check no_update_options option.
123 zstyle -b ":completion:${curcontext}:options:" no_update_options no_update_options
124
125
126 if ! ( (( $+__grunt_gruntfile )) \
127 && (( $+__grunt_opts )) \
128 && (( $+__grunt_tasks )) ) \
129 && ! _retrieve_cache 'grunt'; then
130 is_updating=1
131 fi
132
133 if [[ $gruntfile != $__grunt_gruntfile ]]; then
134 # Except for --help options.
135 __grunt_gruntfile=$gruntfile
136 if [[ $no_update_options == 'yes' ]]; then
137 if [[ $PREFIX == ${PREFIX#-} ]]; then
138 # Not options completions.
139 is_updating=1
140 elif [[ ${#__grunt_opts} -lt 2 ]]; then
141 is_updating=1
142 else
143 unset __grunt_gruntfile
144 fi
145 else
146 is_updating=1
147 fi
148 else
149 if [[ $PREFIX != ${PREFIX#-} && ${#__grunt_opts} -gt 1 ]]; then
150 unset __grunt_gruntfile
151 fi
152 fi
153
154 if _cache_invalid 'grunt'; then
155 is_updating=1
156 fi
157
158 # Check _grunt version.
159 if [[ $__grunt_version != $version ]]; then
160 is_updating=1
161 fi
162
163 if [[ $is_updating -ne 0 ]]; then
164 # Update caceh.
165 __grunt_version=$version
166 __grunt_gruntfile=$gruntfile
167 is_updating=1
168 grunt_info=$(grunt --help --no-color --gruntfile "$__grunt_gruntfile" 2>/dev/null)
169 __grunt_opts=(${(f)"$(__grunt_get_opts "$grunt_info")"})
170 __grunt_tasks=(${(f)"$(__grunt_get_tasks "$grunt_info")"})
171 _store_cache 'grunt' __grunt_version __grunt_gruntfile __grunt_opts __grunt_tasks
172 fi
173 return $is_updating
174 }
175
176 function __grunt_get_tasks() {
177 echo -E "$1" \
178 | grep 'Available tasks' -A 100 \
179 | grep '^ ' \
180 | sed -e 's/^[[:blank:]]*//' -e 's/[[:blank:]]*$//' \
181 | sed -e 's/:/\\:/g' \
182 | sed -e 's/ /:/'
183 }
184
185 function __grunt_get_opts() {
186 local opt_hunk opt_sep opt_num line opt
187 opt_hunk=$(echo -E "$1" \
188 | grep 'Options$' -A 100 \
189 | sed '1 d' \
190 | sed -e 's/[[:blank:]]*$//' \
191 )
192
193 opt_sep=()
194 opt_hunk=(${(f)opt_hunk})
195 opt_num=0
196 for line in "$opt_hunk[@]"; do
197 opt=$(echo -E "$line" | sed -e 's/^[[:blank:]]*//')
198 if [[ $line == $opt ]]; then
199 break
200 fi
201 if [[ $opt != ${opt#-} ]]; then
202 # Start with -
203 (( opt_num++ ))
204 opt=$(echo -E "$opt" | sed 's/^\(\(--[^ ]*\)\(, \(-[^ ]*\)\)*\) */\2\\t\4\\\t/')
205 fi
206 opt_sep[$opt_num]=("${opt_sep[$opt_num]}${opt}")
207 done
208
209 for line in "$opt_sep[@]"; do
210 opt=(${(s:\t:)line})
211 if [[ ${opt[1]} == '--help' ]]; then
212 continue
213 fi
214 if [[ ${#opt} -eq 2 ]]; then
215 echo -E "(${opt[1]})${opt[1]}[${opt[2]}]"
216 else
217 echo -E "(${opt[1]},${opt[2]})${opt[1]}[${opt[3]}]"
218 echo -E "(${opt[1]},${opt[2]})${opt[2]}[${opt[3]}]"
219 fi
220 done
221 }
222
223 function __grunt_get_gruntfile() {
224 local gruntfile
225 local curpath="$PWD"
226 while [ "$curpath" ]; do
227 for gruntfile in "$curpath/"{G,g}runtfile.{js,coffee}; do
228 if [[ -e "$gruntfile" ]]; then
229 echo "$gruntfile"
230 return
231 fi
232 done
233 curpath=${curpath%/*}
234 done
235 return 1
236 }
237
238 function __grunt_caching_policy() {
239 # Returns status zero if the completions cache needs rebuilding.
240
241 # Rebuild if .agignore more recent than cache.
242 if [[ -f $__grunt_gruntfile && $__grunt_gruntfile -nt $1 ]]; then
243 # Invalid cache because gruntfile is old.
244 return 0
245 fi
246
247 local -a oldp
248 local expire
249 zstyle -s ":completion:${curcontext}:options:" expire expire || expire=7
250 # Rebuild if cache is more than $expire days.
251 oldp=( "$1"(Nm+$expire) )
252 (( $#oldp ))
253 }
254
255 compdef __grunt grunt
plugins/history-substring-search/README
1 To activate this script, load it into an interactive ZSH session: File was deleted
2
3 % source history-substring-search.zsh
4
5 See the "history-substring-search.zsh" file for more information:
6
7 % sed -n '2,/^$/s/^#//p' history-substring-search.zsh | more
8 1 To activate this script, load it into an interactive ZSH session:
plugins/history-substring-search/README.markdown
File was created 1 To activate this script, please include it the `plugins` variable within `~/.zshrc`
2
3 `plugins=(git history-substring-search.zsh)`
4
5 See the "history-substring-search.zsh" file for more information:
6
7 `sed -n '2,/^$/s/^#//p' history-substring-search.zsh | more`
8
plugins/httpie/httpie.plugin.zsh
File was created 1 function _httpie_completion() {
2 _arguments -C \
3 '(- 1 *)--version[display version information]' \
4 '(-j|--json)'{-j,--json}'[(default) Data items from the command line are serialized as a JSON object]' \
5 '(-f|--form)'{-f,--form}'[Data items from the command line are serialized as form fields]' \
6 '(--pretty)--pretty[<all,colors,format,none> Controls output processing]:options' \
7 '(-s|--style)'{-s,--style}'[Output coloring style]' \
8 '(-p|--print)'{-p,--print}'[String specifying what the output should contain: H(request headers), B(request body), h(response headers), b(response body)]' \
9 '(-v|--verbose)'{-v,--verbose}'[Print the whole request as well as the response. Shortcut for --print=HBbh.]' \
10 '(-h|--headers)'{-h,--headers}'[Print only the response headers. Shortcut for --print=h]' \
11 '(-b|--body)'{-b,--body}'[Print only the response body. Shortcut for --print=b]' \
12 '(-S|--stream)'{-S,--stream}'[Always stream the output by line, i.e., behave like `tail -f'"'"']' \
13 '(-o|--output)'{-o,--output}'[Save output to FILE]:file:_files' \
14 '(-d|--download)'{-d,--download}'[Do not print the response body to stdout. Rather, download it and store it in a file. The filename is guessed unless specified with --output filename. This action is similar to the default behaviour of wget.]' \
15 '(-c|--continue)'{-c,--continue}'[Resume an interrupted download. Note that the --output option needs to be specified as well.]' \
16 '(--session)--session[Create, or reuse and update a session. Within a session, custom headers, auth credential, as well as any cookies sent by the server persist between requests]:file:_files' \
17 '(--session-read-only)--session-read-only[Create or read a session without updating it form the request/response exchange]:file:_files' \
18 '(-a|--auth)'{-a,--auth}'[<USER:PASS> If only the username is provided (-a username), HTTPie will prompt for the password]' \
19 '(--auth-type)--auth-type[<basic, digest> The authentication mechanism to be used. Defaults to "basic".]' \
20 '(--proxy)--proxy[<PROTOCOL:PROXY_URL> String mapping protocol to the URL of the proxy]' \
21 '(--follow)--follow[Set this flag if full redirects are allowed (e.g. re-POST-ing of data at new Location).]' \
22 '(--verify)--verify[<VERIFY> Set to "no" to skip checking the host'"'"'s SSL certificate. You can also pass the path to a CA_BUNDLE file for private certs. You can also set the REQUESTS_CA_BUNDLE environment variable. Defaults to "yes".]' \
23 '(--timeout)--timeout[<SECONDS> The connection timeout of the request in seconds. The default value is 30 seconds]' \
24 '(--check-status)--check-status[By default, HTTPie exits with 0 when no network or other fatal errors occur. This flag instructs HTTPie to also check the HTTP status code and exit with an error if the status indicates one.]' \
25 '(--ignore-stdin)--ignore-stdin[Do not attempt to read stdin]' \
26 '(--help)--help[Show this help message and exit]' \
27 '(--traceback)--traceback[Prints exception traceback should one occur]' \
28 '(--debug)--debug[Prints exception traceback should one occur, and also other information that is useful for debugging HTTPie itself and for reporting bugs]' \
29 '1: :->cmds' \
30 '*: :->args' && ret=0
31 }
32
33 compdef _httpie_completion http
plugins/jhbuild/README.md
File was created 1 ## JHBuild
2 **Maintainer:** [Miguel Vaello](https://github.com/miguxbe)
3
4 This plugin adds some jhbuild aliases and increase the completion function provided by zsh.
5
plugins/jhbuild/jhbuild.plugin.zsh
File was created 1 # Aliases
2 #
3 alias jh='jhbuild'
4 # Build
5 alias jhb='jhbuild build'
6 alias jhbo='jhbuild buildone'
7 # Checks
8 alias jhckb='jhbuild checkbranches'
9 alias jhckm='jhbuild checkmodulesets'
10 # Info & list
11 alias jhi='jhbuild info'
12 alias jhl='jhbuild list'
13 # Clean
14 alias jhc='jhbuild clean'
15 alias jhco='jhbuild cleanone'
16 # Run
17 alias jhr='jhbuild run'
18 # Depends
19 alias jhrd='jhbuild rdepends'
20 alias jhsd='jhbuild sysdeps'
21 # Update
22 alias jhu='jhbuild update'
23 alias jhuo='jhbuild updateone'
24 # Uninstall
25 alias jhun='jhbuild uninstall'
26
27
28
29
plugins/laravel4/laravel4.plugin.zsh
1 # Laravel4 basic command completion 1 # Laravel4 basic command completion
2 _laravel4_get_command_list () { 2 _laravel4_get_command_list () {
3 php artisan --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }' 3 php artisan --no-ansi | sed "1,/Available commands/d" | awk '/^ +[a-z]+/ { print $1 }'
4 } 4 }
5 5
6 _laravel4 () { 6 _laravel4 () {
7 if [ -f artisan ]; then 7 if [ -f artisan ]; then
8 compadd `_laravel4_get_command_list` 8 compadd `_laravel4_get_command_list`
9 fi 9 fi
10 } 10 }
11 11
12 compdef _laravel4 artisan 12 compdef _laravel4 artisan
13 compdef _laravel4 la4 13 compdef _laravel4 la4
14 14
15 #Alias 15 #Alias
16 alias la4='php artisan' 16 alias la4='php artisan'
17 17
18 alias la4dump='php artisan dump-autoload' 18 alias la4dump='php artisan dump-autoload'
19 alias la4cache='php artisan cache:clear' 19 alias la4cache='php artisan cache:clear'
20 alias la4routes='php artisan routes' 20 alias la4routes='php artisan routes'
21 21
plugins/laravel5/laravel5.plugin.zsh
File was created 1 # Laravel5 basic command completion
2 _laravel5_get_command_list () {
3 php artisan --no-ansi | sed "1,/Available commands/d" | awk '/^ +[a-z]+/ { print $1 }'
4 }
5
6 _laravel5 () {
7 if [ -f artisan ]; then
8 compadd `_laravel5_get_command_list`
9 fi
10 }
11
12 compdef _laravel5 artisan
13 compdef _laravel5 la5
14
15 #Alias
16 alias la5='php artisan'
17
18 alias la5dump='php artisan dump-autoload'
19 alias la5cache='php artisan cache:clear'
20 alias la5routes='php artisan routes'
21
plugins/mercurial/mercurial.plugin.zsh
1 # Mercurial 1 # Mercurial
2 alias hgc='hg commit' 2 alias hgc='hg commit'
3 alias hgb='hg branch' 3 alias hgb='hg branch'
4 alias hgba='hg branches' 4 alias hgba='hg branches'
5 alias hgbk='hg bookmarks' 5 alias hgbk='hg bookmarks'
6 alias hgco='hg checkout' 6 alias hgco='hg checkout'
7 alias hgd='hg diff' 7 alias hgd='hg diff'
8 alias hged='hg diffmerge' 8 alias hged='hg diffmerge'
9 # pull and update 9 # pull and update
10 alias hgi='hg incoming' 10 alias hgi='hg incoming'
11 alias hgl='hg pull -u' 11 alias hgl='hg pull -u'
12 alias hglr='hg pull --rebase' 12 alias hglr='hg pull --rebase'
13 alias hgo='hg outgoing' 13 alias hgo='hg outgoing'
14 alias hgp='hg push' 14 alias hgp='hg push'
15 alias hgs='hg status' 15 alias hgs='hg status'
16 alias hgsl='hg log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n" ' 16 alias hgsl='hg log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n" '
17 # this is the 'git commit --amend' equivalent 17 # this is the 'git commit --amend' equivalent
18 alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip' 18 alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
19 # list unresolved files (since hg does not list unmerged files in the status command) 19 # list unresolved files (since hg does not list unmerged files in the status command)
20 alias hgun='hg resolve --list' 20 alias hgun='hg resolve --list'
21 21
22 function in_hg() { 22 function in_hg() {
23 if [[ -d .hg ]] || $(hg summary > /dev/null 2>&1); then 23 if [[ -d .hg ]] || $(hg summary > /dev/null 2>&1); then
24 echo 1 24 echo 1
25 fi 25 fi
26 } 26 }
27 27
28 function hg_get_branch_name() { 28 function hg_get_branch_name() {
29 if [ $(in_hg) ]; then 29 if [ $(in_hg) ]; then
30 echo $(hg branch) 30 echo $(hg branch)
31 fi 31 fi
32 } 32 }
33 33
34 function hg_prompt_info { 34 function hg_prompt_info {
35 if [ $(in_hg) ]; then 35 if [ $(in_hg) ]; then
36 _DISPLAY=$(hg_get_branch_name) 36 _DISPLAY=$(hg_get_branch_name)
37 echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_HG_PROMPT_PREFIX\ 37 echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_HG_PROMPT_PREFIX\
38 $ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_HG_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(hg_dirty)$ZSH_PROMPT_BASE_COLOR" 38 $ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_PROMPT_BASE_COLOR$(hg_dirty)$ZSH_THEME_HG_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR"
39 unset _DISPLAY 39 unset _DISPLAY
40 fi 40 fi
41 } 41 }
42 42
43 function hg_dirty_choose { 43 function hg_dirty_choose {
44 if [ $(in_hg) ]; then 44 if [ $(in_hg) ]; then
45 hg status 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]' 45 hg status 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]'
46 if [ $pipestatus[-1] -eq 0 ]; then 46 if [ $pipestatus[-1] -eq 0 ]; then
47 # Grep exits with 0 when "One or more lines were selected", return "dirty". 47 # Grep exits with 0 when "One or more lines were selected", return "dirty".
48 echo $1 48 echo $1
49 else 49 else
50 # Otherwise, no lines were found, or an error occurred. Return clean. 50 # Otherwise, no lines were found, or an error occurred. Return clean.
51 echo $2 51 echo $2
52 fi 52 fi
53 fi 53 fi
54 } 54 }
55 55
56 function hg_dirty { 56 function hg_dirty {
57 hg_dirty_choose $ZSH_THEME_HG_PROMPT_DIRTY $ZSH_THEME_HG_PROMPT_CLEAN 57 hg_dirty_choose $ZSH_THEME_HG_PROMPT_DIRTY $ZSH_THEME_HG_PROMPT_CLEAN
58 } 58 }
59 59
60 function hgic() { 60 function hgic() {
61 hg incoming "$@" | grep "changeset" | wc -l 61 hg incoming "$@" | grep "changeset" | wc -l
62 } 62 }
63 63
64 function hgoc() { 64 function hgoc() {
65 hg outgoing "$@" | grep "changeset" | wc -l 65 hg outgoing "$@" | grep "changeset" | wc -l
66 } 66 }
67 67
1 #compdef mix 1 #compdef mix
2 #autoload 2 #autoload
3 3
4 # Elixir mix zsh completion 4 # Elixir mix zsh completion
5 5
6 local -a _1st_arguments 6 local -a _1st_arguments
7 _1st_arguments=( 7 _1st_arguments=(
8 'archive:Archive this project into a .ez file' 8 'archive:Archive this project into a .ez file'
9 'clean:Clean generated application files' 9 'clean:Clean generated application files'
10 'compile:Compile source files' 10 'compile:Compile source files'
11 'deps:List dependencies and their status' 11 'deps:List dependencies and their status'
12 "deps.clean:Remove dependencies' files" 12 "deps.clean:Remove dependencies' files"
13 'deps.compile:Compile dependencies' 13 'deps.compile:Compile dependencies'
14 'deps.get:Get all out of date dependencies' 14 'deps.get:Get all out of date dependencies'
15 'deps.unlock:Unlock the given dependencies' 15 'deps.unlock:Unlock the given dependencies'
16 'deps.update:Update dependencies' 16 'deps.update:Update dependencies'
17 'do:Executes the commands separated by comma' 17 'do:Executes the commands separated by comma'
18 'escriptize:Generates an escript for the project' 18 'escriptize:Generates an escript for the project'
19 'help:Print help information for tasks' 19 'help:Print help information for tasks'
20 'local:List local tasks' 20 'local:List local tasks'
21 'local.install:Install a task or an archive locally' 21 'local.install:Install a task or an archive locally'
22 'local.rebar:Install rebar locally' 22 'local.rebar:Install rebar locally'
23 'local.uninstall:Uninstall local tasks or archives' 23 'local.uninstall:Uninstall local tasks or archives'
24 'local.hex:Install Hex locally'
24 'new:Creates a new Elixir project' 25 'new:Creates a new Elixir project'
25 'run:Run the given file or expression' 26 'run:Run the given file or expression'
26 "test:Run a project's tests" 27 "test:Run a project's tests"
27 '--help:Describe available tasks' 28 '--help:Describe available tasks'
28 '--version:Prints the Elixir version information' 29 '--version:Prints the Elixir version information'
29 ) 30 )
30 31
31 __task_list () 32 __task_list ()
32 { 33 {
33 local expl 34 local expl
34 declare -a tasks 35 declare -a tasks
35 36
36 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) 37 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)
37 38
38 _wanted tasks expl 'help' compadd $tasks 39 _wanted tasks expl 'help' compadd $tasks
39 } 40 }
40 41
41 local expl 42 local expl
42 43
43 local curcontext="$curcontext" state line 44 local curcontext="$curcontext" state line
44 typeset -A opt_args 45 typeset -A opt_args
45 46
46 _arguments -C \ 47 _arguments -C \
47 ':command:->command' \ 48 ':command:->command' \
48 '*::options:->options' 49 '*::options:->options'
49 50
50 case $state in 51 case $state in
51 (command) 52 (command)
52 _describe -t commands "mix subcommand" _1st_arguments 53 _describe -t commands "mix subcommand" _1st_arguments
53 return 54 return
54 ;; 55 ;;
55 56
56 (options) 57 (options)
57 case $line[1] in 58 case $line[1] in
58 (help) 59 (help)
59 _arguments ':feature:__task_list' 60 _arguments ':feature:__task_list'
60 esac 61 esac
61 ;; 62 ;;
62 esac 63 esac
63 64
64 65
plugins/mvn/mvn.plugin.zsh
1 # mvn-color based on https://gist.github.com/1027800 1 # mvn-color based on https://gist.github.com/1027800
2 export BOLD=`tput bold` 2 export BOLD=`tput bold`
3 export UNDERLINE_ON=`tput smul` 3 export UNDERLINE_ON=`tput smul`
4 export UNDERLINE_OFF=`tput rmul` 4 export UNDERLINE_OFF=`tput rmul`
5 export TEXT_BLACK=`tput setaf 0` 5 export TEXT_BLACK=`tput setaf 0`
6 export TEXT_RED=`tput setaf 1` 6 export TEXT_RED=`tput setaf 1`
7 export TEXT_GREEN=`tput setaf 2` 7 export TEXT_GREEN=`tput setaf 2`
8 export TEXT_YELLOW=`tput setaf 3` 8 export TEXT_YELLOW=`tput setaf 3`
9 export TEXT_BLUE=`tput setaf 4` 9 export TEXT_BLUE=`tput setaf 4`
10 export TEXT_MAGENTA=`tput setaf 5` 10 export TEXT_MAGENTA=`tput setaf 5`
11 export TEXT_CYAN=`tput setaf 6` 11 export TEXT_CYAN=`tput setaf 6`
12 export TEXT_WHITE=`tput setaf 7` 12 export TEXT_WHITE=`tput setaf 7`
13 export BACKGROUND_BLACK=`tput setab 0` 13 export BACKGROUND_BLACK=`tput setab 0`
14 export BACKGROUND_RED=`tput setab 1` 14 export BACKGROUND_RED=`tput setab 1`
15 export BACKGROUND_GREEN=`tput setab 2` 15 export BACKGROUND_GREEN=`tput setab 2`
16 export BACKGROUND_YELLOW=`tput setab 3` 16 export BACKGROUND_YELLOW=`tput setab 3`
17 export BACKGROUND_BLUE=`tput setab 4` 17 export BACKGROUND_BLUE=`tput setab 4`
18 export BACKGROUND_MAGENTA=`tput setab 5` 18 export BACKGROUND_MAGENTA=`tput setab 5`
19 export BACKGROUND_CYAN=`tput setab 6` 19 export BACKGROUND_CYAN=`tput setab 6`
20 export BACKGROUND_WHITE=`tput setab 7` 20 export BACKGROUND_WHITE=`tput setab 7`
21 export RESET_FORMATTING=`tput sgr0` 21 export RESET_FORMATTING=`tput sgr0`
22 22
23 23
24 # Wrapper function for Maven's mvn command. 24 # Wrapper function for Maven's mvn command.
25 mvn-color() 25 mvn-color()
26 { 26 {
27 ( 27 (
28 # Filter mvn output using sed. Before filtering set the locale to C, so invalid characters won't break some sed implementations 28 # Filter mvn output using sed. Before filtering set the locale to C, so invalid characters won't break some sed implementations
29 unset LANG 29 unset LANG
30 LC_CTYPE=C mvn $@ | sed -e "s/\(\[INFO\]\)\(.*\)/${TEXT_BLUE}${BOLD}\1${RESET_FORMATTING}\2/g" \ 30 LC_CTYPE=C mvn $@ | sed -e "s/\(\[INFO\]\)\(.*\)/${TEXT_BLUE}${BOLD}\1${RESET_FORMATTING}\2/g" \
31 -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \ 31 -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \
32 -e "s/\(\[WARNING\]\)\(.*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}\2/g" \ 32 -e "s/\(\[WARNING\]\)\(.*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}\2/g" \
33 -e "s/\(\[ERROR\]\)\(.*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}\2/g" \ 33 -e "s/\(\[ERROR\]\)\(.*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}\2/g" \
34 -e "s/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/${BOLD}${TEXT_GREEN}Tests run: \1${RESET_FORMATTING}, Failures: ${BOLD}${TEXT_RED}\2${RESET_FORMATTING}, Errors: ${BOLD}${TEXT_RED}\3${RESET_FORMATTING}, Skipped: ${BOLD}${TEXT_YELLOW}\4${RESET_FORMATTING}/g" 34 -e "s/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/${BOLD}${TEXT_GREEN}Tests run: \1${RESET_FORMATTING}, Failures: ${BOLD}${TEXT_RED}\2${RESET_FORMATTING}, Errors: ${BOLD}${TEXT_RED}\3${RESET_FORMATTING}, Skipped: ${BOLD}${TEXT_YELLOW}\4${RESET_FORMATTING}/g"
35 35
36 # Make sure formatting is reset 36 # Make sure formatting is reset
37 echo -ne ${RESET_FORMATTING} 37 echo -ne ${RESET_FORMATTING}
38 ) 38 )
39 } 39 }
40 40
41 # Override the mvn command with the colorized one. 41 # Override the mvn command with the colorized one.
42 #alias mvn="mvn-color" 42 #alias mvn="mvn-color"
43 43
44 # aliases 44 # aliases
45 alias mvncie='mvn clean install eclipse:eclipse' 45 alias mvncie='mvn clean install eclipse:eclipse'
46 alias mvnci='mvn clean install' 46 alias mvnci='mvn clean install'
47 alias mvncist='mvn clean install -DskipTests' 47 alias mvncist='mvn clean install -DskipTests'
48 alias mvne='mvn eclipse:eclipse' 48 alias mvne='mvn eclipse:eclipse'
49 alias mvnce='mvn clean eclipse:clean eclipse:eclipse' 49 alias mvnce='mvn clean eclipse:clean eclipse:eclipse'
50 alias mvnd='mvn deploy' 50 alias mvnd='mvn deploy'
51 alias mvnp='mvn package' 51 alias mvnp='mvn package'
52 alias mvnc='mvn clean' 52 alias mvnc='mvn clean'
53 alias mvncom='mvn compile' 53 alias mvncom='mvn compile'
54 alias mvnct='mvn clean test' 54 alias mvnct='mvn clean test'
55 alias mvnt='mvn test' 55 alias mvnt='mvn test'
56 alias mvnag='mvn archetype:generate' 56 alias mvnag='mvn archetype:generate'
57 alias mvn-updates='mvn versions:display-dependency-updates' 57 alias mvn-updates='mvn versions:display-dependency-updates'
58 alias mvntc7='mvn tomcat7:run' 58 alias mvntc7='mvn tomcat7:run'
59 alias mvntc='mvn tomcat:run' 59 alias mvntc='mvn tomcat:run'
60 alias mvnjetty='mvn jetty:run' 60 alias mvnjetty='mvn jetty:run'
61 alias mvndt='mvn dependency:tree' 61 alias mvndt='mvn dependency:tree'
62 alias mvns='mvn site' 62 alias mvns='mvn site'
63 alias mvnsrc='mvn dependency:sources'
64 alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc'
63 65
64 function listMavenCompletions { 66 function listMavenCompletions {
65 reply=( 67 reply=(
66 # common lifecycle 68 # common lifecycle
67 clean process-resources compile process-test-resources test-compile test integration-test package verify install deploy site 69 clean process-resources compile process-test-resources test-compile test integration-test package verify install deploy site
68 70
69 # common plugins 71 # common plugins
70 deploy failsafe install site surefire checkstyle javadoc jxr pmd ant antrun archetype assembly dependency enforcer gpg help release repository source eclipse idea jetty cargo jboss tomcat tomcat6 tomcat7 exec versions war ear ejb android scm buildnumber nexus repository sonar license hibernate3 liquibase flyway gwt 72 deploy failsafe install site surefire checkstyle javadoc jxr pmd ant antrun archetype assembly dependency enforcer gpg help release repository source eclipse idea jetty cargo jboss tomcat tomcat6 tomcat7 exec versions war ear ejb android scm buildnumber nexus repository sonar license hibernate3 liquibase flyway gwt
71 73
72 # deploy 74 # deploy
73 deploy:deploy-file 75 deploy:deploy-file
74 # failsafe 76 # failsafe
75 failsafe:integration-test failsafe:verify 77 failsafe:integration-test failsafe:verify
76 # install 78 # install
77 install:install-file 79 install:install-file
78 # site 80 # site
79 site:site site:deploy site:run site:stage site:stage-deploy 81 site:site site:deploy site:run site:stage site:stage-deploy
80 # surefire 82 # surefire
81 surefire:test 83 surefire:test
82 84
83 # checkstyle 85 # checkstyle
84 checkstyle:checkstyle checkstyle:check 86 checkstyle:checkstyle checkstyle:check
85 # javadoc 87 # javadoc
86 javadoc:javadoc javadoc:jar javadoc:aggregate 88 javadoc:javadoc javadoc:jar javadoc:aggregate
87 # jxr 89 # jxr
88 jxr:jxr 90 jxr:jxr
89 # pmd 91 # pmd
90 pmd:pmd pmd:cpd pmd:check pmd:cpd-check 92 pmd:pmd pmd:cpd pmd:check pmd:cpd-check
91 93
92 # ant 94 # ant
93 ant:ant ant:clean 95 ant:ant ant:clean
94 # antrun 96 # antrun
95 antrun:run 97 antrun:run
96 # archetype 98 # archetype
97 archetype:generate archetype:create-from-project archetype:crawl 99 archetype:generate archetype:create-from-project archetype:crawl
98 # assembly 100 # assembly
99 assembly:single assembly:assembly 101 assembly:single assembly:assembly
100 # dependency 102 # dependency
101 dependency:analyze dependency:analyze-dep-mgt dependency:analyze-only dependency:analyze-report dependency:build-classpath dependency:copy dependency:copy-dependencies dependency:get dependency:go-offline dependency:list dependency:purge-local-repository dependency:resolve dependency:resolve-plugins dependency:sources dependency:tree dependency:unpack dependency:unpack-dependencies 103 dependency:analyze dependency:analyze-dep-mgt dependency:analyze-only dependency:analyze-report dependency:build-classpath dependency:copy dependency:copy-dependencies dependency:get dependency:go-offline dependency:list dependency:purge-local-repository dependency:resolve dependency:resolve-plugins dependency:sources dependency:tree dependency:unpack dependency:unpack-dependencies
102 # enforcer 104 # enforcer
103 enforcer:enforce 105 enforcer:enforce
104 # gpg 106 # gpg
105 gpg:sign gpg:sign-and-deploy-file 107 gpg:sign gpg:sign-and-deploy-file
106 # help 108 # help
107 help:active-profiles help:all-profiles help:describe help:effective-pom help:effective-settings help:evaluate help:expressions help:system 109 help:active-profiles help:all-profiles help:describe help:effective-pom help:effective-settings help:evaluate help:expressions help:system
108 # release 110 # release
109 release:clean release:prepare release:rollback release:perform release:stage release:branch release:update-versions 111 release:clean release:prepare release:rollback release:perform release:stage release:branch release:update-versions
110 # repository 112 # repository
111 repository:bundle-create repository:bundle-pack 113 repository:bundle-create repository:bundle-pack
112 # source 114 # source
113 source:aggregate source:jar source:jar-no-fork 115 source:aggregate source:jar source:jar-no-fork
114 116
115 # eclipse 117 # eclipse
116 eclipse:clean eclipse:eclipse 118 eclipse:clean eclipse:eclipse
117 # idea 119 # idea
118 idea:clean idea:idea 120 idea:clean idea:idea
119 121
120 # jetty 122 # jetty
121 jetty:run jetty:run-exploded 123 jetty:run jetty:run-exploded
122 # cargo 124 # cargo
123 cargo:start cargo:run cargo:stop cargo:deploy cargo:undeploy cargo:help 125 cargo:start cargo:run cargo:stop cargo:deploy cargo:undeploy cargo:help
124 # jboss 126 # jboss
125 jboss:start jboss:stop jboss:deploy jboss:undeploy jboss:redeploy 127 jboss:start jboss:stop jboss:deploy jboss:undeploy jboss:redeploy
126 # tomcat 128 # tomcat
127 tomcat:start tomcat:stop tomcat:deploy tomcat:undeploy tomcat:redeploy 129 tomcat:start tomcat:stop tomcat:deploy tomcat:undeploy tomcat:redeploy
128 # tomcat6 130 # tomcat6
129 tomcat6:run tomcat6:run-war tomcat6:run-war-only tomcat6:stop tomcat6:deploy tomcat6:undeploy 131 tomcat6:run tomcat6:run-war tomcat6:run-war-only tomcat6:stop tomcat6:deploy tomcat6:undeploy
130 # tomcat7 132 # tomcat7
131 tomcat7:run tomcat7:run-war tomcat7:run-war-only tomcat7:deploy 133 tomcat7:run tomcat7:run-war tomcat7:run-war-only tomcat7:deploy
132 # tomee 134 # tomee
133 tomee:run tomee:run-war tomee:run-war-only tomee:stop tomee:deploy tomee:undeploy 135 tomee:run tomee:run-war tomee:run-war-only tomee:stop tomee:deploy tomee:undeploy
134 # spring-boot 136 # spring-boot
135 spring-boot:run spring-boot:repackage 137 spring-boot:run spring-boot:repackage
136 # exec 138 # exec
137 exec:exec exec:java 139 exec:exec exec:java
138 # versions 140 # versions
139 versions:display-dependency-updates versions:display-plugin-updates versions:display-property-updates versions:update-parent versions:update-properties versions:update-child-modules versions:lock-snapshots versions:unlock-snapshots versions:resolve-ranges versions:set versions:use-releases versions:use-next-releases versions:use-latest-releases versions:use-next-snapshots versions:use-latest-snapshots versions:use-next-versions versions:use-latest-versions versions:commit versions:revert 141 versions:display-dependency-updates versions:display-plugin-updates versions:display-property-updates versions:update-parent versions:update-properties versions:update-child-modules versions:lock-snapshots versions:unlock-snapshots versions:resolve-ranges versions:set versions:use-releases versions:use-next-releases versions:use-latest-releases versions:use-next-snapshots versions:use-latest-snapshots versions:use-next-versions versions:use-latest-versions versions:commit versions:revert
140 # scm 142 # scm
141 scm:add scm:checkin scm:checkout scm:update scm:status 143 scm:add scm:checkin scm:checkout scm:update scm:status
142 # buildnumber 144 # buildnumber
143 buildnumber:create buildnumber:create-timestamp buildnumber:help buildnumber:hgchangeset 145 buildnumber:create buildnumber:create-timestamp buildnumber:help buildnumber:hgchangeset
144 146
145 # war 147 # war
146 war:war war:exploded war:inplace war:manifest 148 war:war war:exploded war:inplace war:manifest
147 # ear 149 # ear
148 ear:ear ear:generate-application-xml 150 ear:ear ear:generate-application-xml
149 # ejb 151 # ejb
150 ejb:ejb 152 ejb:ejb
151 # android 153 # android
152 android:apk android:apklib android:deploy android:deploy-dependencies android:dex android:emulator-start android:emulator-stop android:emulator-stop-all android:generate-sources android:help android:instrument android:manifest-update android:pull android:push android:redeploy android:run android:undeploy android:unpack android:version-update android:zipalign android:devices 154 android:apk android:apklib android:deploy android:deploy-dependencies android:dex android:emulator-start android:emulator-stop android:emulator-stop-all android:generate-sources android:help android:instrument android:manifest-update android:pull android:push android:redeploy android:run android:undeploy android:unpack android:version-update android:zipalign android:devices
153 # nexus 155 # nexus
154 nexus:staging-list nexus:staging-close nexus:staging-drop nexus:staging-release nexus:staging-build-promotion nexus:staging-profiles-list nexus:settings-download 156 nexus:staging-list nexus:staging-close nexus:staging-drop nexus:staging-release nexus:staging-build-promotion nexus:staging-profiles-list nexus:settings-download
155 # repository 157 # repository
156 repository:bundle-create repository:bundle-pack repository:help 158 repository:bundle-create repository:bundle-pack repository:help
157 159
158 # sonar 160 # sonar
159 sonar:sonar 161 sonar:sonar
160 # license 162 # license
161 license:format license:check 163 license:format license:check
162 # hibernate3 164 # hibernate3
163 hibernate3:hbm2ddl hibernate3:help 165 hibernate3:hbm2ddl hibernate3:help
164 # liquibase 166 # liquibase
165 liquibase:changelogSync liquibase:changelogSyncSQL liquibase:clearCheckSums liquibase:dbDoc liquibase:diff liquibase:dropAll liquibase:help liquibase:migrate liquibase:listLocks liquibase:migrateSQL liquibase:releaseLocks liquibase:rollback liquibase:rollbackSQL liquibase:status liquibase:tag liquibase:update liquibase:updateSQL liquibase:updateTestingRollback 167 liquibase:changelogSync liquibase:changelogSyncSQL liquibase:clearCheckSums liquibase:dbDoc liquibase:diff liquibase:dropAll liquibase:help liquibase:migrate liquibase:listLocks liquibase:migrateSQL liquibase:releaseLocks liquibase:rollback liquibase:rollbackSQL liquibase:status liquibase:tag liquibase:update liquibase:updateSQL liquibase:updateTestingRollback
166 # flyway 168 # flyway
167 flyway:clean flyway:history flyway:init flyway:migrate flyway:status flyway:validate 169 flyway:clean flyway:history flyway:init flyway:migrate flyway:status flyway:validate
168 # gwt 170 # gwt
169 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 171 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
170 172
171 # options 173 # options
172 -Dmaven.test.skip=true -DskipTests -Dmaven.surefire.debug -DenableCiProfile -Dpmd.skip=true -Dcheckstyle.skip=true -Dtycho.mode=maven 174 -Dmaven.test.skip=true -DskipTests -Dmaven.surefire.debug -DenableCiProfile -Dpmd.skip=true -Dcheckstyle.skip=true -Dtycho.mode=maven
173 175
174 # arguments 176 # arguments
175 -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 177 -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
176 178
177 cli:execute cli:execute-phase 179 cli:execute cli:execute-phase
178 archetype:generate generate-sources 180 archetype:generate generate-sources
179 cobertura:cobertura 181 cobertura:cobertura
180 -Dtest= `if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi` 182 -Dtest= `if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi`
181 ); 183 );
182 } 184 }
183 185
184 compctl -K listMavenCompletions mvn 186 compctl -K listMavenCompletions mvn
185 187
plugins/nmap/README.md
File was created 1 # Nmap aliases plugin
2
3 Adds some useful aliases for nmap similar to the profiles in zenmap.
4
5 Nmap options are:
6 * -sS - TCP SYN scan
7 * -v - verbose
8 * -T1 - timing of scan. Options are paranoid (0), sneaky (1), polite (2), normal (3), aggressive (4), and insane (5)
9 * -sF - FIN scan (can sneak through non-stateful firewalls)
10 * -PE - ICMP echo discovery probe
11 * -PP - timestamp discovery probe
12 * -PY - SCTP init ping
13 * -g - use given number as source port
14 * -A - enable OS detection, version detection, script scanning, and traceroute (aggressive)
15 * -O - enable OS detection
16 * -sA - TCP ACK scan
17 * -F - fast scan
18 * --script=vulscan - also access vulnerabilities in target
19
20 ## Aliases explained
21
22 * nmap_open_ports - scan for open ports on target
23 * nmap_list_interfaces - list all network interfaces on host where the command runs
24 * nmap_slow - slow scan that avoids to spam the targets logs
25 * nmap_fin - scan to see if hosts are up with TCP FIN scan
26 * nmap_full - aggressive full scan that scans all ports, tries to determine OS and service versions
27 * nmap_check_for_firewall - TCP ACK scan to check for firewall existence
28 * nmap_ping_through_firewall - Host discovery with SYN and ACK probes instead of just pings to avoid firewall
29 restrictions
30 * nmap_fast - Fast scan of the top 300 popular ports
31 * nmap_detect_versions - detects versions of services and OS, runs on all ports
32 * nmap_check_for_vulns - uses vulscan script to check target services for vulnerabilities
33
plugins/nmap/nmap.plugin.zsh
File was created 1 # Some useful nmap aliases for scan modes
2
3 # Nmap options are:
4 # -sS - TCP SYN scan
5 # -v - verbose
6 # -T1 - timing of scan. Options are paranoid (0), sneaky (1), polite (2), normal (3), aggressive (4), and insane (5)
7 # -sF - FIN scan (can sneak through non-stateful firewalls)
8 # -PE - ICMP echo discovery probe
9 # -PP - timestamp discovery probe
10 # -PY - SCTP init ping
11 # -g - use given number as source port
12 # -A - enable OS detection, version detection, script scanning, and traceroute (aggressive)
13 # -O - enable OS detection
14 # -sA - TCP ACK scan
15 # -F - fast scan
16 # --script=vulscan - also access vulnerabilities in target
17
18 alias nmap_open_ports="nmap --open"
19 alias nmap_list_interfaces="nmap --iflist"
20 alias nmap_slow="nmap -sS -v -T1"
21 alias nmap_fin="nmap -sF -v"
22 alias nmap_full="nmap -sS -T4 -PE -PP -PS80,443 -PY -g 53 -A -p1-65535 -v"
23 alias nmap_check_for_firewall="nmap -sA -p1-65535 -v -T4"
24 alias nmap_ping_through_firewall="nmap -PS -PA"
25 alias nmap_fast="nmap -F -T5 --top-ports 300"
26 alias nmap_detect_versions="nmap -sV -p1-65535 -O --osscan-guess -T4 -Pn"
27 alias nmap_check_for_vulns="nmap --script=vulscan"
28
29
plugins/npm/npm.plugin.zsh
1 eval "$(npm completion 2>/dev/null)" 1 eval "$(npm completion 2>/dev/null)"
2
3 # Install and save to dependencies
4 alias npms="npm i -S "
5
6 # Install and save to dev-dependencies
7 alias npmd="npm i -D "
2 8
plugins/osx/osx.plugin.zsh
1 # ------------------------------------------------------------------------------ 1 # ------------------------------------------------------------------------------
2 # FILE: osx.plugin.zsh 2 # FILE: osx.plugin.zsh
3 # DESCRIPTION: oh-my-zsh plugin file. 3 # DESCRIPTION: oh-my-zsh plugin file.
4 # AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) 4 # AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com)
5 # VERSION: 1.1.0 5 # VERSION: 1.1.0
6 # ------------------------------------------------------------------------------ 6 # ------------------------------------------------------------------------------
7 7
8 function tab() { 8 function tab() {
9 local command="cd \\\"$PWD\\\"; clear; " 9 local command="cd \\\"$PWD\\\"; clear; "
10 (( $# > 0 )) && command="${command}; $*" 10 (( $# > 0 )) && command="${command}; $*"
11 11
12 the_app=$( 12 the_app=$(
13 osascript 2>/dev/null <<EOF 13 osascript 2>/dev/null <<EOF
14 tell application "System Events" 14 tell application "System Events"
15 name of first item of (every process whose frontmost is true) 15 name of first item of (every process whose frontmost is true)
16 end tell 16 end tell
17 EOF 17 EOF
18 ) 18 )
19 19
20 [[ "$the_app" == 'Terminal' ]] && { 20 [[ "$the_app" == 'Terminal' ]] && {
21 osascript 2>/dev/null <<EOF 21 osascript 2>/dev/null <<EOF
22 tell application "System Events" 22 tell application "System Events"
23 tell process "Terminal" to keystroke "t" using command down 23 tell process "Terminal" to keystroke "t" using command down
24 tell application "Terminal" to do script "${command}" in front window 24 tell application "Terminal" to do script "${command}" in front window
25 end tell 25 end tell
26 EOF 26 EOF
27 } 27 }
28 28
29 [[ "$the_app" == 'iTerm' ]] && { 29 [[ "$the_app" == 'iTerm' ]] && {
30 osascript 2>/dev/null <<EOF 30 osascript 2>/dev/null <<EOF
31 tell application "iTerm" 31 tell application "iTerm"
32 set current_terminal to current terminal 32 set current_terminal to current terminal
33 tell current_terminal 33 tell current_terminal
34 launch session "Default Session" 34 launch session "Default Session"
35 set current_session to current session 35 set current_session to current session
36 tell current_session 36 tell current_session
37 write text "${command}" 37 write text "${command}"
38 keystroke return
38 end tell 39 end tell
39 end tell 40 end tell
40 end tell 41 end tell
41 EOF 42 EOF
42 } 43 }
43 } 44 }
44 45
45 function vsplit_tab() { 46 function vsplit_tab() {
46 local command="cd \\\"$PWD\\\"" 47 local command="cd \\\"$PWD\\\""
47 (( $# > 0 )) && command="${command}; $*" 48 (( $# > 0 )) && command="${command}; $*"
48 49
49 the_app=$( 50 the_app=$(
50 osascript 2>/dev/null <<EOF 51 osascript 2>/dev/null <<EOF
51 tell application "System Events" 52 tell application "System Events"
52 name of first item of (every process whose frontmost is true) 53 name of first item of (every process whose frontmost is true)
53 end tell 54 end tell
54 EOF 55 EOF
55 ) 56 )
56 57
57 [[ "$the_app" == 'iTerm' ]] && { 58 [[ "$the_app" == 'iTerm' ]] && {
58 osascript 2>/dev/null <<EOF 59 osascript 2>/dev/null <<EOF
59 tell application "iTerm" to activate 60 tell application "iTerm" to activate
60 61
61 tell application "System Events" 62 tell application "System Events"
62 tell process "iTerm" 63 tell process "iTerm"
63 tell menu item "Split Vertically With Current Profile" of menu "Shell" of menu bar item "Shell" of menu bar 1 64 tell menu item "Split Vertically With Current Profile" of menu "Shell" of menu bar item "Shell" of menu bar 1
64 click 65 click
65 end tell 66 end tell
66 end tell 67 end tell
67 keystroke "${command}; clear;" 68 keystroke "${command}; clear;"
68 keystroke return 69 keystroke return
69 end tell 70 end tell
70 EOF 71 EOF
71 } 72 }
72 } 73 }
73 74
74 function split_tab() { 75 function split_tab() {
75 local command="cd \\\"$PWD\\\"" 76 local command="cd \\\"$PWD\\\""
76 (( $# > 0 )) && command="${command}; $*" 77 (( $# > 0 )) && command="${command}; $*"
77 78
78 the_app=$( 79 the_app=$(
79 osascript 2>/dev/null <<EOF 80 osascript 2>/dev/null <<EOF
80 tell application "System Events" 81 tell application "System Events"
81 name of first item of (every process whose frontmost is true) 82 name of first item of (every process whose frontmost is true)
82 end tell 83 end tell
83 EOF 84 EOF
84 ) 85 )
85 86
86 [[ "$the_app" == 'iTerm' ]] && { 87 [[ "$the_app" == 'iTerm' ]] && {
87 osascript 2>/dev/null <<EOF 88 osascript 2>/dev/null <<EOF
88 tell application "iTerm" to activate 89 tell application "iTerm" to activate
89 90
90 tell application "System Events" 91 tell application "System Events"
91 tell process "iTerm" 92 tell process "iTerm"
92 tell menu item "Split Horizontally With Current Profile" of menu "Shell" of menu bar item "Shell" of menu bar 1 93 tell menu item "Split Horizontally With Current Profile" of menu "Shell" of menu bar item "Shell" of menu bar 1
93 click 94 click
94 end tell 95 end tell
95 end tell 96 end tell
96 keystroke "${command}; clear;" 97 keystroke "${command}; clear;"
97 keystroke return 98 keystroke return
98 end tell 99 end tell
99 EOF 100 EOF
100 } 101 }
101 } 102 }
102 103
103 function pfd() { 104 function pfd() {
104 osascript 2>/dev/null <<EOF 105 osascript 2>/dev/null <<EOF
105 tell application "Finder" 106 tell application "Finder"
106 return POSIX path of (target of window 1 as alias) 107 return POSIX path of (target of window 1 as alias)
107 end tell 108 end tell
108 EOF 109 EOF
109 } 110 }
110 111
111 function pfs() { 112 function pfs() {
112 osascript 2>/dev/null <<EOF 113 osascript 2>/dev/null <<EOF
113 set output to "" 114 set output to ""
114 tell application "Finder" to set the_selection to selection 115 tell application "Finder" to set the_selection to selection
115 set item_count to count the_selection 116 set item_count to count the_selection
116 repeat with item_index from 1 to count the_selection 117 repeat with item_index from 1 to count the_selection
117 if item_index is less than item_count then set the_delimiter to "\n" 118 if item_index is less than item_count then set the_delimiter to "\n"
118 if item_index is item_count then set the_delimiter to "" 119 if item_index is item_count then set the_delimiter to ""
119 set output to output & ((item item_index of the_selection as alias)'s POSIX path) & the_delimiter 120 set output to output & ((item item_index of the_selection as alias)'s POSIX path) & the_delimiter
120 end repeat 121 end repeat
121 EOF 122 EOF
122 } 123 }
123 124
124 function cdf() { 125 function cdf() {
125 cd "$(pfd)" 126 cd "$(pfd)"
126 } 127 }
127 128
128 function pushdf() { 129 function pushdf() {
129 pushd "$(pfd)" 130 pushd "$(pfd)"
130 } 131 }
131 132
132 function quick-look() { 133 function quick-look() {
133 (( $# > 0 )) && qlmanage -p $* &>/dev/null & 134 (( $# > 0 )) && qlmanage -p $* &>/dev/null &
134 } 135 }
135 136
136 function man-preview() { 137 function man-preview() {
137 man -t "$@" | open -f -a Preview 138 man -t "$@" | open -f -a Preview
138 } 139 }
139 140
140 function trash() { 141 function trash() {
141 local trash_dir="${HOME}/.Trash" 142 local trash_dir="${HOME}/.Trash"
142 local temp_ifs="$IFS" 143 local temp_ifs="$IFS"
143 IFS=$'\n' 144 IFS=$'\n'
144 for item in "$@"; do 145 for item in "$@"; do
145 if [[ -e "$item" ]]; then 146 if [[ -e "$item" ]]; then
146 item_name="$(basename $item)" 147 item_name="$(basename $item)"
147 if [[ -e "${trash_dir}/${item_name}" ]]; then 148 if [[ -e "${trash_dir}/${item_name}" ]]; then
148 mv -f "$item" "${trash_dir}/${item_name} $(date "+%H-%M-%S")" 149 mv -f "$item" "${trash_dir}/${item_name} $(date "+%H-%M-%S")"
149 else 150 else
150 mv -f "$item" "${trash_dir}/" 151 mv -f "$item" "${trash_dir}/"
151 fi 152 fi
152 fi 153 fi
153 done 154 done
154 IFS=$temp_ifs 155 IFS=$temp_ifs
155 } 156 }
156 157
157 function vncviewer() { 158 function vncviewer() {
158 open vnc://$@ 159 open vnc://$@
159 } 160 }
160 161
161 # iTunes control function 162 # iTunes control function
162 function itunes() { 163 function itunes() {
163 local opt=$1 164 local opt=$1
164 shift 165 shift
165 case "$opt" in 166 case "$opt" in
166 launch|play|pause|stop|rewind|resume|quit) 167 launch|play|pause|stop|rewind|resume|quit)
167 ;; 168 ;;
168 mute) 169 mute)
169 opt="set mute to true" 170 opt="set mute to true"
170 ;; 171 ;;
171 unmute) 172 unmute)
172 opt="set mute to false" 173 opt="set mute to false"
173 ;; 174 ;;
174 next|previous) 175 next|previous)
175 opt="$opt track" 176 opt="$opt track"
176 ;; 177 ;;
177 vol) 178 vol)
178 opt="set sound volume to $1" #$1 Due to the shift 179 opt="set sound volume to $1" #$1 Due to the shift
179 ;; 180 ;;
180 shuf|shuff|shuffle) 181 shuf|shuff|shuffle)
181 # The shuffle property of current playlist can't be changed in iTunes 12, 182 # The shuffle property of current playlist can't be changed in iTunes 12,
182 # so this workaround uses AppleScript to simulate user input instead. 183 # so this workaround uses AppleScript to simulate user input instead.
183 # Defaults to toggling when no options are given. 184 # Defaults to toggling when no options are given.
184 # The toggle option depends on the shuffle button being visible in the Now playing area. 185 # The toggle option depends on the shuffle button being visible in the Now playing area.
185 # On and off use the menu bar items. 186 # On and off use the menu bar items.
186 local state=$1 187 local state=$1
187 188
188 if [[ -n "$state" && ! "$state" =~ "^(on|off|toggle)$" ]] 189 if [[ -n "$state" && ! "$state" =~ "^(on|off|toggle)$" ]]
189 then 190 then
190 print "Usage: itunes shuffle [on|off|toggle]. Invalid option." 191 print "Usage: itunes shuffle [on|off|toggle]. Invalid option."
191 return 1 192 return 1
192 fi 193 fi
193 194
194 case "$state" in 195 case "$state" in
195 on|off) 196 on|off)
196 # Inspired by: http://stackoverflow.com/a/14675583 197 # Inspired by: http://stackoverflow.com/a/14675583
197 osascript 1>/dev/null 2>&1 <<-EOF 198 osascript 1>/dev/null 2>&1 <<-EOF
198 tell application "System Events" to perform action "AXPress" of (menu item "${state}" of menu "Shuffle" of menu item "Shuffle" of menu "Controls" of menu bar item "Controls" of menu bar 1 of application process "iTunes" ) 199 tell application "System Events" to perform action "AXPress" of (menu item "${state}" of menu "Shuffle" of menu item "Shuffle" of menu "Controls" of menu bar item "Controls" of menu bar 1 of application process "iTunes" )
199 EOF 200 EOF
200 return 0 201 return 0
201 ;; 202 ;;
202 toggle|*) 203 toggle|*)
203 osascript 1>/dev/null 2>&1 <<-EOF 204 osascript 1>/dev/null 2>&1 <<-EOF
204 tell application "System Events" to perform action "AXPress" of (button 2 of process "iTunes"'s window "iTunes"'s scroll area 1) 205 tell application "System Events" to perform action "AXPress" of (button 2 of process "iTunes"'s window "iTunes"'s scroll area 1)
205 EOF 206 EOF
206 return 0 207 return 0
207 ;; 208 ;;
208 esac 209 esac
209 ;; 210 ;;
210 ""|-h|--help) 211 ""|-h|--help)
211 echo "Usage: itunes <option>" 212 echo "Usage: itunes <option>"
212 echo "option:" 213 echo "option:"
213 echo "\tlaunch|play|pause|stop|rewind|resume|quit" 214 echo "\tlaunch|play|pause|stop|rewind|resume|quit"
214 echo "\tmute|unmute\tcontrol volume set" 215 echo "\tmute|unmute\tcontrol volume set"
215 echo "\tnext|previous\tplay next or previous track" 216 echo "\tnext|previous\tplay next or previous track"
216 echo "\tshuf|shuffle [on|off|toggle]\tSet shuffled playback. Default: toggle. Note: toggle doesn't support the MiniPlayer." 217 echo "\tshuf|shuffle [on|off|toggle]\tSet shuffled playback. Default: toggle. Note: toggle doesn't support the MiniPlayer."
217 echo "\tvol\tSet the volume, takes an argument from 0 to 100" 218 echo "\tvol\tSet the volume, takes an argument from 0 to 100"
218 echo "\thelp\tshow this message and exit" 219 echo "\thelp\tshow this message and exit"
219 return 0 220 return 0
220 ;; 221 ;;
221 *) 222 *)
222 print "Unknown option: $opt" 223 print "Unknown option: $opt"
223 return 1 224 return 1
224 ;; 225 ;;
225 esac 226 esac
226 osascript -e "tell application \"iTunes\" to $opt" 227 osascript -e "tell application \"iTunes\" to $opt"
227 } 228 }
228 229
plugins/perl/perl.plugin.zsh
1 # https://github.com/dbbolton 1 # https://github.com/dbbolton
2 # 2 #
3 # Below are some useful Perl-related aliases/functions that I use with zsh. 3 # Below are some useful Perl-related aliases/functions that I use with zsh.
4 4
5 5
6 # Aliases ################################################################### 6 # Aliases ###################################################################
7 7
8 # perlbrew ######## 8 # perlbrew ########
9 alias pbi='perlbrew install' 9 alias pbi='perlbrew install'
10 alias pbl='perlbrew list' 10 alias pbl='perlbrew list'
11 alias pbo='perlbrew off' 11 alias pbo='perlbrew off'
12 alias pbs='perlbrew switch' 12 alias pbs='perlbrew switch'
13 alias pbu='perlbrew use' 13 alias pbu='perlbrew use'
14 14
15 # Perl ############ 15 # Perl ############
16 16
17 # perldoc` 17 # perldoc`
18 alias pd='perldoc' 18 alias pd='perldoc'
19 19
20 # use perl like awk/sed 20 # use perl like awk/sed
21 alias ple='perl -wlne' 21 alias ple='perl -wlne'
22 22
23 # show the latest stable release of Perl 23 # show the latest stable release of Perl
24 alias latest-perl='curl -s http://www.perl.org/get.html | perl -wlne '\''if (/perl\-([\d\.]+)\.tar\.gz/) { print $1; exit;}'\' 24 alias latest-perl='curl -s http://www.perl.org/get.html | perl -wlne '\''if (/perl\-([\d\.]+)\.tar\.gz/) { print $1; exit;}'\'
25 25
26 26
27 27
28 # Functions ################################################################# 28 # Functions #################################################################
29 29
30 # newpl - creates a basic Perl script file and opens it with $EDITOR 30 # newpl - creates a basic Perl script file and opens it with $EDITOR
31 newpl () { 31 newpl () {
32 # set $EDITOR to 'vim' if it is undefined 32 # set $EDITOR to 'vim' if it is undefined
33 [[ -z $EDITOR ]] && EDITOR=vim 33 [[ -z $EDITOR ]] && EDITOR=vim
34 34
35 # if the file exists, just open it 35 # if the file exists, just open it
36 [[ -e $1 ]] && print "$1 exists; not modifying.\n" && $EDITOR $1 36 [[ -e $1 ]] && print "$1 exists; not modifying.\n" && $EDITOR $1
37 37
38 # if it doesn't, make it, and open it 38 # if it doesn't, make it, and open it
39 [[ ! -e $1 ]] && print '#!/usr/bin/perl'"\n"'use strict;'"\n"'use warnings;'\ 39 [[ ! -e $1 ]] && print '#!/usr/bin/perl'"\n"'use strict;'"\n"'use warnings;'\
40 "\n\n" > $1 && $EDITOR $1 40 "\n\n" > $1 && $EDITOR $1
41 } 41 }
42 42
43 43
44 # pgs - Perl Global Substitution 44 # pgs - Perl Global Substitution
45 # find pattern = 1st arg 45 # find pattern = 1st arg
46 # replace pattern = 2nd arg 46 # replace pattern = 2nd arg
47 # filename = 3rd arg 47 # filename = 3rd arg
48 pgs() { # [find] [replace] [filename] 48 pgs() { # [find] [replace] [filename]
49 perl -i.orig -pe 's/'"$1"'/'"$2"'/g' "$3" 49 perl -i.orig -pe 's/'"$1"'/'"$2"'/g' "$3"
50 } 50 }
51 51
52 52
53 # Perl grep, because 'grep -P' is terrible. Lets you work with pipes or files. 53 # Perl grep, because 'grep -P' is terrible. Lets you work with pipes or files.
54 prep() { # [pattern] [filename unless STDOUT] 54 prep() { # [pattern] [filename unless STDOUT]
55 perl -nle 'print if /'"$1"'/;' $2 55 perl -nle 'print if /'"$1"'/;' $2
56 } 56 }
57
58 # say - append a newline to 'print'
59 say() {
60 print "$1\n"
61 }
62
63 57
plugins/rails/rails.plugin.zsh
1 function _rails_command () { 1 function _rails_command () {
2 if [ -e "bin/rails" ]; then 2 if [ -e "bin/rails" ]; then
3 bin/rails $@ 3 bin/rails $@
4 elif [ -e "script/rails" ]; then 4 elif [ -e "script/rails" ]; then
5 ruby script/rails $@ 5 ruby script/rails $@
6 elif [ -e "script/server" ]; then 6 elif [ -e "script/server" ]; then
7 ruby script/$@ 7 ruby script/$@
8 else 8 else
9 command rails $@ 9 command rails $@
10 fi 10 fi
11 } 11 }
12 12
13 function _rake_command () { 13 function _rake_command () {
14 if [ -e "bin/rake" ]; then 14 if [ -e "bin/rake" ]; then
15 bin/rake $@ 15 bin/rake $@
16 else 16 else
17 command rake $@ 17 command rake $@
18 fi 18 fi
19 } 19 }
20 20
21 alias rails='_rails_command' 21 alias rails='_rails_command'
22 compdef _rails_command=rails 22 compdef _rails_command=rails
23 23
24 alias rake='_rake_command' 24 alias rake='_rake_command'
25 compdef _rake_command=rake 25 compdef _rake_command=rake
26 26
27 alias devlog='tail -f log/development.log' 27 alias devlog='tail -f log/development.log'
28 alias prodlog='tail -f log/production.log' 28 alias prodlog='tail -f log/production.log'
29 alias testlog='tail -f log/test.log' 29 alias testlog='tail -f log/test.log'
30 30
31 alias -g RED='RAILS_ENV=development' 31 alias -g RED='RAILS_ENV=development'
32 alias -g REP='RAILS_ENV=production' 32 alias -g REP='RAILS_ENV=production'
33 alias -g RET='RAILS_ENV=test' 33 alias -g RET='RAILS_ENV=test'
34 34
35 # Rails aliases 35 # Rails aliases
36 alias rc='rails console' 36 alias rc='rails console'
37 alias rd='rails destroy' 37 alias rd='rails destroy'
38 alias rdb='rails dbconsole' 38 alias rdb='rails dbconsole'
39 alias rg='rails generate' 39 alias rg='rails generate'
40 alias rgm='rails generate migration' 40 alias rgm='rails generate migration'
41 alias rp='rails plugin' 41 alias rp='rails plugin'
42 alias ru='rails runner' 42 alias ru='rails runner'
43 alias rs='rails server' 43 alias rs='rails server'
44 alias rsd='rails server --debugger' 44 alias rsd='rails server --debugger'
45 45
46 # Rake aliases 46 # Rake aliases
47 alias rdm='rake db:migrate' 47 alias rdm='rake db:migrate'
48 alias rdms='rake db:migrate:status'
48 alias rdr='rake db:rollback' 49 alias rdr='rake db:rollback'
49 alias rdc='rake db:create' 50 alias rdc='rake db:create'
50 alias rds='rake db:seed' 51 alias rds='rake db:seed'
51 alias rdd='rake db:drop' 52 alias rdd='rake db:drop'
52 alias rdtc='rake db:test:clone' 53 alias rdtc='rake db:test:clone'
53 alias rdtp='rake db:test:prepare' 54 alias rdtp='rake db:test:prepare'
54 alias rdmtc='rake db:migrate db:test:clone' 55 alias rdmtc='rake db:migrate db:test:clone'
55 56
56 alias rlc='rake log:clear' 57 alias rlc='rake log:clear'
57 alias rn='rake notes' 58 alias rn='rake notes'
58 alias rr='rake routes' 59 alias rr='rake routes'
59 60
60 # legacy stuff 61 # legacy stuff
61 alias ss='thin --stats "/thin/stats" start' 62 alias ss='thin --stats "/thin/stats" start'
62 alias sg='ruby script/generate' 63 alias sg='ruby script/generate'
63 alias sd='ruby script/destroy' 64 alias sd='ruby script/destroy'
64 alias sp='ruby script/plugin' 65 alias sp='ruby script/plugin'
65 alias sr='ruby script/runner' 66 alias sr='ruby script/runner'
66 alias ssp='ruby script/spec' 67 alias ssp='ruby script/spec'
67 alias sc='ruby script/console' 68 alias sc='ruby script/console'
68 alias sd='ruby script/server --debugger' 69 alias sd='ruby script/server --debugger'
69 70
70 function remote_console() { 71 function remote_console() {
71 /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )" 72 /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )"
72 } 73 }
73 74
plugins/sublime/sublime.plugin.zsh
1 # Sublime Text 2 Aliases 1 # Sublime Text 2 Aliases
2 2
3 if [[ $('uname') == 'Linux' ]]; then 3 if [[ $('uname') == 'Linux' ]]; then
4 local _sublime_linux_paths > /dev/null 2>&1 4 local _sublime_linux_paths > /dev/null 2>&1
5 _sublime_linux_paths=( 5 _sublime_linux_paths=(
6 "$HOME/bin/sublime_text" 6 "$HOME/bin/sublime_text"
7 "/opt/sublime_text/sublime_text" 7 "/opt/sublime_text/sublime_text"
8 "/usr/bin/sublime_text" 8 "/usr/bin/sublime_text"
9 "/usr/local/bin/sublime_text" 9 "/usr/local/bin/sublime_text"
10 "/usr/bin/subl" 10 "/usr/bin/subl"
11 ) 11 )
12 for _sublime_path in $_sublime_linux_paths; do 12 for _sublime_path in $_sublime_linux_paths; do
13 if [[ -a $_sublime_path ]]; then 13 if [[ -a $_sublime_path ]]; then
14 st_run() { $_sublime_path $@ >/dev/null 2>&1 &| } 14 st_run() { $_sublime_path $@ >/dev/null 2>&1 &| }
15 st_run_sudo() {sudo $_sublime_path $@ >/dev/null 2>&1}
16 alias sst=st_run_sudo
15 alias st=st_run 17 alias st=st_run
16 break 18 break
17 fi 19 fi
18 done 20 done
19 21
20 elif [[ "$OSTYPE" = darwin* ]]; then 22 elif [[ "$OSTYPE" = darwin* ]]; then
21 local _sublime_darwin_paths > /dev/null 2>&1 23 local _sublime_darwin_paths > /dev/null 2>&1
22 _sublime_darwin_paths=( 24 _sublime_darwin_paths=(
23 "/usr/local/bin/subl" 25 "/usr/local/bin/subl"
24 "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" 26 "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
25 "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl" 27 "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
26 "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" 28 "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
27 "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" 29 "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
28 "$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl" 30 "$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
29 "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" 31 "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
30 ) 32 )
31 33
32 for _sublime_path in $_sublime_darwin_paths; do 34 for _sublime_path in $_sublime_darwin_paths; do
33 if [[ -a $_sublime_path ]]; then 35 if [[ -a $_sublime_path ]]; then
34 alias subl="'$_sublime_path'" 36 alias subl="'$_sublime_path'"
35 alias st=subl 37 alias st=subl
36 break 38 break
37 fi 39 fi
38 done 40 done
39 fi 41 fi
40 42
41 alias stt='st .' 43 alias stt='st .'
42 44
plugins/symfony2/symfony2.plugin.zsh
1 # Symfony2 basic command completion 1 # Symfony2 basic command completion
2 2
3 _symfony_console () { 3 _symfony_console () {
4 echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)" 4 echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)"
5 } 5 }
6 6
7 _symfony2_get_command_list () { 7 _symfony2_get_command_list () {
8 `_symfony_console` --no-ansi | sed "1,/Available commands/d" | awk '/^ ?[a-z]+/ { print $1 }' 8 `_symfony_console` --no-ansi | sed "1,/Available commands/d" | awk '/^ ?[a-z]+/ { print $1 }'
9 } 9 }
10 10
11 _symfony2 () { 11 _symfony2 () {
12 compadd `_symfony2_get_command_list` 12 compadd `_symfony2_get_command_list`
13 } 13 }
14 14
15 compdef _symfony2 '`_symfony_console`' 15 compdef _symfony2 '`_symfony_console`'
16 compdef _symfony2 'app/console' 16 compdef _symfony2 'app/console'
17 compdef _symfony2 'bin/console' 17 compdef _symfony2 'bin/console'
18 compdef _symfony2 sf 18 compdef _symfony2 sf
19 19
20 #Alias 20 #Alias
21 alias sf='`_symfony_console`' 21 alias sf='`_symfony_console`'
22 alias sfcl='sf cache:clear' 22 alias sfcl='sf cache:clear'
23 alias sfsr='sf server:run -vvv'
23 alias sfcw='sf cache:warmup' 24 alias sfcw='sf cache:warmup'
24 alias sfroute='sf router:debug' 25 alias sfroute='sf router:debug'
25 alias sfcontainer='sf container:debug' 26 alias sfcontainer='sf container:debug'
26 alias sfgb='sf generate:bundle' 27 alias sfgb='sf generate:bundle'
27 28
plugins/taskwarrior/_task
1 #compdef task 1 #compdef task
2 # zsh completion for taskwarrior 2 # zsh completion for taskwarrior
3 # 3 #
4 # taskwarrior - a command line task list manager. 4 # taskwarrior - a command line task list manager.
5 # 5 #
6 # Copyright 2010 - 2011 Johannes Schlatow 6 # Copyright 2010 - 2011 Johannes Schlatow
7 # Copyright 2009 P.C. Shyamshankar 7 # Copyright 2009 P.C. Shyamshankar
8 # 8 #
9 # Permission is hereby granted, free of charge, to any person obtaining a copy 9 # Permission is hereby granted, free of charge, to any person obtaining a copy
10 # of this software and associated documentation files (the "Software"), to deal 10 # of this software and associated documentation files (the "Software"), to deal
11 # in the Software without restriction, including without limitation the rights 11 # in the Software without restriction, including without limitation the rights
12 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 # copies of the Software, and to permit persons to whom the Software is 13 # copies of the Software, and to permit persons to whom the Software is
14 # furnished to do so, subject to the following conditions: 14 # furnished to do so, subject to the following conditions:
15 # 15 #
16 # The above copyright notice and this permission notice shall be included 16 # The above copyright notice and this permission notice shall be included
17 # in all copies or substantial portions of the Software. 17 # in all copies or substantial portions of the Software.
18 # 18 #
19 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 21 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 # SOFTWARE. 25 # SOFTWARE.
26 # 26 #
27 # http://www.opensource.org/licenses/mit-license.php 27 # http://www.opensource.org/licenses/mit-license.php
28 # 28 #
29 typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers 29 typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers
30 _task_projects=($(task _projects)) 30 _task_projects=($(task _projects))
31 _task_tags=($(task _tags)) 31 _task_tags=($(task _tags))
32 _task_ids=($(task _ids)) 32 _task_ids=($(task _ids))
33 _task_config=($(task _config)) 33 _task_config=($(task _config))
34 _task_columns=($(task _columns)) 34 _task_columns=($(task _columns))
35 _task_modifiers=( 35 _task_modifiers=(
36 'before' \ 36 'before' \
37 'after' \ 37 'after' \
38 'none' \ 38 'none' \
39 'any' \ 39 'any' \
40 'is' \ 40 'is' \
41 'isnt' \ 41 'isnt' \
42 'has' \ 42 'has' \
43 'hasnt' \ 43 'hasnt' \
44 'startswith' \ 44 'startswith' \
45 'endswith' \ 45 'endswith' \
46 'word' \ 46 'word' \
47 'noword' 47 'noword'
48 ) 48 )
49 _task_conjunctions=( 49 _task_conjunctions=(
50 'and' \ 50 'and' \
51 'or' \ 51 'or' \
52 'xor' \ 52 'xor' \
53 '\)' 53 '\)'
54 '\(' 54 '\('
55 ) 55 )
56 _task_cmds=($(task _commands)) 56 _task_cmds=($(task _commands))
57 _task_zshcmds=( ${(f)"$(task _zshcommands)"} ) 57 _task_zshcmds=( ${(f)"$(task _zshcommands)"} )
58 58
59 _task() { 59 _task() {
60 _arguments -s -S \ 60 _arguments -s -S \
61 "*::task default:_task_default" 61 "*::task default:_task_default"
62 return 0 62 return 0
63 } 63 }
64 64
65 local -a reply args word 65 local -a reply args word
66 word=$'[^\0]#\0' 66 word=$'[^\0]#\0'
67 67
68 # priorities 68 # priorities
69 local -a task_priorities 69 local -a task_priorities
70 _regex_words values 'task priorities' \ 70 _regex_words values 'task priorities' \
71 'H:High' \ 71 'H:High' \
72 'M:Middle' \ 72 'M:Middle' \
73 'L:Low' 73 'L:Low'
74 task_priorities=("$reply[@]") 74 task_priorities=("$reply[@]")
75 75
76 # projects 76 # projects
77 local -a task_projects 77 local -a task_projects
78 task_projects=( 78 task_projects=(
79 /"$word"/ 79 /"$word"/
80 ":values:task projects:compadd -a _task_projects" 80 ":values:task projects:compadd -a _task_projects"
81 ) 81 )
82 82
83 local -a _task_dates 83 local -a _task_dates
84 _regex_words values 'task dates' \ 84 _regex_words values 'task dates' \
85 'tod*ay:Today' \ 85 'tod*ay:Today' \
86 'yes*terday:Yesterday' \ 86 'yes*terday:Yesterday' \
87 'tom*orrow:Tomorrow' \ 87 'tom*orrow:Tomorrow' \
88 'sow:Start of week' \ 88 'sow:Start of week' \
89 'soww:Start of work week' \ 89 'soww:Start of work week' \
90 'socw:Start of calendar week' \ 90 'socw:Start of calendar week' \
91 'som:Start of month' \ 91 'som:Start of month' \
92 'soy:Start of year' \ 92 'soy:Start of year' \
93 'eow:End of week' \ 93 'eow:End of week' \
94 'eoww:End of work week' \ 94 'eoww:End of work week' \
95 'eocw:End of calendar week' \ 95 'eocw:End of calendar week' \
96 'eom:End of month' \ 96 'eom:End of month' \
97 'eoy:End of year' \ 97 'eoy:End of year' \
98 'mon:Monday' \ 98 'mon:Monday' \
99 'tue:Tuesday'\ 99 'tue:Tuesday'\
100 'wed:Wednesday' \ 100 'wed:Wednesday' \
101 'thu:Thursday' \ 101 'thu:Thursday' \
102 'fri:Friday' \ 102 'fri:Friday' \
103 'sat:Saturday' \ 103 'sat:Saturday' \
104 'sun:Sunday' 104 'sun:Sunday'
105 _task_dates=("$reply[@]") 105 _task_dates=("$reply[@]")
106 106
107 local -a _task_reldates 107 local -a _task_reldates
108 _regex_words values 'task reldates' \ 108 _regex_words values 'task reldates' \
109 'hrs:n hours' \ 109 'hrs:n hours' \
110 'day:n days' \ 110 'day:n days' \
111 '1st:first' \ 111 '1st:first' \
112 '2nd:second' \ 112 '2nd:second' \
113 '3rd:third' \ 113 '3rd:third' \
114 'th:4th, 5th, etc.' \ 114 'th:4th, 5th, etc.' \
115 'wks:weeks' 115 'wks:weeks'
116 _task_reldates=("$reply[@]") 116 _task_reldates=("$reply[@]")
117 117
118 task_dates=( 118 task_dates=(
119 \( "$_task_dates[@]" \| 119 \( "$_task_dates[@]" \|
120 \( /$'[0-9][0-9]#'/- \( "$_task_reldates[@]" \) \) 120 \( /$'[0-9][0-9]#'/- \( "$_task_reldates[@]" \) \)
121 \) 121 \)
122 ) 122 )
123 123
124 _regex_words values 'task frequencies' \ 124 _regex_words values 'task frequencies' \
125 'daily:Every day' \ 125 'daily:Every day' \
126 'day:Every day' \ 126 'day:Every day' \
127 'weekdays:Every day skipping weekend days' \ 127 'weekdays:Every day skipping weekend days' \
128 'weekly:Every week' \ 128 'weekly:Every week' \
129 'biweekly:Every two weeks' \ 129 'biweekly:Every two weeks' \
130 'fortnight:Every two weeks' \ 130 'fortnight:Every two weeks' \
131 + 'monthly:Every month' \ 131 + 'monthly:Every month' \
132 'quarterly:Every three months' \ 132 'quarterly:Every three months' \
133 'semiannual:Every six months' \ 133 'semiannual:Every six months' \
134 'annual:Every year' \ 134 'annual:Every year' \
135 'yearly:Every year' \ 135 'yearly:Every year' \
136 'biannual:Every two years' \ 136 'biannual:Every two years' \
137 'biyearly:Every two years' 137 'biyearly:Every two years'
138 _task_freqs=("$reply[@]") 138 _task_freqs=("$reply[@]")
139 139
140 local -a _task_frequencies 140 local -a _task_frequencies
141 _regex_words values 'task frequencies' \ 141 _regex_words values 'task frequencies' \
142 'd:days' \ 142 'd:days' \
143 'w:weeks' \ 143 'w:weeks' \
144 'q:quarters' \ 144 'q:quarters' \
145 'y:years' 145 'y:years'
146 _task_frequencies=("$reply[@]") 146 _task_frequencies=("$reply[@]")
147 147
148 task_freqs=( 148 task_freqs=(
149 \( "$_task_freqs[@]" \| 149 \( "$_task_freqs[@]" \|
150 \( /$'[0-9][0-9]#'/- \( "$_task_frequencies[@]" \) \) 150 \( /$'[0-9][0-9]#'/- \( "$_task_frequencies[@]" \) \)
151 \) 151 \)
152 ) 152 )
153 153
154 # attributes 154 # attributes
155 local -a task_attributes 155 local -a task_attributes
156 _regex_words -t ':' default 'task attributes' \ 156 _regex_words -t ':' default 'task attributes' \
157 'pro*ject:Project name:$task_projects' \ 157 'pro*ject:Project name:$task_projects' \
158 'du*e:Due date:$task_dates' \ 158 'du*e:Due date:$task_dates' \
159 'wa*it:Date until task becomes pending:$task_dates' \ 159 'wa*it:Date until task becomes pending:$task_dates' \
160 're*cur:Recurrence frequency:$task_freqs' \ 160 're*cur:Recurrence frequency:$task_freqs' \
161 'pri*ority:priority:$task_priorities' \ 161 'pri*ority:priority:$task_priorities' \
162 'un*til:Recurrence end date:$task_dates' \ 162 'un*til:Recurrence end date:$task_dates' \
163 'fg:Foreground color' \ 163 'fg:Foreground color' \
164 'bg:Background color' \ 164 'bg:Background color' \
165 'li*mit:Desired number of rows in report' 165 'li*mit:Desired number of rows in report'
166 task_attributes=("$reply[@]") 166 task_attributes=("$reply[@]")
167 167
168 args=( 168 args=(
169 \( "$task_attributes[@]" \| 169 \( "$task_attributes[@]" \|
170 \( /'(project|due|wait|recur|priority|until|fg|bg|limit).'/- \( /$'[^:]#:'/ ":default:modifiers:compadd -S ':' -a _task_modifiers" \) \) \| 170 \( /'(project|due|wait|recur|priority|until|fg|bg|limit).'/- \( /$'[^:]#:'/ ":default:modifiers:compadd -S ':' -a _task_modifiers" \) \) \|
171 \( /'(rc).'/- \( /$'[^:]#:'/ ":arguments:config:compadd -S ':' -a _task_config" \) \) \| 171 \( /'(rc).'/- \( /$'[^:]#:'/ ":arguments:config:compadd -S ':' -a _task_config" \) \) \|
172 \( /'(+|-)'/- \( /"$word"/ ":values:remove tag:compadd -a _task_tags" \) \) \| 172 \( /'(+|-)'/- \( /"$word"/ ":values:remove tag:compadd -a _task_tags" \) \) \|
173 \( /"$word"/ \) 173 \( /"$word"/ \)
174 \) \# 174 \) \#
175 ) 175 )
176 _regex_arguments _task_attributes "${args[@]}" 176 _regex_arguments _task_attributes "${args[@]}"
177 177
178 ## task commands 178 ## task commands
179 179
180 # filter completion 180 # filter completion
181 (( $+functions[_task_filter] )) || 181 (( $+functions[_task_filter] )) ||
182 _task_filter() { 182 _task_filter() {
183 _task_attributes "$@" 183 _task_attributes "$@"
184 184
185 # TODO complete conjunctions only if the previous word is a filter expression, i.e. attribute, ID, any non-command 185 # TODO complete conjunctions only if the previous word is a filter expression, i.e. attribute, ID, any non-command
186 _describe -t default 'task conjunctions' _task_conjunctions 186 _describe -t default 'task conjunctions' _task_conjunctions
187 } 187 }
188 188
189 # merge completion 189 # merge completion
190 (( $+functions[_task_merge] )) || 190 (( $+functions[_task_merge] )) ||
191 _task_merge() { 191 _task_merge() {
192 # TODO match URIs in .taskrc 192 # TODO match URIs in .taskrc
193 _files 193 _files
194 } 194 }
195 195
196 # push completion 196 # push completion
197 (( $+functions[_task_push] )) || 197 (( $+functions[_task_push] )) ||
198 _task_push() { 198 _task_push() {
199 # TODO match URIs in .taskrc 199 # TODO match URIs in .taskrc
200 _files 200 _files
201 } 201 }
202 202
203 # pull completion 203 # pull completion
204 (( $+functions[_task_pull] )) || 204 (( $+functions[_task_pull] )) ||
205 _task_pull() { 205 _task_pull() {
206 # TODO match URIs in .taskrc 206 # TODO match URIs in .taskrc
207 _files 207 _files
208 } 208 }
209 209
210 # execute completion 210 # execute completion
211 (( $+functions[_task_execute] )) || 211 (( $+functions[_task_execute] )) ||
212 _task_execute() { 212 _task_execute() {
213 _files 213 _files
214 } 214 }
215 215
216 # id-only completion 216 # id-only completion
217 (( $+functions[_task_id] )) || 217 (( $+functions[_task_id] )) ||
218 _task_id() { 218 _task_id() {
219 _describe -t values 'task IDs' _task_zshids 219 _describe -t values 'task IDs' _task_zshids
220 } 220 }
221 221
222 ## first level completion => task sub-command completion 222 ## first level completion => task sub-command completion
223 (( $+functions[_task_default] )) || 223 (( $+functions[_task_default] )) ||
224 _task_default() { 224 _task_default() {
225 local cmd ret=1 225 local cmd ret=1
226 226
227 integer i=1 227 integer i=1
228 while (( i < $#words )) 228 while (( i < $#words ))
229 do 229 do
230 cmd="${_task_cmds[(r)$words[$i]]}" 230 cmd="${_task_cmds[(r)$words[$i]]}"
231 if (( $#cmd )); then 231 if (( $#cmd )); then
232 _call_function ret _task_${cmd} || 232 _call_function ret _task_${cmd} ||
233 _call_function ret _task_filter || 233 _call_function ret _task_filter ||
234 _message "No command remaining." 234 _message "No command remaining."
235 return ret 235 return ret
236 fi 236 fi
237 (( i++ )) 237 (( i++ ))
238 done 238 done
239 239
240 # update IDs 240 # update IDs
241 _task_zshids=( ${(f)"$(task _zshids)"} ) 241 _task_zshids=( ${(f)"$(task _zshids)"} )
242 242
243 _describe -t commands 'task command' _task_zshcmds 243 _describe -t commands 'task command' _task_zshcmds
244 _describe -t values 'task IDs' _task_zshids 244 _describe -t values 'task IDs' _task_zshids
245 _call_function ret _task_filter 245 _call_function ret _task_filter
246 246
247 return ret 247 return ret
248 } 248 }
249
250 _task
249 251
plugins/tmuxinator/_tmuxinator
1 #compdef tmuxinator mux 1 #compdef tmuxinator mux
2 #autoload 2 #autoload
3 3
4 local curcontext="$curcontext" state line ret=1 4 local curcontext="$curcontext" state line ret=1
5 local -a _configs 5 local -a _configs
6 6
7 _arguments -C \ 7 _arguments -C \
8 '1: :->cmds' \ 8 '1: :->cmds' \
9 '2:: :->args' && ret=0 9 '2:: :->args' && ret=0
10 10
11 _configs=(${$(echo ~/.tmuxinator/*.yml):r:t})
12
11 case $state in 13 case $state in
12 cmds) 14 cmds)
13 _values "tmuxinator command" \ 15 _values "tmuxinator command" \
14 "new[create a new project file and open it in your editor]" \ 16 "new[create a new project file and open it in your editor]" \
15 "start[start a tmux session using project's tmuxinator config]" \ 17 "start[start a tmux session using project's tmuxinator config]" \
16 "open[create a new project file and open it in your editor]" \ 18 "open[create a new project file and open it in your editor]" \
17 "copy[copy source_project project file to a new project called new_project]" \ 19 "copy[copy source_project project file to a new project called new_project]" \
18 "delete[deletes the project called project_name]" \ 20 "delete[deletes the project called project_name]" \
19 "debug[output the shell commands generated by a projet]" \ 21 "debug[output the shell commands generated by a projet]" \
20 "implode[deletes all existing projects!]" \ 22 "implode[deletes all existing projects!]" \
21 "list[list all existing projects]" \ 23 "list[list all existing projects]" \
22 "doctor[look for problems in your configuration]" \ 24 "doctor[look for problems in your configuration]" \
23 "help[shows this help document]" \ 25 "help[shows this help document]" \
24 "version[shows tmuxinator version number]" 26 "version[shows tmuxinator version number]" \
27 $_configs
25 ret=0 28 ret=0
26 ;; 29 ;;
27 args) 30 args)
28 case $line[1] in 31 case $line[1] in
29 start|open|copy|delete|debug) 32 start|open|copy|delete|debug)
30 _configs=(`find ~/.tmuxinator -name \*.yml | cut -d/ -f5 | sed s:.yml::g`)
31 [[ -n "$_configs" ]] && _values 'configs' $_configs 33 [[ -n "$_configs" ]] && _values 'configs' $_configs
32 ret=0 34 ret=0
33 ;; 35 ;;
34 esac 36 esac
35 ;; 37 ;;
36 esac 38 esac
37 39
38 return ret 40 return ret
plugins/ubuntu/readme.md
File was created 1 This plugin was created because the aliases in the debian plugin are inconsistent and hard to remember. Also this apt-priority detection that switched between apt-get and aptitude was dropped to keep it simpler. This plugin uses apt-get for everything but a few things that are only possible with aptitude I guess. Ubuntu does not have aptitude installed by default.
2
3 acs = Apt-Cache Search
4 acp = Apt-Cache Policy
5
6 ag = sudo Apt-Get
7 agi = sudo Apt-Get Install
8 agd = sudo Apt-Get Dselect-upgrade
9 By now you already can guess almost all aliases
10
11 There are two exeptions since ...
12 agu = sudo Apt-Get Update - we have ...
13 agug = sudo Apt-Get UpGrade - as the exeptional 4 letter alias for a single command.
14
15 afs = Apt-File Search --regexp - this has the regexp switch on without being represented in the alias, I guess this makes sense since the debian plugin has it, I never used that command.
16
17 Then there are the 2 other 4 letter aliases for combined commands, that are straight forward and easy to remember.
18 aguu = sudo Apt-Get Update && sudo apt-get Upgrade - better then adg or not?
19 agud = sudo Apt-Get Update && sudo apt-get Dist-upgrade
20
21 For a full list aliases and the functions just watch the plugins code https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/ubuntu/ubuntu.plugin.zsh, look at the comments if you want to switch from the debian plugin. Ubuntu, Mint and & co users will like the new aar function to install packages from ppas with a single command.
22
plugins/ubuntu/ubuntu.plugin.zsh
File was created 1 # Authors:
2 # https://github.com/AlexBio
3 # https://github.com/dbb
4 # https://github.com/Mappleconfusers
5 # Nicolas Jonas nextgenthemes.com
6 #
7 # Debian, Ubuntu and friends related zsh aliases and functions for zsh
8
9 alias acs='apt-cache search'
10 compdef _acs acs='apt-cache search'
11
12 alias afs='apt-file search --regexp'
13 compdef _afs afs='apt-file search --regexp'
14
15 # These are apt-get only
16 alias ags='apt-get source' # asrc
17 compdef _ags ags='apt-get source'
18
19 alias acp='apt-cache policy' # app
20 compdef _acp acp='apt-cache policy'
21
22 # superuser operations ######################################################
23 alias afu='sudo apt-file update'
24 compdef _afu afu='sudo apt-file update'
25
26 alias ppap='sudo ppa-purge'
27 compdef _ppap ppap='sudo ppa-purge'
28
29 alias ag='sudo apt-get' # age - but without sudo
30 alias aga='sudo apt-get autoclean' # aac
31 alias agb='sudo apt-get build-dep' # abd
32 alias agc='sudo apt-get clean' # adc
33 alias agd='sudo apt-get dselect-upgrade' # ads
34 alias agi='sudo apt-get install' # ai
35 alias agp='sudo apt-get purge' # ap
36 alias agr='sudo apt-get remove' # ar
37 alias agu='sudo apt-get update' # ad
38 alias agud='sudo apt-get update && sudo apt-get dist-upgrade' #adu
39 alias agug='sudo apt-get upgrade' # ag
40 alias aguu='sudo apt-get update && sudo apt-get upgrade' #adg
41
42 compdef _ag ag='sudo apt-get'
43 compdef _aga aga='sudo apt-get autoclean'
44 compdef _agb agb='sudo apt-get build-dep'
45 compdef _agc agc='sudo apt-get clean'
46 compdef _agd agd='sudo apt-get dselect-upgrade'
47 compdef _agi agi='sudo apt-get install'
48 compdef _agp agp='sudo apt-get purge'
49 compdef _agr agr='sudo apt-get remove'
50 compdef _agu agu='sudo apt-get update'
51 compdef _agud agud='sudo apt-get update && sudo apt-get dist-upgrade'
52 compdef _agug agug='sudo apt-get upgrade'
53 compdef _aguu aguu='sudo apt-get update && sudo apt-get upgrade'
54
55 # Remove ALL kernel images and headers EXCEPT the one in use
56 alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \
57 ?not(~n`uname -r`))'
58
59 # Misc. #####################################################################
60 # print all installed packages
61 alias allpkgs='aptitude search -F "%p" --disable-columns ~i'
62
63 # Create a basic .deb package
64 alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc'
65
66 # apt-add-repository with automatic install/upgrade of the desired package
67 # Usage: aar ppa:xxxxxx/xxxxxx [packagename]
68 # If packagename is not given as 2nd arument the function will ask for it and guess the defaupt by taking
69 # the part after the / from the ppa name wich is sometimes the right name for the package you want to install
70 aar() {
71 if [ -n "$2" ]; then
72 PACKAGE=$2
73 else
74 read "PACKAGE?Type in the package name to install/upgrade with this ppa [${1##*/}]: "
75 fi
76
77 if [ -z "$PACKAGE" ]; then
78 PACKAGE=${1##*/}
79 fi
80
81 sudo apt-add-repository $1 && sudo apt-get update
82 sudo apt-get install $PACKAGE
83 }
84
85 # Prints apt history
86 # Usage:
87 # apt-history install
88 # apt-history upgrade
89 # apt-history remove
90 # apt-history rollback
91 # apt-history list
92 # Based On: http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html
93 apt-history () {
94 case "$1" in
95 install)
96 zgrep --no-filename 'install ' $(ls -rt /var/log/dpkg*)
97 ;;
98 upgrade|remove)
99 zgrep --no-filename $1 $(ls -rt /var/log/dpkg*)
100 ;;
101 rollback)
102 zgrep --no-filename upgrade $(ls -rt /var/log/dpkg*) | \
103 grep "$2" -A10000000 | \
104 grep "$3" -B10000000 | \
105 awk '{print $4"="$5}'
106 ;;
107 list)
108 zcat $(ls -rt /var/log/dpkg*)
109 ;;
110 *)
111 echo "Parameters:"
112 echo " install - Lists all packages that have been installed."
113 echo " upgrade - Lists all packages that have been upgraded."
114 echo " remove - Lists all packages that have been removed."
115 echo " rollback - Lists rollback information."
116 echo " list - Lists all contains of dpkg logs."
117 ;;
118 esac
119 }
120
121 # Kernel-package building shortcut
122 kerndeb () {
123 # temporarily unset MAKEFLAGS ( '-j3' will fail )
124 MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' )
125 print '$MAKEFLAGS set to '"'$MAKEFLAGS'"
126 appendage='-custom' # this shows up in $ (uname -r )
127 revision=$(date +"%Y%m%d") # this shows up in the .deb file name
128
129 make-kpkg clean
130
131 time fakeroot make-kpkg --append-to-version "$appendage" --revision \
132 "$revision" kernel_image kernel_headers
133 }
134
135 # List packages by size
136 function apt-list-packages {
137 dpkg-query -W --showformat='${Installed-Size} ${Package} ${Status}\n' | \
138 grep -v deinstall | \
139 sort -n | \
140 awk '{print $1" "$2}'
141 }
142
plugins/vagrant/_vagrant
1 #compdef vagrant 1 #compdef vagrant
2 #autoload 2 #autoload
3 3
4 # vagrant zsh completion 4 # vagrant zsh completion
5 5
6 local -a _1st_arguments 6 local -a _1st_arguments
7 _1st_arguments=( 7 _1st_arguments=(
8 'box:Box commands' 8 'box:Box commands'
9 'connect:Connects to a shared, remote Vagrant environment' 9 'connect:Connects to a shared, remote Vagrant environment'
10 'destroy:Destroys the vagrant environment' 10 'destroy:Destroys the vagrant environment'
11 'docker-logs:Shows Docker logs' 11 'docker-logs:Shows Docker logs'
12 'docker-run:Run one-off commands against a Docker container' 12 'docker-run:Run one-off commands against a Docker container'
13 'global-status:Reports the status of all active Vagrant environments on the system' 13 'global-status:Reports the status of all active Vagrant environments on the system'
14 'halt:Halts the currently running vagrant environment' 14 'halt:Halts the currently running vagrant environment'
15 'init:[box_name] [box_url] Initializes current folder for Vagrant usage' 15 'init:[box_name] [box_url] Initializes current folder for Vagrant usage'
16 'login:Authenticates against a Vagrant Cloud server to access protected boxes' 16 'login:Authenticates against a Vagrant Cloud server to access protected boxes'
17 'package:Packages a vagrant environment for distribution' 17 'package:Packages a vagrant environment for distribution'
18 'plugin:Plugin commands' 18 'plugin:Plugin commands'
19 'provision:Run the provisioner' 19 'provision:Run the provisioner'
20 'reload:Reload the vagrant environment' 20 'reload:Reload the vagrant environment'
21 'resume:Resumes a suspend vagrant environment' 21 'resume:Resumes a suspend vagrant environment'
22 'share:Shares the Vagrant environment and allows remote access' 22 'share:Shares the Vagrant environment and allows remote access'
23 'ssh:SSH into the currently running environment' 23 'ssh:SSH into the currently running environment'
24 'ssh-config:outputs .ssh/config valid syntax for connecting to this environment via ssh' 24 'ssh-config:outputs .ssh/config valid syntax for connecting to this environment via ssh'
25 'status:Shows the status of the current Vagrant environment' 25 'status:Shows the status of the current Vagrant environment'
26 'suspend:Suspends the currently running vagrant environment' 26 'suspend:Suspends the currently running vagrant environment'
27 'up:Creates the vagrant environment' 27 'up:Creates the vagrant environment'
28 'version:Prints the currently installed Vagrant version and checks for new updates' 28 'version:Prints the currently installed Vagrant version and checks for new updates'
29 '--help:[TASK] Describe available tasks or one specific task' 29 '--help:[TASK] Describe available tasks or one specific task'
30 '--version:Prints the Vagrant version information' 30 '--version:Prints the Vagrant version information'
31 ) 31 )
32 32
33 local -a _box_arguments 33 local -a _box_arguments
34 _box_arguments=( 34 _box_arguments=(
35 'add:NAME URI Add a box to the system' 35 'add:NAME URI Add a box to the system'
36 'help:COMMAND Describe subcommands or one specific subcommand' 36 'help:COMMAND Describe subcommands or one specific subcommand'
37 'list:Lists all installed boxes' 37 'list:Lists all installed boxes'
38 'remove:NAME Remove a box from the system' 38 'remove:NAME Remove a box from the system'
39 'repackage:NAME Repackage an installed box into a `.box` file.' 39 'repackage:NAME Repackage an installed box into a `.box` file.'
40 ) 40 )
41 41
42 __task_list () 42 __task_list ()
43 { 43 {
44 local expl 44 local expl
45 declare -a tasks 45 declare -a tasks
46 46
47 tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version) 47 tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version)
48 48
49 _wanted tasks expl 'help' compadd $tasks 49 _wanted tasks expl 'help' compadd $tasks
50 } 50 }
51 51
52 __box_list () 52 __box_list ()
53 { 53 {
54 _wanted application expl 'command' compadd $(command vagrant box list | sed -e 's/ /\\ /g') 54 _wanted application expl 'command' compadd $(command vagrant box list | sed -e 's/ /\\ /g')
55 } 55 }
56 56
57 __vm_list () 57 __vm_list ()
58 { 58 {
59 _wanted application expl 'command' compadd $(command grep Vagrantfile -oe '^[^#]*\.vm\.define *[:"]\([a-zA-Z0-9_-]\+\)' 2>/dev/null | awk '{print substr($2, 2)}') 59 _wanted application expl 'command' compadd $(command grep Vagrantfile -oe '^[^#]*\.vm\.define *[:"]\([a-zA-Z0-9_-]\+\)' 2>/dev/null | awk '{print substr($2, 2)}')
60 _wanted application expl 'command' compadd $(command ls .vagrant/machines/ 2>/dev/null) 60 _wanted application expl 'command' compadd $(command ls .vagrant/machines/ 2>/dev/null)
61 } 61 }
62 62
63 __vagrant-box () 63 __vagrant-box ()
64 { 64 {
65 local curcontext="$curcontext" state line 65 local curcontext="$curcontext" state line
66 typeset -A opt_args 66 typeset -A opt_args
67 67
68 _arguments -C \ 68 _arguments -C \
69 ':command:->command' \ 69 ':command:->command' \
70 '*::options:->options' 70 '*::options:->options'
71 71
72 case $state in 72 case $state in
73 (command) 73 (command)
74 _describe -t commands "gem subcommand" _box_arguments 74 _describe -t commands "gem subcommand" _box_arguments
75 return 75 return
76 ;; 76 ;;
77 77
78 (options) 78 (options)
79 case $line[1] in 79 case $line[1] in
80 (repackage|remove) 80 (repackage|remove)
81 _arguments ':feature:__box_list' 81 _arguments ':feature:__box_list'
82 ;; 82 ;;
83 esac 83 esac
84 ;; 84 ;;
85 esac 85 esac
86 } 86 }
87 87
88 88
89 89
90 90
91 local expl 91 local expl
92 local -a boxes installed_boxes 92 local -a boxes installed_boxes
93 93
94 local curcontext="$curcontext" state line 94 local curcontext="$curcontext" state line
95 typeset -A opt_args 95 typeset -A opt_args
96 96
97 _arguments -C \ 97 _arguments -C \
98 ':command:->command' \ 98 ':command:->command' \
99 '*::options:->options' 99 '*::options:->options'
100 100
101 case $state in 101 case $state in
102 (command) 102 (command)
103 _describe -t commands "gem subcommand" _1st_arguments 103 _describe -t commands "gem subcommand" _1st_arguments
104 return 104 return
105 ;; 105 ;;
106 106
107 (options) 107 (options)
108 case $line[1] in 108 case $line[1] in
109 (help) 109 (help)
110 _arguments ':feature:__task_list' 110 _arguments ':feature:__task_list'
111 ;; 111 ;;
112 112
113 (box) 113 (box)
114 __vagrant-box 114 __vagrant-box
115 ;; 115 ;;
116 (up|provision|package|destroy|reload|ssh|halt|resume|status) 116 (up|provision|package|destroy|reload|ssh|ssh-config|halt|resume|status)
117 _arguments ':feature:__vm_list' 117 _arguments ':feature:__vm_list'
118 esac 118 esac
119 ;; 119 ;;
120 esac 120 esac
121 121
plugins/vi-mode/vi-mode.plugin.zsh
1 # Ensures that $terminfo values are valid and updates editor information when 1 # Ensures that $terminfo values are valid and updates editor information when
2 # the keymap changes. 2 # the keymap changes.
3 function zle-keymap-select zle-line-init zle-line-finish { 3 function zle-keymap-select zle-line-init zle-line-finish {
4 # The terminal must be in application mode when ZLE is active for $terminfo 4 # The terminal must be in application mode when ZLE is active for $terminfo
5 # values to be valid. 5 # values to be valid.
6 if (( ${+terminfo[smkx]} )); then 6 if (( ${+terminfo[smkx]} )); then
7 printf '%s' ${terminfo[smkx]} 7 printf '%s' ${terminfo[smkx]}
8 fi 8 fi
9 if (( ${+terminfo[rmkx]} )); then 9 if (( ${+terminfo[rmkx]} )); then
10 printf '%s' ${terminfo[rmkx]} 10 printf '%s' ${terminfo[rmkx]}
11 fi 11 fi
12 12
13 zle reset-prompt 13 zle reset-prompt
14 zle -R 14 zle -R
15 } 15 }
16 16
17 # Ensure that the prompt is redrawn when the terminal size changes. 17 # Ensure that the prompt is redrawn when the terminal size changes.
18 TRAPWINCH() { 18 TRAPWINCH() {
19 if [[ -o zle ]]; then 19 zle && { zle reset-prompt; zle -R }
20 zle reset-prompt
21 zle -R
22 fi
23 } 20 }
24 21
25 zle -N zle-line-init 22 zle -N zle-line-init
26 zle -N zle-line-finish 23 zle -N zle-line-finish
27 zle -N zle-keymap-select 24 zle -N zle-keymap-select
28 zle -N edit-command-line 25 zle -N edit-command-line
29 26
30 27
31 bindkey -v 28 bindkey -v
32 29
33 # allow v to edit the command line (standard behaviour) 30 # allow v to edit the command line (standard behaviour)
34 autoload -Uz edit-command-line 31 autoload -Uz edit-command-line
35 bindkey -M vicmd 'v' edit-command-line 32 bindkey -M vicmd 'v' edit-command-line
36 33
34 # allow ctrl-p, ctrl-n for navigate history (standard behaviour)
35 bindkey '^P' up-history
36 bindkey '^N' down-history
37
38 # allow ctrl-h, ctrl-w, ctrl-? for char and word deletion (standard behaviour)
39 bindkey '^?' backward-delete-char
40 bindkey '^h' backward-delete-char
41 bindkey '^w' backward-kill-word
42
37 # if mode indicator wasn't setup by theme, define default 43 # if mode indicator wasn't setup by theme, define default
38 if [[ "$MODE_INDICATOR" == "" ]]; then 44 if [[ "$MODE_INDICATOR" == "" ]]; then
39 MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}" 45 MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}"
40 fi 46 fi
41 47
42 function vi_mode_prompt_info() { 48 function vi_mode_prompt_info() {
43 echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}" 49 echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}"
44 } 50 }
45 51
46 # define right prompt, if it wasn't defined by a theme 52 # define right prompt, if it wasn't defined by a theme
47 if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then 53 if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then
plugins/wd/README.md
1 wd 1 wd
2 == 2 ==
3 3
4 [![Build Status](https://travis-ci.org/mfaerevaag/wd.png?branch=master)](https://travis-ci.org/mfaerevaag/wd) 4 [![Build Status](https://travis-ci.org/mfaerevaag/wd.png?branch=master)](https://travis-ci.org/mfaerevaag/wd)
5 5
6 `wd` (*warp directory*) lets you jump to custom directories in zsh, without using `cd`. Why? Because `cd` seems ineffecient when the folder is frequently visited or has a long path. 6 `wd` (*warp directory*) lets you jump to custom directories in zsh, without using `cd`. Why? Because `cd` seems ineffecient when the folder is frequently visited or has a long path.
7 7
8 *NOTE*: If you are not using zsh, check out the `ruby` branch which has `wd` implemented as a gem.
9
8 10
9 ### Setup 11 ### Setup
10 12
11 ### oh-my-zsh 13 ### oh-my-zsh
12 14
13 `wd` comes bundles with [oh-my-zshell](https://github.com/robbyrussell/oh-my-zsh)! 15 `wd` comes bundles with [oh-my-zshell](https://github.com/robbyrussell/oh-my-zsh)!
14 16
15 Just add the plugin in your `~/.zshrc` file: 17 Just add the plugin in your `~/.zshrc` file:
16 18
17 plugins=(... wd) 19 plugins=(... wd)
18 20
19 21
20 #### Automatic 22 #### Automatic
21 23
22 Run either in terminal: 24 Run either in terminal:
23 25
24 * `curl -L https://github.com/mfaerevaag/wd/raw/master/install.sh | sh` 26 * `curl -L https://github.com/mfaerevaag/wd/raw/master/install.sh | sh`
25 27
26 * `wget --no-check-certificate https://github.com/mfaerevaag/wd/raw/master/install.sh -O - | sh` 28 * `wget --no-check-certificate https://github.com/mfaerevaag/wd/raw/master/install.sh -O - | sh`
27 29
28 30
29 #### Manual 31 #### Manual
30 32
31 * Clone this repo to your liking 33 * Clone this repo to your liking
32 34
33 * Add `wd` function to `.zshrc` (or `.profile` etc.): 35 * Add `wd` function to `.zshrc` (or `.profile` etc.):
34 36
35 wd() { 37 wd() {
36 . ~/paht/to/wd/wd.sh 38 . ~/path/to/cloned/repo/wd/wd.sh
37 } 39 }
38 40
39 * Install manpage. From `wd`'s base directory (requires root permissions): 41 * Install manpage. From `wd`'s base directory (requires root permissions):
40 42
41 # cp wd.1 /usr/share/man/man1/wd.1 43 # cp wd.1 /usr/share/man/man1/wd.1
42 # chmod 644 /usr/share/man/man1/wd.1 44 # chmod 644 /usr/share/man/man1/wd.1
43 45
44 Note, when pulling and updating `wd`, you'll need to do this again in case of changes to the manpage. 46 Note, when pulling and updating `wd`, you'll need to do this again in case of changes to the manpage.
45 47
46 48
47 #### Completion 49 #### Completion
48 50
49 If you're NOT using [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) and you want to utelize the zsh-completion feature, you will also need to add the path to your `wd` installation (`~/bin/wd` if you used the automatic installer) to your `fpath`. E.g. in your `~/.zshrc`: 51 If you're NOT using [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) and you want to utelize the zsh-completion feature, you will also need to add the path to your `wd` installation (`~/bin/wd` if you used the automatic installer) to your `fpath`. E.g. in your `~/.zshrc`:
50 52
51 fpath=(~/path/to/wd $fpath) 53 fpath=(~/path/to/wd $fpath)
52 54
53 Also, you may have to force a rebuild of `zcompdump` by running: 55 Also, you may have to force a rebuild of `zcompdump` by running:
54 56
55 $ rm -f ~/.zcompdump; compinit 57 $ rm -f ~/.zcompdump; compinit
56 58
57 59
58 60
59 ### Usage 61 ### Usage
60 62
61 * Add warp point to current working directory: 63 * Add warp point to current working directory:
62 64
63 $ wd add foo 65 $ wd add foo
64 66
65 If a warp point with the same name exists, use `add!` to overwrite it. 67 If a warp point with the same name exists, use `add!` to overwrite it.
66 68
67 Note, a warp point cannot contain colons, or only consist of only spaces and dots. The first will conflict in how `wd` stores the warp points, and the second will conflict other features, as below. 69 Note, a warp point cannot contain colons, or only consist of only spaces and dots. The first will conflict in how `wd` stores the warp points, and the second will conflict other features, as below.
68 70
69 * From an other directory (not necessarily), warp to `foo` with: 71 * From an other directory (not necessarily), warp to `foo` with:
70 72
71 $ wd foo 73 $ wd foo
72 74
73 * You can warp back to previous directory, and so on, with this dot syntax: 75 * You can warp back to previous directory, and so on, with this dot syntax:
74 76
75 $ wd .. 77 $ wd ..
76 $ wd ... 78 $ wd ...
77 79
78 This is a wrapper for the zsh `dirs` function. 80 This is a wrapper for the zsh `dirs` function.
79 (You might need `setopt AUTO_PUSHD` in your `.zshrc` if you hare not using [oh-my-zshell](https://github.com/robbyrussell/oh-my-zsh)). 81 (You might need `setopt AUTO_PUSHD` in your `.zshrc` if you hare not using [oh-my-zshell](https://github.com/robbyrussell/oh-my-zsh)).
80 82
81 * Remove warp point test point: 83 * Remove warp point test point:
82 84
83 $ wd rm foo 85 $ wd rm foo
84 86
85 * List all warp points (stored in `~/.warprc`): 87 * List all warp points (stored in `~/.warprc`):
86 88
87 $ wd ls 89 $ wd list
90
91 * List files in given warp point:
92
93 $ wd ls foo
94
95 * Show path of given warp point:
96
97 $ wd path foo
88 98
89 * List warp points to current directory, or optionally, path to given warp point: 99 * List warp points to current directory, or optionally, path to given warp point:
90 100
91 $ wd show 101 $ wd show
92 102
93 * Remove warp points to non-existent directories. 103 * Remove warp points to non-existent directories.
94 104
95 $ wd clean 105 $ wd clean
96 106
97 Use `clean!` to not be prompted with confirmation (force). 107 Use `clean!` to not be prompted with confirmation (force).
98 108
99 * Print usage with no opts or the `help` argument: 109 * Print usage with no opts or the `help` argument:
100 110
101 $ wd help 111 $ wd help
102 112
103 * Print the running version of `wd`: 113 * Print the running version of `wd`:
104 114
105 $ wd --version 115 $ wd --version
106 116
107 * Specifically set the config file (default `~/.warprc`), which is useful when testing: 117 * Specifically set the config file (default `~/.warprc`), which is useful when testing:
108 118
109 $ wd --config ./file <action> 119 $ wd --config ./file <action>
110 120
111 * Force `exit` with return code after running. This is not default, as it will *exit your terminal*, though required when testing/debugging. 121 * Force `exit` with return code after running. This is not default, as it will *exit your terminal*, though required when testing/debugging.
112 122
113 $ wd --debug <action> 123 $ wd --debug <action>
114 124
115 * Silence all output: 125 * Silence all output:
116 126
117 $ wd --quiet <action> 127 $ wd --quiet <action>
118 128
119 129
120 ### Testing 130 ### Testing
121 131
122 `wd` comes with a small test suite, run with [shunit2](https://code.google.com/p/shunit2/). This can be used to confirm that things are working as it should on your setup, or to demonstrate an issue. 132 `wd` comes with a small test suite, run with [shunit2](https://code.google.com/p/shunit2/). This can be used to confirm that things are working as it should on your setup, or to demonstrate an issue.
123 133
124 To run, simply `cd` into the `test` directory and run the `tests.sh`. 134 To run, simply `cd` into the `test` directory and run the `tests.sh`.
125 135
126 $ ./tests.sh 136 $ ./tests.sh
127 137
128 138
129 ### License 139 ### License
130 140
131 The project is licensed under the [MIT-license](https://github.com/mfaerevaag/wd/blob/master/LICENSE). 141 The project is licensed under the [MIT-license](https://github.com/mfaerevaag/wd/blob/master/LICENSE).
132 142
133 143
134 ### Finally 144 ### Finally
135 145
136 If you have issues, feedback or improvements, don't hesitate to report it or submit a pull-request. In the case of an issue, we would much appreciate if you would include a failing test in `test/tests.sh`. Explanation on how to run the tests, read the section "Testing" in this README. 146 If you have issues, feedback or improvements, don't hesitate to report it or submit a pull-request. In the case of an issue, we would much appreciate if you would include a failing test in `test/tests.sh`. Explanation on how to run the tests, read the section "Testing" in this README.
137 147
138 Credit to [altschuler](https://github.com/altschuler) for awesome idea. 148 Credit to [altschuler](https://github.com/altschuler) for awesome idea.
139 149
140 Hope you enjoy! 150 Hope you enjoy!
141 151
1 #compdef wd 1 #compdef wd
2 2
3 zstyle ':completion:*:descriptions' format '%B%d%b' 3 zstyle ':completion:*:descriptions' format '%B%d%b'
4 zstyle ':completion::complete:wd:*:commands' group-name commands 4 zstyle ':completion::complete:wd:*:commands' group-name commands
5 zstyle ':completion::complete:wd:*:warp_points' group-name warp_points 5 zstyle ':completion::complete:wd:*:warp_points' group-name warp_points
6 zstyle ':completion::complete:wd::' list-grouped 6 zstyle ':completion::complete:wd::' list-grouped
7 7
8 zmodload zsh/mapfile 8 zmodload zsh/mapfile
9 9
10 function _wd() { 10 function _wd() {
11 local CONFIG=$HOME/.warprc 11 local CONFIG=$HOME/.warprc
12 local ret=1 12 local ret=1
13 13
14 local -a commands 14 local -a commands
15 local -a warp_points 15 local -a warp_points
16 16
17 warp_points=( "${(f)mapfile[$CONFIG]//$HOME/~}" ) 17 warp_points=( "${(f)mapfile[$CONFIG]//$HOME/~}" )
18 18
19 commands=( 19 commands=(
20 'add:Adds the current working directory to your warp points' 20 'add:Adds the current working directory to your warp points'
21 'add!:Overwrites existing warp point' 21 'add!:Overwrites existing warp point'
22 'rm:Removes the given warp point' 22 'rm:Removes the given warp point'
23 'ls:Outputs all stored warp points' 23 'list:Outputs all stored warp points'
24 'show:Outputs all warp points that point to the current directory or shows a specific target directory for a point' 24 'ls:Show files from given warp point'
25 'path:Show path to given warp point'
25 'show:Outputs all warp points that point to the current directory or shows a specific target directory for a point' 26 'show:Outputs all warp points that point to the current directory or shows a specific target directory for a point'
26 'help:Show this extremely helpful text' 27 'help:Show this extremely helpful text'
28 'clean:Remove points warping to nonexistent directories'
29 'clean!:Remove nonexistent directories without confirmation'
27 '..:Go back to last directory' 30 '..:Go back to last directory'
28 ) 31 )
29 32
30 _arguments -C \ 33 _arguments -C \
31 '1: :->first_arg' \ 34 '1: :->first_arg' \
32 '2: :->second_arg' && ret=0 35 '2: :->second_arg' && ret=0
33 36
34 case $state in 37 case $state in
35 first_arg) 38 first_arg)
36 _describe -t warp_points "Warp points" warp_points && ret=0 39 _describe -t warp_points "Warp points" warp_points && ret=0
37 _describe -t commands "Commands" commands && ret=0 40 _describe -t commands "Commands" commands && ret=0
38 ;; 41 ;;
39 second_arg) 42 second_arg)
40 case $words[2] in 43 case $words[2] in
41 add\!|rm) 44 add\!|rm)
42 _describe -t points "Warp points" warp_points && ret=0 45 _describe -t points "Warp points" warp_points && ret=0
43 ;; 46 ;;
44 add) 47 add)
45 _message 'Write the name of your warp point' && ret=0 48 _message 'Write the name of your warp point' && ret=0
46 ;; 49 ;;
47 show) 50 show)
48 _describe -t points "Warp points" warp_points && ret=0 51 _describe -t points "Warp points" warp_points && ret=0
49 ;; 52 ;;
53 ls)
54 _describe -t points "Warp points" warp_points && ret=0
55 ;;
56 path)
57 _describe -t points "Warp points" warp_points && ret=0
58 ;;
50 esac 59 esac
51 ;; 60 ;;
52 esac 61 esac
53 62
54 return $ret 63 return $ret
55 } 64 }
56 65
57 _wd "$@" 66 _wd "$@"
58 67
59 # Local Variables: 68 # Local Variables:
60 # mode: Shell-Script 69 # mode: Shell-Script
61 # sh-indentation: 2 70 # sh-indentation: 2
62 # indent-tabs-mode: nil 71 # indent-tabs-mode: nil
63 # sh-basic-offset: 2 72 # sh-basic-offset: 2
64 # End: 73 # End:
65 # vim: ft=zsh sw=2 ts=2 et 74 # vim: ft=zsh sw=2 ts=2 et
66 75
1 #!/bin/zsh 1 #!/bin/zsh
2 2
3 # WARP DIRECTORY 3 # WARP DIRECTORY
4 # ============== 4 # ==============
5 # Jump to custom directories in terminal 5 # Jump to custom directories in terminal
6 # because `cd` takes too long... 6 # because `cd` takes too long...
7 # 7 #
8 # @github.com/mfaerevaag/wd 8 # @github.com/mfaerevaag/wd
9 9
10 # version 10 # version
11 readonly WD_VERSION=0.4 11 readonly WD_VERSION=0.4
12 12
13 # colors 13 # colors
14 readonly WD_BLUE="\033[96m" 14 readonly WD_BLUE="\033[96m"
15 readonly WD_GREEN="\033[92m" 15 readonly WD_GREEN="\033[92m"
16 readonly WD_YELLOW="\033[93m" 16 readonly WD_YELLOW="\033[93m"
17 readonly WD_RED="\033[91m" 17 readonly WD_RED="\033[91m"
18 readonly WD_NOC="\033[m" 18 readonly WD_NOC="\033[m"
19 19
20 ## functions 20 ## functions
21 21
22 # helpers 22 # helpers
23 wd_yesorno() 23 wd_yesorno()
24 { 24 {
25 # variables 25 # variables
26 local question="${1}" 26 local question="${1}"
27 local prompt="${question} " 27 local prompt="${question} "
28 local yes_RETVAL="0" 28 local yes_RETVAL="0"
29 local no_RETVAL="3" 29 local no_RETVAL="3"
30 local RETVAL="" 30 local RETVAL=""
31 local answer="" 31 local answer=""
32 32
33 # read-eval loop 33 # read-eval loop
34 while true ; do 34 while true ; do
35 printf $prompt 35 printf $prompt
36 read -r answer 36 read -r answer
37 37
38 case ${answer:=${default}} in 38 case ${answer:=${default}} in
39 Y|y|YES|yes|Yes ) 39 Y|y|YES|yes|Yes )
40 RETVAL=${yes_RETVAL} && \ 40 RETVAL=${yes_RETVAL} && \
41 break 41 break
42 ;; 42 ;;
43 N|n|NO|no|No ) 43 N|n|NO|no|No )
44 RETVAL=${no_RETVAL} && \ 44 RETVAL=${no_RETVAL} && \
45 break 45 break
46 ;; 46 ;;
47 * ) 47 * )
48 echo "Please provide a valid answer (y or n)" 48 echo "Please provide a valid answer (y or n)"
49 ;; 49 ;;
50 esac 50 esac
51 done 51 done
52 52
53 return ${RETVAL} 53 return ${RETVAL}
54 } 54 }
55 55
56 wd_print_msg() 56 wd_print_msg()
57 { 57 {
58 if [[ -z $wd_quiet_mode ]] 58 if [[ -z $wd_quiet_mode ]]
59 then 59 then
60 local color=$1 60 local color=$1
61 local msg=$2 61 local msg=$2
62 62
63 if [[ $color == "" || $msg == "" ]] 63 if [[ $color == "" || $msg == "" ]]
64 then 64 then
65 print " ${WD_RED}*${WD_NOC} Could not print message. Sorry!" 65 print " ${WD_RED}*${WD_NOC} Could not print message. Sorry!"
66 else 66 else
67 print " ${color}*${WD_NOC} ${msg}" 67 print " ${color}*${WD_NOC} ${msg}"
68 fi 68 fi
69 fi 69 fi
70 } 70 }
71 71
72 wd_print_usage() 72 wd_print_usage()
73 { 73 {
74 cat <<- EOF 74 cat <<- EOF
75 Usage: wd [command] <point> 75 Usage: wd [command] <point>
76 76
77 Commands: 77 Commands:
78 add <point> Adds the current working directory to your warp points 78 add <point> Adds the current working directory to your warp points
79 add! <point> Overwrites existing warp point 79 add! <point> Overwrites existing warp point
80 rm <point> Removes the given warp point 80 rm <point> Removes the given warp point
81 show Print warp points to current directory 81 show Print warp points to current directory
82 show <point> Print path to given warp point 82 show <point> Print path to given warp point
83 ls Print all stored warp points 83 list Print all stored warp points
84 ls <point> Show files from given warp point
85 path <point> Show the path to given warp point
84 clean! Remove points warping to nonexistent directories 86 clean! Remove points warping to nonexistent directories
85 87
86 -v | --version Print version 88 -v | --version Print version
87 -d | --debug Exit after execution with exit codes (for testing) 89 -d | --debug Exit after execution with exit codes (for testing)
88 -c | --config Specify config file (default ~/.warprc) 90 -c | --config Specify config file (default ~/.warprc)
89 -q | --quiet Suppress all output 91 -q | --quiet Suppress all output
90 92
91 help Show this extremely helpful text 93 help Show this extremely helpful text
92 EOF 94 EOF
93 } 95 }
94 96
95 wd_exit_fail() 97 wd_exit_fail()
96 { 98 {
97 local msg=$1 99 local msg=$1
98 100
99 wd_print_msg $WD_RED $1 101 wd_print_msg $WD_RED $msg
100 WD_EXIT_CODE=1 102 WD_EXIT_CODE=1
101 } 103 }
102 104
103 wd_exit_warn() 105 wd_exit_warn()
104 { 106 {
105 local msg=$1 107 local msg=$1
106 108
107 wd_print_msg $WD_YELLOW $msg 109 wd_print_msg $WD_YELLOW $msg
108 WD_EXIT_CODE=1 110 WD_EXIT_CODE=1
109 } 111 }
110 112
113 wd_getdir()
114 {
115 local name_arg=$1
116
117 point=$(wd_show $name_arg)
118 dir=${point:28+$#name_arg+7}
119
120 if [[ -z $name_arg ]]; then
121 wd_exit_fail "You must enter a warp point"
122 break
123 elif [[ -z $dir ]]; then
124 wd_exit_fail "Unknown warp point '${name_arg}'"
125 break
126 fi
127 }
128
111 # core 129 # core
112 130
113 wd_warp() 131 wd_warp()
114 { 132 {
115 local point=$1 133 local point=$1
116 134
117 if [[ $point =~ "^\.+$" ]] 135 if [[ $point =~ "^\.+$" ]]
118 then 136 then
119 if [ $#1 < 2 ] 137 if [ $#1 < 2 ]
120 then 138 then
121 wd_exit_warn "Warping to current directory?" 139 wd_exit_warn "Warping to current directory?"
122 else 140 else
123 (( n = $#1 - 1 )) 141 (( n = $#1 - 1 ))
124 cd -$n > /dev/null 142 cd -$n > /dev/null
125 fi 143 fi
126 elif [[ ${points[$point]} != "" ]] 144 elif [[ ${points[$point]} != "" ]]
127 then 145 then
128 cd ${points[$point]} 146 cd ${points[$point]}
129 else 147 else
130 wd_exit_fail "Unknown warp point '${point}'" 148 wd_exit_fail "Unknown warp point '${point}'"
131 fi 149 fi
132 } 150 }
133 151
134 wd_add() 152 wd_add()
135 { 153 {
136 local force=$1 154 local force=$1
137 local point=$2 155 local point=$2
138 156
139 if [[ $point =~ "^[\.]+$" ]] 157 if [[ $point =~ "^[\.]+$" ]]
140 then 158 then
141 wd_exit_fail "Warp point cannot be just dots" 159 wd_exit_fail "Warp point cannot be just dots"
142 elif [[ $point =~ "[[:space:]]+" ]] 160 elif [[ $point =~ "[[:space:]]+" ]]
143 then 161 then
144 wd_exit_fail "Warp point should not contain whitespace" 162 wd_exit_fail "Warp point should not contain whitespace"
145 elif [[ $point == *:* ]] 163 elif [[ $point == *:* ]]
146 then 164 then
147 wd_exit_fail "Warp point cannot contain colons" 165 wd_exit_fail "Warp point cannot contain colons"
148 elif [[ $point == "" ]] 166 elif [[ $point == "" ]]
149 then 167 then
150 wd_exit_fail "Warp point cannot be empty" 168 wd_exit_fail "Warp point cannot be empty"
151 elif [[ ${points[$2]} == "" ]] || $force 169 elif [[ ${points[$2]} == "" ]] || $force
152 then 170 then
153 wd_remove $point > /dev/null 171 wd_remove $point > /dev/null
154 printf "%q:%s\n" "${point}" "${PWD}" >> $WD_CONFIG 172 printf "%q:%s\n" "${point}" "${PWD}" >> $WD_CONFIG
155 173
156 wd_print_msg $WD_GREEN "Warp point added" 174 wd_print_msg $WD_GREEN "Warp point added"
157 175
158 # override exit code in case wd_remove did not remove any points 176 # override exit code in case wd_remove did not remove any points
159 # TODO: we should handle this kind of logic better 177 # TODO: we should handle this kind of logic better
160 WD_EXIT_CODE=0 178 WD_EXIT_CODE=0
161 else 179 else
162 wd_exit_warn "Warp point '${point}' already exists. Use 'add!' to overwrite." 180 wd_exit_warn "Warp point '${point}' already exists. Use 'add!' to overwrite."
163 fi 181 fi
164 } 182 }
165 183
166 wd_remove() 184 wd_remove()
167 { 185 {
168 local point=$1 186 local point=$1
169 187
170 if [[ ${points[$point]} != "" ]] 188 if [[ ${points[$point]} != "" ]]
171 then 189 then
172 local config_tmp=$WD_CONFIG.tmp 190 local config_tmp=$WD_CONFIG.tmp
173 if sed -n "/^${point}:.*$/!p" $WD_CONFIG > $config_tmp && mv $config_tmp $WD_CONFIG 191 if sed -n "/^${point}:.*$/!p" $WD_CONFIG > $config_tmp && mv $config_tmp $WD_CONFIG
174 then 192 then
175 wd_print_msg $WD_GREEN "Warp point removed" 193 wd_print_msg $WD_GREEN "Warp point removed"
176 else 194 else
177 wd_exit_fail "Something bad happened! Sorry." 195 wd_exit_fail "Something bad happened! Sorry."
178 fi 196 fi
179 else 197 else
180 wd_exit_fail "Warp point was not found" 198 wd_exit_fail "Warp point was not found"
181 fi 199 fi
182 } 200 }
183 201
184 wd_list_all() 202 wd_list_all()
185 { 203 {
186 wd_print_msg $WD_BLUE "All warp points:" 204 wd_print_msg $WD_BLUE "All warp points:"
187 205
188 while IFS= read -r line 206 while IFS= read -r line
189 do 207 do
190 if [[ $line != "" ]] 208 if [[ $line != "" ]]
191 then 209 then
192 arr=(${(s,:,)line}) 210 arr=(${(s,:,)line})
193 key=${arr[1]} 211 key=${arr[1]}
194 val=${arr[2]} 212 val=${arr[2]}
195 213
196 if [[ -z $wd_quiet_mode ]] 214 if [[ -z $wd_quiet_mode ]]
197 then 215 then
198 printf "%20s -> %s\n" $key $val 216 printf "%20s -> %s\n" $key $val
199 fi 217 fi
200 fi 218 fi
201 done <<< $(sed "s:${HOME}:~:g" $WD_CONFIG) 219 done <<< $(sed "s:${HOME}:~:g" $WD_CONFIG)
202 } 220 }
203 221
222 wd_ls()
223 {
224 wd_getdir $1
225 ls $dir
226 }
227
228 wd_path()
229 {
230 wd_getdir $1
231 echo $(echo $dir | sed "s:${HOME}:~:g")
232 }
233
204 wd_show() 234 wd_show()
205 { 235 {
206 local name_arg=$1 236 local name_arg=$1
207 # if there's an argument we look up the value 237 # if there's an argument we look up the value
208 if [[ ! -z $name_arg ]] 238 if [[ ! -z $name_arg ]]
209 then 239 then
210 if [[ -z $points[$name_arg] ]] 240 if [[ -z $points[$name_arg] ]]
211 then 241 then
212 wd_print_msg $WD_BLUE "No warp point named $name_arg" 242 wd_print_msg $WD_BLUE "No warp point named $name_arg"
213 else 243 else
214 wd_print_msg $WD_GREEN "Warp point: ${WD_GREEN}$name_arg${WD_NOC} -> $points[$name_arg]" 244 wd_print_msg $WD_GREEN "Warp point: ${WD_GREEN}$name_arg${WD_NOC} -> $points[$name_arg]"
215 fi 245 fi
216 else 246 else
217 # hax to create a local empty array 247 # hax to create a local empty array
218 local wd_matches 248 local wd_matches
219 wd_matches=() 249 wd_matches=()
220 # do a reverse lookup to check whether PWD is in $points 250 # do a reverse lookup to check whether PWD is in $points
221 if [[ ${points[(r)$PWD]} == $PWD ]] 251 if [[ ${points[(r)$PWD]} == $PWD ]]
222 then 252 then
223 for name in ${(k)points} 253 for name in ${(k)points}
224 do 254 do
225 if [[ $points[$name] == $PWD ]] 255 if [[ $points[$name] == $PWD ]]
226 then 256 then
227 wd_matches[$(($#wd_matches+1))]=$name 257 wd_matches[$(($#wd_matches+1))]=$name
228 fi 258 fi
229 done 259 done
230 260
231 wd_print_msg $WD_BLUE "$#wd_matches warp point(s) to current directory: ${WD_GREEN}$wd_matches${WD_NOC}" 261 wd_print_msg $WD_BLUE "$#wd_matches warp point(s) to current directory: ${WD_GREEN}$wd_matches${WD_NOC}"
232 else 262 else
233 wd_print_msg $WD_YELLOW "No warp point to $(echo $PWD | sed "s:$HOME:~:")" 263 wd_print_msg $WD_YELLOW "No warp point to $(echo $PWD | sed "s:$HOME:~:")"
234 fi 264 fi
235 fi 265 fi
236 } 266 }
237 267
238 wd_clean() { 268 wd_clean() {
239 local force=$1 269 local force=$1
240 local count=0 270 local count=0
241 local wd_tmp="" 271 local wd_tmp=""
242 272
243 while read line 273 while read line
244 do 274 do
245 if [[ $line != "" ]] 275 if [[ $line != "" ]]
246 then 276 then
247 arr=(${(s,:,)line}) 277 arr=(${(s,:,)line})
248 key=${arr[1]} 278 key=${arr[1]}
249 val=${arr[2]} 279 val=${arr[2]}
250 280
251 if [ -d "$val" ] 281 if [ -d "$val" ]
252 then 282 then
253 wd_tmp=$wd_tmp"\n"`echo $line` 283 wd_tmp=$wd_tmp"\n"`echo $line`
254 else 284 else
255 wd_print_msg $WD_YELLOW "Nonexistent directory: ${key} -> ${val}" 285 wd_print_msg $WD_YELLOW "Nonexistent directory: ${key} -> ${val}"
256 count=$((count+1)) 286 count=$((count+1))
257 fi 287 fi
258 fi 288 fi
259 done < $WD_CONFIG 289 done < $WD_CONFIG
260 290
261 if [[ $count -eq 0 ]] 291 if [[ $count -eq 0 ]]
262 then 292 then
263 wd_print_msg $WD_BLUE "No warp points to clean, carry on!" 293 wd_print_msg $WD_BLUE "No warp points to clean, carry on!"
264 else 294 else
265 if $force || wd_yesorno "Removing ${count} warp points. Continue? (Y/n)" 295 if $force || wd_yesorno "Removing ${count} warp points. Continue? (Y/n)"
266 then 296 then
267 echo $wd_tmp >! $WD_CONFIG 297 echo $wd_tmp >! $WD_CONFIG
268 wd_print_msg $WD_GREEN "Cleanup complete. ${count} warp point(s) removed" 298 wd_print_msg $WD_GREEN "Cleanup complete. ${count} warp point(s) removed"
269 else 299 else
270 wd_print_msg $WD_BLUE "Cleanup aborted" 300 wd_print_msg $WD_BLUE "Cleanup aborted"
271 fi 301 fi
272 fi 302 fi
273 } 303 }
274 304
275 local WD_CONFIG=$HOME/.warprc 305 local WD_CONFIG=$HOME/.warprc
276 local WD_QUIET=0 306 local WD_QUIET=0
277 local WD_EXIT_CODE=0 307 local WD_EXIT_CODE=0
278 local WD_DEBUG=0 308 local WD_DEBUG=0
279 309
280 # Parse 'meta' options first to avoid the need to have them before 310 # Parse 'meta' options first to avoid the need to have them before
281 # other commands. The `-D` flag consumes recognized options so that 311 # other commands. The `-D` flag consumes recognized options so that
282 # the actual command parsing won't be affected. 312 # the actual command parsing won't be affected.
283 313
284 zparseopts -D -E \ 314 zparseopts -D -E \
285 c:=wd_alt_config -config:=wd_alt_config \ 315 c:=wd_alt_config -config:=wd_alt_config \
286 q=wd_quiet_mode -quiet=wd_quiet_mode \ 316 q=wd_quiet_mode -quiet=wd_quiet_mode \
287 v=wd_print_version -version=wd_print_version \ 317 v=wd_print_version -version=wd_print_version \
288 d=wd_debug_mode -debug=wd_debug_mode 318 d=wd_debug_mode -debug=wd_debug_mode
289 319
290 if [[ ! -z $wd_print_version ]] 320 if [[ ! -z $wd_print_version ]]
291 then 321 then
292 echo "wd version $WD_VERSION" 322 echo "wd version $WD_VERSION"
293 fi 323 fi
294 324
295 if [[ ! -z $wd_alt_config ]] 325 if [[ ! -z $wd_alt_config ]]
296 then 326 then
297 WD_CONFIG=$wd_alt_config[2] 327 WD_CONFIG=$wd_alt_config[2]
298 fi 328 fi
299 329
300 # check if config file exists 330 # check if config file exists
301 if [ ! -e $WD_CONFIG ] 331 if [ ! -e $WD_CONFIG ]
302 then 332 then
303 # if not, create config file 333 # if not, create config file
304 touch $WD_CONFIG 334 touch $WD_CONFIG
305 fi 335 fi
306 336
307 # load warp points 337 # load warp points
308 typeset -A points 338 typeset -A points
309 while read -r line 339 while read -r line
310 do 340 do
311 arr=(${(s,:,)line}) 341 arr=(${(s,:,)line})
312 key=${arr[1]} 342 key=${arr[1]}
313 val=${arr[2]} 343 val=${arr[2]}
314 344
315 points[$key]=$val 345 points[$key]=$val
316 done < $WD_CONFIG 346 done < $WD_CONFIG
317 347
318 # get opts 348 # get opts
319 args=$(getopt -o a:r:c:lhs -l add:,rm:,clean\!,ls,help,show -- $*) 349 args=$(getopt -o a:r:c:lhs -l add:,rm:,clean\!,list,ls:,path:,help,show -- $*)
320 350
321 # check if no arguments were given, and that version is not set 351 # check if no arguments were given, and that version is not set
322 if [[ ($? -ne 0 || $#* -eq 0) && -z $wd_print_version ]] 352 if [[ ($? -ne 0 || $#* -eq 0) && -z $wd_print_version ]]
323 then 353 then
324 wd_print_usage 354 wd_print_usage
325 355
326 # check if config file is writeable 356 # check if config file is writeable
327 elif [ ! -w $WD_CONFIG ] 357 elif [ ! -w $WD_CONFIG ]
328 then 358 then
329 # do nothing 359 # do nothing
330 # can't run `exit`, as this would exit the executing shell 360 # can't run `exit`, as this would exit the executing shell
331 wd_exit_fail "\'$WD_CONFIG\' is not writeable." 361 wd_exit_fail "\'$WD_CONFIG\' is not writeable."
332 362
333 else 363 else
334 364
335 # parse rest of options 365 # parse rest of options
336 for o 366 for o
337 do 367 do
338 case "$o" 368 case "$o"
339 in 369 in
340 -a|--add|add) 370 -a|--add|add)
341 wd_add false $2 371 wd_add false $2
342 break 372 break
343 ;; 373 ;;
344 -a!|--add!|add!) 374 -a!|--add!|add!)
345 wd_add true $2 375 wd_add true $2
346 break 376 break
347 ;; 377 ;;
348 -r|--remove|rm) 378 -r|--remove|rm)
349 wd_remove $2 379 wd_remove $2
350 break 380 break
351 ;; 381 ;;
352 -l|--list|ls) 382 -l|list)
353 wd_list_all 383 wd_list_all
354 break 384 break
355 ;; 385 ;;
386 -ls|ls)
387 wd_ls $2
388 break
389 ;;
390 -p|--path|path)
391 wd_path $2
392 break
393 ;;
356 -h|--help|help) 394 -h|--help|help)
357 wd_print_usage 395 wd_print_usage
358 break 396 break
359 ;; 397 ;;
360 -s|--show|show) 398 -s|--show|show)
361 wd_show $2 399 wd_show $2
362 break 400 break
363 ;; 401 ;;
364 -c|--clean|clean) 402 -c|--clean|clean)
365 wd_clean false 403 wd_clean false
366 break 404 break
367 ;; 405 ;;
368 -c!|--clean!|clean!) 406 -c!|--clean!|clean!)
369 wd_clean true 407 wd_clean true
370 break 408 break
371 ;; 409 ;;
372 *) 410 *)
373 wd_warp $o 411 wd_warp $o
374 break 412 break
375 ;; 413 ;;
376 --) 414 --)
377 break 415 break
378 ;; 416 ;;
379 esac 417 esac
380 done 418 done
381 fi 419 fi
382 420
383 ## garbage collection 421 ## garbage collection
384 # if not, next time warp will pick up variables from this run 422 # if not, next time warp will pick up variables from this run
385 # remember, there's no sub shell 423 # remember, there's no sub shell
386 424
387 unset wd_warp 425 unset wd_warp
388 unset wd_add 426 unset wd_add
389 unset wd_remove 427 unset wd_remove
390 unset wd_show 428 unset wd_show
391 unset wd_list_all 429 unset wd_list_all
392 unset wd_print_msg 430 unset wd_print_msg
393 unset wd_yesorno 431 unset wd_yesorno
394 unset wd_print_usage 432 unset wd_print_usage
395 unset wd_alt_config 433 unset wd_alt_config
396 unset wd_quiet_mode 434 unset wd_quiet_mode
397 unset wd_print_version 435 unset wd_print_version
398 436
399 unset args 437 unset args
400 unset points 438 unset points
401 unset val &> /dev/null # fixes issue #1 439 unset val &> /dev/null # fixes issue #1
402 440
403 if [[ ! -z $wd_debug_mode ]] 441 if [[ ! -z $wd_debug_mode ]]
404 then 442 then
405 exit $WD_EXIT_CODE 443 exit $WD_EXIT_CODE
406 else 444 else
407 unset wd_debug_mode 445 unset wd_debug_mode
408 fi 446 fi
409 447
plugins/wp-cli/wp-cli.plugin.zsh
1 # WP-CLI 1 # WP-CLI
2 # A command line interface for WordPress 2 # A command line interface for WordPress
3 # http://wp-cli.org/ 3 # http://wp-cli.org/
4 4
5 # Cache 5 # Cache
6 6
7 # Cap 7 # Cap
8 8
9 # CLI 9 # CLI
10 10
11 # Comment 11 # Comment
12 12
13 # Core 13 # Core
14 alias wpcc='wp core config' 14 alias wpcc='wp core config'
15 alias wpcd='wp core download' 15 alias wpcd='wp core download'
16 alias wpci='wp core install' 16 alias wpci='wp core install'
17 alias wpcii='wp core is-installed' 17 alias wpcii='wp core is-installed'
18 alias wpcmc='wp core multisite-convert' 18 alias wpcmc='wp core multisite-convert'
19 alias wpcmi='wp core multisite-install' 19 alias wpcmi='wp core multisite-install'
20 alias wpcu='wp core update' 20 alias wpcu='wp core update'
21 alias wpcudb='wp core update-db' 21 alias wpcudb='wp core update-db'
22 alias wpcvc='wp core verify-checksums' 22 alias wpcvc='wp core verify-checksums'
23 23
24 # Cron 24 # Cron
25 alias wpcre='wp cron event' 25 alias wpcre='wp cron event'
26 alias wpcrs='wp cron schedule' 26 alias wpcrs='wp cron schedule'
27 alias wpcrt='wp cron test' 27 alias wpcrt='wp cron test'
28 28
29 # Db 29 # Db
30 30
31 # Eval 31 # Eval
32 32
33 # Eval-File 33 # Eval-File
34 34
35 # Export 35 # Export
36 36
37 # Help 37 # Help
38 38
39 # Import 39 # Import
40 40
41 # Media 41 # Media
42 42
43 # Menu 43 # Menu
44 alias wpmc='wp menu create' 44 alias wpmc='wp menu create'
45 alias wpmd='wp menu delete' 45 alias wpmd='wp menu delete'
46 alias wpmi='wp menu item' 46 alias wpmi='wp menu item'
47 alias wpml='wp menu list' 47 alias wpml='wp menu list'
48 alias wpmlo='wp menu location' 48 alias wpmlo='wp menu location'
49 49
50 # Network 50 # Network
51 51
52 # Option 52 # Option
53 53
54 # Plugin 54 # Plugin
55 alias wppa='wp plugin activate' 55 alias wppa='wp plugin activate'
56 alias wppda='wp plugin deactivate' 56 alias wppda='wp plugin deactivate'
57 alias wppd='wp plugin delete' 57 alias wppd='wp plugin delete'
58 alias wppg='wp plugin get' 58 alias wppg='wp plugin get'
59 alias wppi='wp plugin install' 59 alias wppi='wp plugin install'
60 alias wppis='wp plugin is-installed' 60 alias wppis='wp plugin is-installed'
61 alias wppl='wp plugin list' 61 alias wppl='wp plugin list'
62 alias wppp='wp plugin path' 62 alias wppp='wp plugin path'
63 alias wpps='wp plugin search' 63 alias wpps='wp plugin search'
64 alias wppst='wp plugin status' 64 alias wppst='wp plugin status'
65 alias wppt='wp plugin toggle' 65 alias wppt='wp plugin toggle'
66 alias wppu='wp plugin uninstall' 66 alias wppu='wp plugin uninstall'
67 alias wppu='wp plugin update' 67 alias wppu='wp plugin update'
68 68
69 # Post 69 # Post
70 alias wppoc='wp post create' 70 alias wppoc='wp post create'
71 alias wppod='wp post delete' 71 alias wppod='wp post delete'
72 alias wppoe='wp post edit' 72 alias wppoe='wp post edit'
73 alias wppogen='wp post generate' 73 alias wppogen='wp post generate'
74 alias wppog='wp post get' 74 alias wppog='wp post get'
75 alias wppol='wp post list' 75 alias wppol='wp post list'
76 alias wppom='wp post meta' 76 alias wppom='wp post meta'
77 alias wppou='wp post update' 77 alias wppou='wp post update'
78 alias wppou='wp post url' 78 alias wppou='wp post url'
79 79
80 # Rewrite 80 # Rewrite
81 81
82 # Role 82 # Role
83 83
84 # Scaffold 84 # Scaffold
85 85
86 # Search-Replace 86 # Search-Replace
87 87
88 # Shell 88 # Shell
89 89
90 # Sidebar 90 # Sidebar
91 alias wpsbl='wp sidebar list' 91 alias wpsbl='wp sidebar list'
92 92
93 # Site 93 # Site
94 94
95 # Super-Admin 95 # Super-Admin
96 96
97 # Term 97 # Term
98 98
99 # Theme 99 # Theme
100 alias wpta='wp theme activate' 100 alias wpta='wp theme activate'
101 alias wptd='wp theme delete' 101 alias wptd='wp theme delete'
102 alias wptdis='wp theme disable' 102 alias wptdis='wp theme disable'
103 alias wpte='wp theme enable' 103 alias wpte='wp theme enable'
104 alias wptg='wp theme get' 104 alias wptg='wp theme get'
105 alias wpti='wp theme install' 105 alias wpti='wp theme install'
106 alias wptis='wp theme is-installed' 106 alias wptis='wp theme is-installed'
107 alias wptl='wp theme list' 107 alias wptl='wp theme list'
108 alias wptm='wp theme mod' 108 alias wptm='wp theme mod'
109 alias wptp='wp theme path' 109 alias wptp='wp theme path'
110 alias wpts='wp theme search' 110 alias wpts='wp theme search'
111 alias wptst='wp theme status' 111 alias wptst='wp theme status'
112 alias wptu='wp theme updatet' 112 alias wptu='wp theme updatet'
113 113
114 # Transient 114 # Transient
115 115
116 # User 116 # User
117 alias wpuac='wp user add-cap' 117 alias wpuac='wp user add-cap'
118 alias wpuar='wp user add-role' 118 alias wpuar='wp user add-role'
119 alias wpuc='wp user create' 119 alias wpuc='wp user create'
120 alias wpud='wp user delete' 120 alias wpud='wp user delete'
121 alias wpugen='wp user generate' 121 alias wpugen='wp user generate'
122 alias wpug='wp user get' 122 alias wpug='wp user get'
123 alias wpui='wp user import-csv' 123 alias wpui='wp user import-csv'
124 alias wpul='wp user list' 124 alias wpul='wp user list'
125 alias wpulc='wp user list-caps' 125 alias wpulc='wp user list-caps'
126 alias wpum='wp user meta' 126 alias wpum='wp user meta'
127 alias wpurc='wp user remove-cap' 127 alias wpurc='wp user remove-cap'
128 alias wpurr='wp user remove-role' 128 alias wpurr='wp user remove-role'
129 alias wpusr='wp user set-role' 129 alias wpusr='wp user set-role'
130 alias wpuu='wp user update' 130 alias wpuu='wp user update'
131 131
132 # Widget 132 # Widget
133 alias wpwa='wp widget add' 133 alias wpwa='wp widget add'
134 alias wpwda='wp widget deactivate' 134 alias wpwda='wp widget deactivate'
135 alias wpwd='wp widget delete' 135 alias wpwd='wp widget delete'
136 alias wpwl='wp widget list' 136 alias wpwl='wp widget list'
137 alias wpwm='wp widget move' 137 alias wpwm='wp widget move'
138 alias wpwu='wp widget update' 138 alias wpwu='wp widget update'
139
140
141 autoload -U +X bashcompinit && bashcompinit
142 # bash completion for the `wp` command
143
144 _wp_complete() {
145 local cur=${COMP_WORDS[COMP_CWORD]}
146
147 IFS=$'\n'; # want to preserve spaces at the end
148 local opts="$(wp cli completions --line="$COMP_LINE" --point="$COMP_POINT")"
149
150 if [[ "$opts" =~ \<file\>\s* ]]
151 then
152 COMPREPLY=( $(compgen -f -- $cur) )
153 elif [[ $opts = "" ]]
154 then
155 COMPREPLY=( $(compgen -f -- $cur) )
156 else
157 COMPREPLY=( ${opts[*]} )
158 fi
159 }
160 complete -o nospace -F _wp_complete wp
139 161
themes/awesomepanda.zsh-theme
1 # the svn plugin has to be activated for this to work. 1 # the svn plugin has to be activated for this to work.
2 2 local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
3 PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}' 3 PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}'
4 4
5 ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" 5 ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
6 ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 6 ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
7 ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[yellow]%} ✗ %{$reset_color%}" 7 ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[yellow]%} ✗ %{$reset_color%}"
8 ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}) " 8 ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}) "
9 9
10
11
12 ZSH_PROMPT_BASE_COLOR="%{$fg_bold[blue]%}" 10 ZSH_PROMPT_BASE_COLOR="%{$fg_bold[blue]%}"
13 ZSH_THEME_REPO_NAME_COLOR="%{$fg_bold[red]%}" 11 ZSH_THEME_REPO_NAME_COLOR="%{$fg_bold[red]%}"
14 12
15 ZSH_THEME_SVN_PROMPT_PREFIX="svn:(" 13 ZSH_THEME_SVN_PROMPT_PREFIX="svn:("
16 ZSH_THEME_SVN_PROMPT_SUFFIX=")" 14 ZSH_THEME_SVN_PROMPT_SUFFIX=")"
17 ZSH_THEME_SVN_PROMPT_DIRTY="%{$fg[red]%} ✘ %{$reset_color%}" 15 ZSH_THEME_SVN_PROMPT_DIRTY="%{$fg[red]%} ✘ %{$reset_color%}"
18 ZSH_THEME_SVN_PROMPT_CLEAN=" "
themes/jispwoso.zsh-theme
1 PROMPT=$'%{$fg[green]%}%n@%m: %{$reset_color%}%{$fg[blue]%}%/%{$reset_color%} 1 local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
2 %{$fg_bold[red]%}➜ %{$reset_color%} ' 2 PROMPT=$'%{$fg[green]%}%n@%m: %{$reset_color%}%{$fg[blue]%}%/ %{$reset_color%}%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}
3 ${ret_status} %{$reset_color%} '
3 4
4 PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}" 5 PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}"
6
7 ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
8 ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
9 ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
10 ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
5 11
themes/rkj-repos.zsh-theme
1 # user, host, full path, and time/date 1 # user, host, full path, and time/date
2 # on two lines for easier vgrepping 2 # on two lines for easier vgrepping
3 # entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 3 # entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888
4 4
5 function hg_prompt_info { 5 function hg_prompt_info {
6 hg prompt --angle-brackets "\ 6 hg prompt --angle-brackets "\
7 <hg:%{$fg[magenta]%}<branch>%{$reset_color%}><:%{$fg[magenta]%}<bookmark>%{$reset_color%}>\ 7 <hg:%{$fg[magenta]%}<branch>%{$reset_color%}><:%{$fg[magenta]%}<bookmark>%{$reset_color%}>\
8 </%{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\ 8 </%{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\
9 %{$fg[red]%}<status|modified|unknown><update>%{$reset_color%}< 9 %{$fg[red]%}<status|modified|unknown><update>%{$reset_color%}<
10 patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null 10 patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null
11 } 11 }
12 12
13 ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}+" 13 ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}+"
14 ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}✱" 14 ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}✱"
15 ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✗" 15 ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✗"
16 ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}➦" 16 ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}➦"
17 ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%}✂" 17 ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%}✂"
18 ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}✈" 18 ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[blue]%}✈"
19 ZSH_THEME_GIT_PROMPT_SHA_BEFORE=" %{$fg[grey]%}" 19 ZSH_THEME_GIT_PROMPT_SHA_BEFORE=" %{$fg[blue]%}"
20 ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$reset_color%}" 20 ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$reset_color%}"
21 21
22 function mygit() { 22 function mygit() {
23 if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then 23 if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
24 ref=$(command git symbolic-ref HEAD 2> /dev/null) || \ 24 ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
25 ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 25 ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
26 echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(git_prompt_short_sha)$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX " 26 echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(git_prompt_short_sha)$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX "
27 fi 27 fi
28 } 28 }
29 29
30 function retcode() {} 30 function retcode() {}
31 31
32 # alternate prompt with git & hg 32 # alternate prompt with git & hg
33 PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} 33 PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}
34 %{\e[0;34m%}%B└─%B[%{\e[1;35m%}%?$(retcode)%{\e[0;34m%}%B] <$(mygit)$(hg_prompt_info)>%{\e[0m%}%b ' 34 %{\e[0;34m%}%B└─%B[%{\e[1;35m%}%?$(retcode)%{\e[0;34m%}%B] <$(mygit)$(hg_prompt_info)>%{\e[0m%}%b '
35 PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' 35 PS2=$' \e[0;34m%}%B>%{\e[0m%}%b '
36 36
37 37
themes/trapd00r.zsh-theme
1 # trapd00r.zsh-theme 1 # trapd00r.zsh-theme
2 # 2 #
3 # This theme needs a terminal supporting 256 colors as well as unicode. It also 3 # This theme needs a terminal supporting 256 colors as well as unicode. It also
4 # needs the script that splits up the current path and makes it fancy as located 4 # needs the script that splits up the current path and makes it fancy as located
5 # here: https://github.com/trapd00r/utils/blob/master/zsh_path 5 # here: https://github.com/trapd00r/utils/blob/master/zsh_path
6 # 6 #
7 # By default it spans over two lines like so: 7 # By default it spans over two lines like so:
8 # 8 #
9 # scp1@shiva:pts/9-> /home » scp1 (0) 9 # scp1@shiva:pts/9-> /home » scp1 (0)
10 # > 10 # >
11 # 11 #
12 # that's user@host:pts/-> splitted path (return status) 12 # that's user@host:pts/-> splitted path (return status)
13 # 13 #
14 # If the current directory is a git repository, we span 3 lines; 14 # If the current directory is a git repository, we span 3 lines;
15 # 15 #
16 # git❨ master ❩ DIRTY 16 # git❨ master ❩ DIRTY
17 # scp1@shiva:pts/4-> /home » scp1 » dev » utils (0) 17 # scp1@shiva:pts/4-> /home » scp1 » dev » utils (0)
18 # > 18 # >
19 19
20 autoload -U add-zsh-hook 20 autoload -U add-zsh-hook
21 autoload -Uz vcs_info 21 autoload -Uz vcs_info
22 22
23 local c0=$( printf "\e[m") 23 local c0=$( printf "\e[m")
24 local c1=$( printf "\e[38;5;245m") 24 local c1=$( printf "\e[38;5;245m")
25 local c2=$( printf "\e[38;5;250m") 25 local c2=$( printf "\e[38;5;250m")
26 local c3=$( printf "\e[38;5;242m") 26 local c3=$( printf "\e[38;5;242m")
27 local c4=$( printf "\e[38;5;197m") 27 local c4=$( printf "\e[38;5;197m")
28 local c5=$( printf "\e[38;5;225m") 28 local c5=$( printf "\e[38;5;225m")
29 local c6=$( printf "\e[38;5;240m") 29 local c6=$( printf "\e[38;5;240m")
30 local c7=$( printf "\e[38;5;242m") 30 local c7=$( printf "\e[38;5;242m")
31 local c8=$( printf "\e[38;5;244m") 31 local c8=$( printf "\e[38;5;244m")
32 local c9=$( printf "\e[38;5;162m") 32 local c9=$( printf "\e[38;5;162m")
33 local c10=$(printf "\e[1m") 33 local c10=$(printf "\e[1m")
34 local c11=$(printf "\e[38;5;208m\e[1m") 34 local c11=$(printf "\e[38;5;208m\e[1m")
35 local c12=$(printf "\e[38;5;142m\e[1m") 35 local c12=$(printf "\e[38;5;142m\e[1m")
36 local c13=$(printf "\e[38;5;196m\e[1m") 36 local c13=$(printf "\e[38;5;196m\e[1m")
37 37
38 38
39 # We dont want to use the extended colorset in the TTY / VC. 39 # We dont want to use the extended colorset in the TTY / VC.
40 if [ "$TERM" = "linux" ]; then 40 if [ "$TERM" = "linux" ]; then
41 c1=$( printf "\e[34;1m") 41 c1=$( printf "\e[34;1m")
42 c2=$( printf "\e[35m") 42 c2=$( printf "\e[35m")
43 c3=$( printf "\e[31m") 43 c3=$( printf "\e[31m")
44 c4=$( printf "\e[31;1m") 44 c4=$( printf "\e[31;1m")
45 c5=$( printf "\e[32m") 45 c5=$( printf "\e[32m")
46 c6=$( printf "\e[32;1m") 46 c6=$( printf "\e[32;1m")
47 c7=$( printf "\e[33m") 47 c7=$( printf "\e[33m")
48 c8=$( printf "\e[33;1m") 48 c8=$( printf "\e[33;1m")
49 c9=$( printf "\e[34m") 49 c9=$( printf "\e[34m")
50 50
51 c11=$(printf "\e[35;1m") 51 c11=$(printf "\e[35;1m")
52 c12=$(printf "\e[36m") 52 c12=$(printf "\e[36m")
53 c13=$(printf "\e[31;1m") 53 c13=$(printf "\e[31;1m")
54 fi 54 fi
55 55
56 zstyle ':vcs_info:*' actionformats \ 56 zstyle ':vcs_info:*' actionformats \
57 '%{$c8%}(%f%s)%{$c7%}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' 57 '%{$c8%}(%f%s)%{$c7%}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
58 58
59 zstyle ':vcs_info:*' formats \ 59 zstyle ':vcs_info:*' formats \
60 "%{$c8%}%s%%{$c7%}❨ %{$c9%}%{$c11%}%b%{$c7%} ❩%{$reset_color%}%f " 60 "%{$c8%}%s%%{$c7%}❨ %{$c9%}%{$c11%}%b%{$c7%} ❩%{$reset_color%}%f "
61 61
62 zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' 62 zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
63 zstyle ':vcs_info:*' enable git 63 zstyle ':vcs_info:*' enable git
64 64
65 add-zsh-hook precmd prompt_jnrowe_precmd 65 add-zsh-hook precmd prompt_jnrowe_precmd
66 66
67 prompt_jnrowe_precmd () { 67 prompt_jnrowe_precmd () {
68 vcs_info 68 vcs_info
69 if [ "${vcs_info_msg_0_}" = "" ]; then 69 if [ "${vcs_info_msg_0_}" = "" ]; then
70 dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" 70 dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
71 PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%} 71 PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%}
72 > ' 72 > '
73 73
74 # modified, to be commited 74 # modified, to be commited
75 elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then 75 elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then
76 dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" 76 dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
77 PROMPT='${vcs_info_msg_0_}%{$30%} %{$bg_bold[red]%}%{$fg_bold[cyan]%}C%{$fg_bold[black]%}OMMIT%{$reset_color%} 77 PROMPT='${vcs_info_msg_0_}%{$30%} %{$bg_bold[red]%}%{$fg_bold[cyan]%}C%{$fg_bold[black]%}OMMIT%{$reset_color%}
78 %{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} 78 %{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%}
79 > ' 79 > '
80 80
81 elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then 81 elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then
82 dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" 82 dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
83 PROMPT='${vcs_info_msg_0_}%{$bg_bold[red]%}%{$fg_bold[blue]%}D%{$fg_bold[black]%}IRTY%{$reset_color%} 83 PROMPT='${vcs_info_msg_0_}%{$bg_bold[red]%}%{$fg_bold[blue]%}D%{$fg_bold[black]%}IRTY%{$reset_color%}
84 %{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%} 84 %{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%}
85 %{$c13%}>%{$c0%} ' 85 %{$c13%}>%{$c0%} '
86 else 86 else
87 dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})" 87 dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
88 PROMPT='${vcs_info_msg_0_} 88 PROMPT='${vcs_info_msg_0_}
89 %{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%} 89 %{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%}
90 > ' 90 > '
91 fi 91 fi
92 } 92 }
93 93
94 # vim: set ft=zsh sw=2 et tw=0: 94 # vim: set ft=zsh sw=2 et tw=0:
95 95
1 # Clean, simple, compatible and meaningful. 1 # Clean, simple, compatible and meaningful.
2 # Tested on Linux, Unix and Windows under ANSI colors. 2 # Tested on Linux, Unix and Windows under ANSI colors.
3 # It is recommended to use with a dark background and the font Inconsolata. 3 # It is recommended to use with a dark background and the font Inconsolata.
4 # Colors: black, red, green, yellow, *blue, magenta, cyan, and white. 4 # Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
5 # 5 #
6 # http://ysmood.org/wp/2013/03/my-ys-terminal-theme/ 6 # http://ysmood.org/wp/2013/03/my-ys-terminal-theme/
7 # Mar 2013 ys 7 # Mar 2013 ys
8 8
9 # Machine name. 9 # Machine name.
10 function box_name { 10 function box_name {
11 [ -f ~/.box-name ] && cat ~/.box-name || echo $HOST 11 [ -f ~/.box-name ] && cat ~/.box-name || echo $HOST
12 } 12 }
13 13
14 # Directory info. 14 # Directory info.
15 local current_dir='${PWD/#$HOME/~}' 15 local current_dir='${PWD/#$HOME/~}'
16 16
17 # VCS
18 YS_VCS_PROMPT_PREFIX1=" %{$fg[white]%}on%{$reset_color%} "
19 YS_VCS_PROMPT_PREFIX2=":%{$fg[cyan]%}"
20 YS_VCS_PROMPT_SUFFIX="%{$reset_color%}"
21 YS_VCS_PROMPT_DIRTY=" %{$fg[red]%}x"
22 YS_VCS_PROMPT_CLEAN=" %{$fg[green]%}o"
23
17 # Git info. 24 # Git info.
18 local git_info='$(git_prompt_info)' 25 local git_info='$(git_prompt_info)'
19 ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[white]%}on%{$reset_color%} git:%{$fg[cyan]%}" 26 ZSH_THEME_GIT_PROMPT_PREFIX="${YS_VCS_PROMPT_PREFIX1}git${YS_VCS_PROMPT_PREFIX2}"
20 ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 27 ZSH_THEME_GIT_PROMPT_SUFFIX="$YS_VCS_PROMPT_SUFFIX"
21 ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}x" 28 ZSH_THEME_GIT_PROMPT_DIRTY="$YS_VCS_PROMPT_DIRTY"
22 ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}o" 29 ZSH_THEME_GIT_PROMPT_CLEAN="$YS_VCS_PROMPT_CLEAN"
30
31 # HG info
32 local hg_info='$(ys_hg_prompt_info)'
33 ys_hg_prompt_info() {
34 # make sure this is a hg dir
35 if [ -d '.hg' ]; then
36 echo -n "${YS_VCS_PROMPT_PREFIX1}hg${YS_VCS_PROMPT_PREFIX2}"
37 echo -n $(hg branch 2>/dev/null)
38 if [ -n "$(hg status 2>/dev/null)" ]; then
39 echo -n "$YS_VCS_PROMPT_DIRTY"
40 else
41 echo -n "$YS_VCS_PROMPT_CLEAN"
42 fi
43 echo -n "$YS_VCS_PROMPT_SUFFIX"
44 fi
45 }
23 46
24 # Prompt format: \n # USER at MACHINE in DIRECTORY on git:BRANCH STATE [TIME] \n $ 47 # Prompt format: \n # USER at MACHINE in DIRECTORY on git:BRANCH STATE [TIME] \n $
25 PROMPT=" 48 PROMPT="
26 %{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \ 49 %{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \
27 %{$fg[cyan]%}%n \ 50 %{$fg[cyan]%}%n \
28 %{$fg[white]%}at \ 51 %{$fg[white]%}at \
29 %{$fg[green]%}$(box_name) \ 52 %{$fg[green]%}$(box_name) \
30 %{$fg[white]%}in \ 53 %{$fg[white]%}in \
31 %{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\ 54 %{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\
55 ${hg_info}\
32 ${git_info} \ 56 ${git_info} \
33 %{$fg[white]%}[%*] 57 %{$fg[white]%}[%*]
34 %{$terminfo[bold]$fg[red]%}$ %{$reset_color%}" 58 %{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"
35 59
36 if [[ "$USER" == "root" ]]; then 60 if [[ "$USER" == "root" ]]; then
37 PROMPT=" 61 PROMPT="
38 %{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \ 62 %{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \
39 %{$bg[yellow]%}%{$fg[cyan]%}%n%{$reset_color%} \ 63 %{$bg[yellow]%}%{$fg[cyan]%}%n%{$reset_color%} \
40 %{$fg[white]%}at \ 64 %{$fg[white]%}at \
41 %{$fg[green]%}$(box_name) \ 65 %{$fg[green]%}$(box_name) \
42 %{$fg[white]%}in \ 66 %{$fg[white]%}in \
43 %{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\ 67 %{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\
68 ${hg_info}\
44 ${git_info} \ 69 ${git_info} \
45 %{$fg[white]%}[%*] 70 %{$fg[white]%}[%*]
46 %{$terminfo[bold]$fg[red]%}$ %{$reset_color%}" 71 %{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"
47 fi 72 fi
48 73