-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
378 lines (292 loc) · 17.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
<!DOCTYPE HTML>
<html>
<head>
<title>GetAntibody</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="content-language" content="en-us" />
<meta name="generator" content="Hugo 0.76.0" />
<link rel="stylesheet" href="https://getantibody.github.io/css/index.css">
<link rel="apple-touch-icon" href="https://getantibody.github.io/apple-touch-icon.png">
<link rel="shortcut icon" href="https://getantibody.github.io/favicon.ico" type="image/x-icon">
</head>
<body>
<div class="Wrapper">
<div class="Container">
<div class="Header">
<a href="https://getantibody.github.io/">
<div class="Title center">
<img alt="GetAntibody Logo" src="https://avatars2.githubusercontent.com/u/16625397?v=3&s=140" height="140" />
<span class="text">GetAntibody</span>
<span class="subtext"></span>
</div>
</a>
</div>
<div class="Content-wrapper">
<div class="Sidebar">
<div class="Menu">
<div class="item">
<a href="https://getantibody.github.io/">Home</a>
</div>
<div class="item">
<a href="https://getantibody.github.io/intro/">Introduction</a>
</div>
<div class="item">
<a href="https://getantibody.github.io/fast/">How much faster?</a>
</div>
<div class="item">
<a href="https://getantibody.github.io/even-faster/">Make it even faster</a>
</div>
<div class="item">
<a href="https://getantibody.github.io/compat/">Compatibility</a>
</div>
<div class="item">
<a href="https://getantibody.github.io/install/">Install</a>
</div>
<div class="item">
<a href="https://getantibody.github.io/usage/">Usage</a>
</div>
<div class="item">
<a href="https://getantibody.github.io/options/">Options</a>
</div>
<div class="item">
<a href="https://getantibody.github.io/update/">Outro</a>
</div>
<div class="item">
<a href="https://getantibody.github.io/links/">Links</a>
</div>
</div>
</div>
<div class="Content">
<div class="Page" id="Introduction">
<h1><a href="https://getantibody.github.io/intro/">Introduction</a></h1>
<p>Antibody is a shell plugin manager made from the ground up thinking about
performance.</p>
<p>It is faster because it can do things concurrently, while Antigen does it
sequentially. It also has the advantage of using a compiled language instead
of a scripting one.</p>
<p>You can see it working in the below example:</p>
<!-- raw HTML omitted -->
</div>
<div class="Page" id="How much faster?">
<h1><a href="https://getantibody.github.io/fast/">How much faster?</a></h1>
<p>Let’s see how much faster antibody is over antigen:</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<p>Data from <a href="https://github.com/getantibody/speed">getantibody/speed</a> repository.</p>
</div>
<div class="Page" id="Make it even faster">
<h1><a href="https://getantibody.github.io/even-faster/">Make it even faster</a></h1>
<p>Antibody is faster than other zsh package managers, but you might want to speed it up further.</p>
<p>Highly recommended to read the following:</p>
<ul>
<li><a href="https://carlosbecker.com/posts/speeding-up-zsh/">Speeding up my ZSH load - Carlos Alexandro Becker</a>: outlines a few fixes that will speed up the prompt massively. Also explains how to debug your prompt load time.</li>
<li><a href="https://gist.github.com/ctechols/ca1035271ad134841284">Speed up zsh compinit by only checking cache once a day.</a>: mentioned in the previous link, but leaving this here for reference as it is helpful for anyone using zsh.</li>
<li><a href="http://jb-blog.readthedocs.io/en/latest/posts/0032-debugging-zsh-startup-time.html">How to debug zsh startup time — JB on programming 1.0.0 documentation</a></li>
</ul>
</div>
<div class="Page" id="Compatibility">
<h1><a href="https://getantibody.github.io/compat/">Compatibility</a></h1>
<p>Since antibody started as a subset clone of antigen, one might wonder
how compatible one is with another. Let’s take a look.</p>
<p>Antibody can only <code>bundle</code> and <code>update</code> plugins. The <code>apply</code> command is not
needed because running <code>antibody bundle</code> will already download and apply the
given plugin.</p>
<p>The <code>theme</code> command is not implemented. You can just use <code>bundle</code> instead.</p>
<p>oh-my-zsh plugins are supported by using the <a href="#options.path"><code>path</code> annotation</a>:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh">antibody bundle ohmyzsh/ohmyzsh path:plugins/aws
</code></pre></div>
</div>
<div class="Page" id="Install">
<h1><a href="https://getantibody.github.io/install/">Install</a></h1>
<p>Antibody can be installed through a variety of sources.</p>
<p>The simplest way is to run:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh">curl -sfL git.io/antibody | sh -s - -b /usr/local/bin
</code></pre></div><p>This will put the binary in <code>/usr/local/bin/antibody</code></p>
<p>You can also use homebrew (on macOS):</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh">brew install antibody
</code></pre></div><p>Or even using <a href="https://aur.archlinux.org/packages/antibody/">AUR</a> on Arch Linux.</p>
<p>You can also always download and install manually via tar.gz archives or
using dpkg and our deb archives. Just head to the
<a href="https://github.com/getantibody/antibody/releases">releases page</a> and chose
your poison.</p>
</div>
<div class="Page" id="Usage">
<h1><a href="https://getantibody.github.io/usage/">Usage</a></h1>
<p>There are mainly two ways of using antibody: static and dynamic.
We will also see how we can keep a plugins file.</p>
<h2 id="plugins-file">Plugins file</h2>
<p>A plugin file is basically any text file that has one plugin per line.</p>
<p>In our examples, let’s assume we have a <code>~/.zsh_plugins.txt</code> with these
contents:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh">caarlos0/jvm
djui/alias-tips
<span style="color:#6272a4"># comments are supported like this</span>
caarlos0/zsh-mkc
zsh-users/zsh-completions
caarlos0/zsh-open-github-pr
<span style="color:#6272a4"># empty lines are skipped</span>
<span style="color:#6272a4"># annotations are also allowed:</span>
ohmyzsh/ohmyzsh path:plugins/aws
zsh-users/zsh-syntax-highlighting
zsh-users/zsh-history-substring-search
</code></pre></div><p>That being said, let’s look how can we load them!</p>
<h2 id="dynamic-loading">Dynamic loading</h2>
<p>This is the most common way. Basically, every time the a new shell starts,
antibody will apply the plugins given to it.</p>
<p>For this to work, antibody needs to be wrapped into your <code>~/.zshrc</code>. To do
that, run:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh"><span style="color:#6272a4"># ~/.zshrc</span>
<span style="color:#8be9fd;font-style:italic">source</span> <<span style="color:#ff79c6">(</span>antibody init<span style="color:#ff79c6">)</span>
</code></pre></div><p>And reload your current shell or open a new one.</p>
<p>Then, you will also need to tell antibody which plugins to bundle.
This can also be done in the <code>~/.zshrc</code> file:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh"><span style="color:#6272a4"># ~/.zshrc</span>
antibody bundle < ~/.zsh_plugins.txt
</code></pre></div><h2 id="static-loading">Static loading</h2>
<p>This is the faster alternative. Basically, you’ll run antibody only when
you change your plugins, and then you can just load the “static” plugins file.</p>
<p>Note that in this case, <strong>we should not put <code>antibody init</code> on our <code>~/.zshrc</code></strong>.
If you did that already, remove it from your <code>~/.zshrc</code> and start a fresh
terminal session.</p>
<p>Assuming the same <code>~/.zsh_plugins.txt</code> as before, we can run:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh">antibody bundle < ~/.zsh_plugins.txt > ~/.zsh_plugins.sh
</code></pre></div><p>At any time to update our <code>~/.zsh_plugins.sh</code> file. Now, we just need to
<code>source</code> that file on <code>~/.zshrc</code>:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh"><span style="color:#6272a4"># ~/.zshrc</span>
<span style="color:#8be9fd;font-style:italic">source</span> ~/.zsh_plugins.sh
</code></pre></div><p>And that’s it!</p>
<h2 id="cleanmymac-and-others">CleanMyMac and others</h2>
<p>If you use CleanMyMac or similar tools, make sure to set it up to ignore the
<code>antibody home</code> folder, otherwise it may delete your plugins.</p>
<p>You may also change Antibody’s home folder, for example:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh"><span style="color:#8be9fd;font-style:italic">export</span> <span style="color:#8be9fd;font-style:italic">ANTIBODY_HOME</span><span style="color:#ff79c6">=</span>~/Libary/antibody
</code></pre></div>
</div>
<div class="Page" id="Options">
<h1><a href="https://getantibody.github.io/options/">Options</a></h1>
<p>There are a few options you can use that should cover most common use cases.
Let’s take a look!</p>
<h2 id="kind">Kind</h2>
<p>The <code>kind</code> annotation can be used to determine how a bundle should be treated.</p>
<h3 id="zsh">zsh</h3>
<p>The default is <code>kind:zsh</code>, which will look for files that match these globs:</p>
<ul>
<li><code>*.plugin.zsh</code></li>
<li><code>*.zsh</code></li>
<li><code>*.sh</code></li>
<li><code>*.zsh-theme</code></li>
</ul>
<p>And <code>source</code> them.</p>
<p>Example:</p>
<pre><code class="language-console" data-lang="console">$ antibody bundle caarlos0/jvm kind:zsh
source /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-jvm/jvm.plugin.zsh
</code></pre><h3 id="path">path</h3>
<p>The <code>kind:path</code> mode will just put the plugin folder in your <code>$PATH</code>.</p>
<p>Example:</p>
<pre><code class="language-console" data-lang="console">$ antibody bundle caarlos0/ports kind:path
export PATH="/Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-ports:$PATH"
</code></pre><h3 id="fpath">fpath</h3>
<p>The <code>kind:fpath</code> only puts the plugin folder on the <code>fpath</code>, doing nothing else.
It can be specially useful for completion scripts that won’t allow to be
sourced.</p>
<p>Example:</p>
<pre><code class="language-console" data-lang="console">$ antibody bundle Linuxbrew/brew path:completions/zsh kind:fpath
fpath+=( /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-Linuxbrew-SLASH-brew/completions/zsh )
</code></pre><h3 id="clone">clone</h3>
<p>The <code>kind:clone</code> only gets the plugin, doing nothing else. It can be useful for
managing a package that isn’t directly used as a shell plugin.</p>
<p>Example:</p>
<pre><code class="language-console" data-lang="console">$ antibody bundle mbadolato/iTerm2-Color-Schemes kind:clone
</code></pre><h2 id="branch">Branch</h2>
<p>You can also specify a branch to download, if you don’t want the <code>master</code> branch
for whatever reason.</p>
<p>Example:</p>
<pre><code class="language-console" data-lang="console">$ antibody bundle caarlos0/jvm branch:v2
source /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-jvm/jvm.plugin.zsh
</code></pre><h2 id="path-1">Path</h2>
<p>You may specify a subfolder or a specific file if the repo you are bundling
contains multiple plugins.</p>
<p>Example:</p>
<pre><code class="language-console" data-lang="console">$ antibody bundle ohmyzsh/ohmyzsh path:plugins/aws
source /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/aws/aws.plugin.zsh
fpath+=( /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/aws )
</code></pre><p>If you want multiple paths within from the same plugin, you can just repeat the
plugin with a different <code>path</code> option:</p>
<pre><code class="language-console" data-lang="console">$ antibody bundle "ohmyzsh/ohmyzsh path:plugins/aws/aws.plugin.zsh
ohmyzsh/ohmyzsh path:plugins/asdf"
source /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/aws/aws.plugin.zsh
fpath+=( /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/aws )
source /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/asdf/asdf.plugin.zsh
fpath+=( /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/asdf )
</code></pre>
</div>
<div class="Page" id="Outro">
<h1><a href="https://getantibody.github.io/update/">Outro</a></h1>
<p>Let’s look what other commands antibody has available for us!</p>
<h2 id="update">Update</h2>
<p>Antibody can update all bundles in a single pass.</p>
<p>Just run:</p>
<pre><code class="language-console" data-lang="console">$ antibody update
Updating all bundles in /Users/carlos/Library/Caches/antibody...
</code></pre><p>and that’s it.</p>
<h2 id="purge">Purge</h2>
<p>You can remove a bundle completely by purging it:</p>
<pre><code class="language-console" data-lang="console">$ antibody purge ohmyzsh/ohmyzsh
Removing ohmyzsh/ohmyzsh...
</code></pre><h2 id="list">List</h2>
<p>If you want to see what plugins you have in your home folder, you can of
course list them:</p>
<pre><code class="language-console" data-lang="console">$ antibody list
https://github.com/Tarrasch/zsh-bd /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-Tarrasch-SLASH-zsh-bd
https://github.com/caarlos0/git-add-remote /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-git-add-remote
# ...
</code></pre><h2 id="path">Path</h2>
<p>You can see the path being used for a cloned bundle.</p>
<pre><code class="language-console" data-lang="console">$ antibody path ohmyzsh/ohmyzsh
/Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh
</code></pre><p>This is particularly useful for projects like oh-my-zsh that rely on
storing its path in the <code>$ZSH</code> environment variable:</p>
<pre><code class="language-console" data-lang="console">$ ZSH=$(antibody path ohmyzsh/ohmyzsh)
</code></pre><h2 id="home">Home</h2>
<p>You can also see where antibody is keeping the plugins with the home
command:</p>
<pre><code class="language-console" data-lang="console">$ antibody home
/Users/carlos/Library/Caches/antibody
</code></pre><p>Of course, you can remove the entire thing with:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh">rm -rf <span style="color:#f1fa8c">`</span>antibody home<span style="color:#f1fa8c">`</span>
</code></pre></div><p>if you decide to start fresh or to use something else.</p>
</div>
<div class="Page" id="Links">
<h1><a href="https://getantibody.github.io/links/">Links</a></h1>
<ul>
<li>Follow the progress on the <a href="https://github.com/getantibody/antibody">GitHub repository</a></li>
<li>Follow <a href="https://twitter.com/caarlos0">@caarlos0</a> on Twitter for updates</li>
<li><a href="https://github.com/getantibody/antibody/blob/master/CONTRIBUTING.md">Contributing Guidelines</a></li>
</ul>
<p>This project adheres to the Contributor Covenant
<a href="https://github.com/getantibody/antibody/blob/master/CODE_OF_CONDUCT.md">code of conduct</a>.
By participating, you are expected to uphold this code.</p>
</div>
<div class="Footer">
<p>Made with ❤️ by GetAntibody contributors.</p>
</div>
<script src="https://getantibody.github.io/js/index.js"></script>
<script type="application/javascript">
var doNotTrack = false;
if (!doNotTrack) {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-68164063-1', 'auto');
ga('send', 'pageview');
}
</script>
</div>
</div>
</div>
</body>
</html>