spaceship-prompt 3.16.5 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +106 -0
- package/README.md +156 -211
- package/lib/cache.zsh +30 -0
- package/lib/cli.zsh +336 -0
- package/lib/config.zsh +32 -0
- package/lib/core.zsh +154 -0
- package/lib/hooks.zsh +60 -11
- package/lib/prompts.zsh +65 -0
- package/lib/section.zsh +93 -43
- package/lib/testkit.zsh +19 -0
- package/lib/utils.zsh +164 -14
- package/package.json +17 -8
- package/scripts/install +12 -0
- package/scripts/{tests.sh → tests} +0 -0
- package/scripts/uninstall +10 -0
- package/sections/async.zsh +45 -0
- package/sections/aws.zsh +6 -4
- package/sections/battery.zsh +7 -5
- package/sections/char.zsh +7 -7
- package/sections/conda.zsh +6 -5
- package/sections/dir.zsh +8 -6
- package/sections/docker.zsh +11 -7
- package/sections/docker_context.zsh +2 -1
- package/sections/dotnet.zsh +9 -6
- package/sections/elixir.zsh +7 -5
- package/sections/elm.zsh +8 -5
- package/sections/exec_time.zsh +6 -5
- package/sections/exit_code.zsh +5 -4
- package/sections/gcloud.zsh +14 -12
- package/sections/git.zsh +20 -5
- package/sections/git_branch.zsh +5 -2
- package/sections/git_status.zsh +10 -16
- package/sections/golang.zsh +8 -6
- package/sections/haskell.zsh +9 -6
- package/sections/hg.zsh +19 -5
- package/sections/hg_branch.zsh +3 -2
- package/sections/hg_status.zsh +3 -2
- package/sections/host.zsh +4 -4
- package/sections/ibmcloud.zsh +16 -14
- package/sections/java.zsh +35 -0
- package/sections/jobs.zsh +6 -5
- package/sections/julia.zsh +6 -4
- package/sections/kubectl.zsh +15 -6
- package/sections/kubectl_context.zsh +20 -19
- package/sections/kubectl_version.zsh +6 -5
- package/sections/line_sep.zsh +3 -1
- package/sections/node.zsh +11 -9
- package/sections/package.zsh +85 -38
- package/sections/php.zsh +8 -5
- package/sections/python.zsh +44 -0
- package/sections/ruby.zsh +9 -6
- package/sections/rust.zsh +10 -6
- package/sections/swift.zsh +7 -5
- package/sections/terraform.zsh +7 -5
- package/sections/time.zsh +7 -7
- package/sections/user.zsh +5 -5
- package/sections/venv.zsh +8 -6
- package/sections/xcode.zsh +7 -5
- package/spaceship.zsh +56 -88
- package/scripts/install.sh +0 -126
- package/scripts/uninstall.sh +0 -113
- package/sections/ember.zsh +0 -36
- package/sections/gradle.zsh +0 -93
- package/sections/maven.zsh +0 -97
- package/sections/pyenv.zsh +0 -37
- package/sections/vi_mode.zsh +0 -58
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,109 @@
|
|
|
1
|
+
# [4.0.0](https://github.com/spaceship-prompt/spaceship-prompt/compare/v3.16.7...v4.0.0) (2022-09-01)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add permissions to scripts ([7c3e427](https://github.com/spaceship-prompt/spaceship-prompt/commit/7c3e42727531ff612588722c509da643566f57fd))
|
|
7
|
+
* add x permissions to files ([9a34149](https://github.com/spaceship-prompt/spaceship-prompt/commit/9a341498bb6d31bf6d179121adbe781972fcde26))
|
|
8
|
+
* **async:** remove obsolete runtime variables ([2128ab0](https://github.com/spaceship-prompt/spaceship-prompt/commit/2128ab0046080d633c29a69f86322ca4ca9bed90))
|
|
9
|
+
* cherry pick [#1089](https://github.com/spaceship-prompt/spaceship-prompt/issues/1089) ([52448c1](https://github.com/spaceship-prompt/spaceship-prompt/commit/52448c121f7d3602e2e046ae674b70c5a8bbdafa))
|
|
10
|
+
* **cli:** Add missing commands in help message ([c2eb3e3](https://github.com/spaceship-prompt/spaceship-prompt/commit/c2eb3e35e8088c014cc0ed04aaab8133afaa3dd6))
|
|
11
|
+
* compdef only when compdef is available ([c309af6](https://github.com/spaceship-prompt/spaceship-prompt/commit/c309af62cbb8411583228a179ccb37d8329d2af6))
|
|
12
|
+
* **docker:** add additional utils inside docker image ([8813eb0](https://github.com/spaceship-prompt/spaceship-prompt/commit/8813eb0b691d1ccab1042c93edffc1c43764a0b5))
|
|
13
|
+
* fix command-line completion leving one letter on the beginning of prompt ([6a4abd5](https://github.com/spaceship-prompt/spaceship-prompt/commit/6a4abd5c3489ef3a1f1387673bafdb2ab0298887)), closes [#1064](https://github.com/spaceship-prompt/spaceship-prompt/issues/1064)
|
|
14
|
+
* **git:** Add explicit variable for async rendering ([cfa95e6](https://github.com/spaceship-prompt/spaceship-prompt/commit/cfa95e6c80ee9d5d9dfa486daf892c1021278140))
|
|
15
|
+
* **git:** fix ahead/behind indicators ([a067c4d](https://github.com/spaceship-prompt/spaceship-prompt/commit/a067c4df0b663410f7e617e9a2240393f9219095))
|
|
16
|
+
* **git:** Fix typo in a section signature ([f8ed612](https://github.com/spaceship-prompt/spaceship-prompt/commit/f8ed612d8b5328d934a86c5664a745e9fbc0628d))
|
|
17
|
+
* **hg:** Add options for async rendering ([d5bdfa4](https://github.com/spaceship-prompt/spaceship-prompt/commit/d5bdfa42dc969fe9098792a305b34352d1ba4048))
|
|
18
|
+
* **kubectl:** fix kubectl section ([1b71e09](https://github.com/spaceship-prompt/spaceship-prompt/commit/1b71e096dd68be80672173686ea1974d8095ea45))
|
|
19
|
+
* make core variables readonly ([1cd4756](https://github.com/spaceship-prompt/spaceship-prompt/commit/1cd4756caf2080f8a13bd5aab15d927660f3d836))
|
|
20
|
+
* NEWLINE variable doesn't work ([28b37f5](https://github.com/spaceship-prompt/spaceship-prompt/commit/28b37f566ebc141c93395d003601e1447f6bf91f))
|
|
21
|
+
* **ps2:** print PS2 properly ([0d9766c](https://github.com/spaceship-prompt/spaceship-prompt/commit/0d9766c8b65707cb3e7eef19f78bb080cdda3e1b))
|
|
22
|
+
* put user config loading in a proper place ([5c68702](https://github.com/spaceship-prompt/spaceship-prompt/commit/5c68702d6e695b517ca89593777651d665c8719e))
|
|
23
|
+
* **python:** use python3 command ([0466bb8](https://github.com/spaceship-prompt/spaceship-prompt/commit/0466bb8a9c443e930d9ba11318b5fe6b0f8a6cca))
|
|
24
|
+
* **renderer:** fix missing options for globes ([107429c](https://github.com/spaceship-prompt/spaceship-prompt/commit/107429ce5ea936d25fc8cbf813fcf256be75c683))
|
|
25
|
+
* rendering docker context ([b6a49f8](https://github.com/spaceship-prompt/spaceship-prompt/commit/b6a49f8e00f28f265c13340183d102a1bbe5252f))
|
|
26
|
+
* Resolve newline issue with command expansion ([bcfce70](https://github.com/spaceship-prompt/spaceship-prompt/commit/bcfce70c8552d4b8e378e7b542754da4115ce7b8))
|
|
27
|
+
* **scripts:** Stop on errors ([ccee8e9](https://github.com/spaceship-prompt/spaceship-prompt/commit/ccee8e994d5bd1ddda8c3ed89e9d6767792a7b67))
|
|
28
|
+
* set proper message if no account ([#1099](https://github.com/spaceship-prompt/spaceship-prompt/issues/1099)) ([69f906c](https://github.com/spaceship-prompt/spaceship-prompt/commit/69f906caa21af14b7ae199f2252629331485b8cd))
|
|
29
|
+
* support CLOUDSDK_CONFIG env ([#1122](https://github.com/spaceship-prompt/spaceship-prompt/issues/1122)) ([ae348f9](https://github.com/spaceship-prompt/spaceship-prompt/commit/ae348f9a3df50b13134f1dc7f5eaa574f215cf74)), closes [#1117](https://github.com/spaceship-prompt/spaceship-prompt/issues/1117)
|
|
30
|
+
* **tests:** render prefixes and suffixes only when they are not empty ([73c2c71](https://github.com/spaceship-prompt/spaceship-prompt/commit/73c2c7135edfeadb92b285c7db70af63566f7852))
|
|
31
|
+
* **upsearch:** Check repo properly ([4764ed9](https://github.com/spaceship-prompt/spaceship-prompt/commit/4764ed921d2b6a78c2ea72641ba91ed072e7b3b5))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Code Refactoring
|
|
35
|
+
|
|
36
|
+
* **ember:** remove ember from built-in sections ([05beb8b](https://github.com/spaceship-prompt/spaceship-prompt/commit/05beb8b56f6203d215c50c0b26ff27174b9104ab))
|
|
37
|
+
* **gradle:** migrate Gradle to a separate repo ([984bc01](https://github.com/spaceship-prompt/spaceship-prompt/commit/984bc01c073c399dfb7484c5ecdff672062a213f))
|
|
38
|
+
* **install:** simplify the installation process ([824f876](https://github.com/spaceship-prompt/spaceship-prompt/commit/824f87657309b1f2579173252667a3cfb88c881e))
|
|
39
|
+
* **maven:** migrate Maven to a separate repo ([3efd48b](https://github.com/spaceship-prompt/spaceship-prompt/commit/3efd48b55029ae2c68bbf4e3a43fb922c8b3e942))
|
|
40
|
+
* **vi_mode:** move vi_mode to external section ([9ce611b](https://github.com/spaceship-prompt/spaceship-prompt/commit/9ce611b10ba3766f149abe8a1c1d27f488845b6e)), closes [#586](https://github.com/spaceship-prompt/spaceship-prompt/issues/586)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Features
|
|
44
|
+
|
|
45
|
+
* add ability to forcefully render a section synchronously ([216f0f2](https://github.com/spaceship-prompt/spaceship-prompt/commit/216f0f2c710191b1f3436c744c52b7de21129b4b))
|
|
46
|
+
* add IBM Cloud CLI section ([#912](https://github.com/spaceship-prompt/spaceship-prompt/issues/912)) ([30b4b60](https://github.com/spaceship-prompt/spaceship-prompt/commit/30b4b60176e727cbf7b1fc7d1bccadcd61139c0b))
|
|
47
|
+
* Add is_async util ([d539ee5](https://github.com/spaceship-prompt/spaceship-prompt/commit/d539ee5d61714addb80ba2d531a36d1029cc3d18))
|
|
48
|
+
* Add java section ([713f406](https://github.com/spaceship-prompt/spaceship-prompt/commit/713f406a3f1bdbeda50bf6924dbf957230361595))
|
|
49
|
+
* **async:** add an option to globaly disable/enable async rendering ([0ca1463](https://github.com/spaceship-prompt/spaceship-prompt/commit/0ca1463b1891edfcad0d25897a0c733dfdd19d73))
|
|
50
|
+
* **async:** introduce async jobs indicator ([f0a75ce](https://github.com/spaceship-prompt/spaceship-prompt/commit/f0a75cece5361963b4c9a39fbd9151093ec3502d))
|
|
51
|
+
* **cli:** add a print command for CLI ([6843105](https://github.com/spaceship-prompt/spaceship-prompt/commit/6843105f2a061629cc912d255f6e9ace98cc485b))
|
|
52
|
+
* **cli:** add CLI ([205cb16](https://github.com/spaceship-prompt/spaceship-prompt/commit/205cb16eef6783d6e37af47d2492861d5c5aba7a))
|
|
53
|
+
* **cli:** add command completions for cli ([2ae45a4](https://github.com/spaceship-prompt/spaceship-prompt/commit/2ae45a4ec0c4231b69c2090d3a7ed2211051945a))
|
|
54
|
+
* **cli:** Add edit command ([b029587](https://github.com/spaceship-prompt/spaceship-prompt/commit/b029587ed9473ba9b8efc19ddaf8135636ae2d08))
|
|
55
|
+
* **cli:** CLI for inserting and removing sections ([5dcce40](https://github.com/spaceship-prompt/spaceship-prompt/commit/5dcce40e99e0595453133862b95720882ab07fe7)), closes [#318](https://github.com/spaceship-prompt/spaceship-prompt/issues/318)
|
|
56
|
+
* **config:** Add ability to store config in ~/.config/spaceship ([b5dee37](https://github.com/spaceship-prompt/spaceship-prompt/commit/b5dee377c85b54e4f70071de42bc1cff52816f82))
|
|
57
|
+
* **config:** introduce config file resolution ([e087459](https://github.com/spaceship-prompt/spaceship-prompt/commit/e087459d316aa445506cf41b3d58be4b0b4b854a)), closes [#508](https://github.com/spaceship-prompt/spaceship-prompt/issues/508)
|
|
58
|
+
* **docker:** add docker image and publishing it to ghcr.io ([77d7457](https://github.com/spaceship-prompt/spaceship-prompt/commit/77d74570b7a68c934bb4e5c5ac1a7b36e9fd96cb))
|
|
59
|
+
* **exec_time:** display exec time with precision ([7b04aed](https://github.com/spaceship-prompt/spaceship-prompt/commit/7b04aed499175e22ec37b9af55fb3375d5fd48b1))
|
|
60
|
+
* **git:** add ability to customize git and hg orders ([8a54cb3](https://github.com/spaceship-prompt/spaceship-prompt/commit/8a54cb39036b173be143b134f1ce00760813fe2d)), closes [#391](https://github.com/spaceship-prompt/spaceship-prompt/issues/391)
|
|
61
|
+
* **haskell:** Look for .hs files ([b2eb8a3](https://github.com/spaceship-prompt/spaceship-prompt/commit/b2eb8a35f3c41b73a7d48787a3f4f413c390407f))
|
|
62
|
+
* **ibmcloud:** Enable async rendering for ibmcloud ([8391054](https://github.com/spaceship-prompt/spaceship-prompt/commit/8391054c79bacd68c87032ae9011f9c8deb424c6))
|
|
63
|
+
* **package:** Add composer and julia support ([3f8bb1e](https://github.com/spaceship-prompt/spaceship-prompt/commit/3f8bb1e5a41ad33f55f5c078ed893a4ef7cee214))
|
|
64
|
+
* **perf:** Compile to zwc ([3549bbf](https://github.com/spaceship-prompt/spaceship-prompt/commit/3549bbf9050670b70f79b61c6c90755022448b7e))
|
|
65
|
+
* **registry:** Add custom sections registry ([86d64dd](https://github.com/spaceship-prompt/spaceship-prompt/commit/86d64ddbba4c42092a6fcb98dc06822726531a49))
|
|
66
|
+
* **renderer:** render sync section on every render ([4e93ae0](https://github.com/spaceship-prompt/spaceship-prompt/commit/4e93ae0ccbb7cd692995b5e78942e783bb25aa71))
|
|
67
|
+
* **section:** migrate default section to v4 ([0684171](https://github.com/spaceship-prompt/spaceship-prompt/commit/0684171c41783c278cfaa84fbc844a18a1b4a7ed))
|
|
68
|
+
* **section:** Migrate sections to new signature ([b3249fb](https://github.com/spaceship-prompt/spaceship-prompt/commit/b3249fb756a31dec21f1c11beca1a37bf961332d))
|
|
69
|
+
* **section:** Named arguments for section ([201496b](https://github.com/spaceship-prompt/spaceship-prompt/commit/201496b4311852e070b315b473dcfbe1d9a792cc))
|
|
70
|
+
* **testkit:** add a simple testkit ([1ceca85](https://github.com/spaceship-prompt/spaceship-prompt/commit/1ceca858ddfe8888418e7096e3f863df5d611d6e))
|
|
71
|
+
* Upsearch for project files up the tree ([08f6d70](https://github.com/spaceship-prompt/spaceship-prompt/commit/08f6d70e972fc56fa47dccb42f1e44b0bdce352b))
|
|
72
|
+
* **vsc:** Make git and hg async ([9ddb9be](https://github.com/spaceship-prompt/spaceship-prompt/commit/9ddb9be29df8058e06b43a4a7504b4faa87cd677))
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### Performance Improvements
|
|
76
|
+
|
|
77
|
+
* **zwc:** Precompile root file and async ([ee5afc5](https://github.com/spaceship-prompt/spaceship-prompt/commit/ee5afc5caf87b22bf3467679f8a6849c04956b03))
|
|
78
|
+
* **zwc:** spaceship::precompile compiles sources to zwc ([58758e7](https://github.com/spaceship-prompt/spaceship-prompt/commit/58758e785d948ba3d5a1718dc5cc11321339ab81))
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### BREAKING CHANGES
|
|
82
|
+
|
|
83
|
+
* **section:** spaceship::section:v4 uses flags instead of arguments order to pass section params.
|
|
84
|
+
* **vi_mode:** vi_mode section is not include in core anymore
|
|
85
|
+
* **gradle:** Gradle section is not included by default. It can be installed additionally from:
|
|
86
|
+
https://github.com/spaceship-prompt/spaceship-gradle
|
|
87
|
+
* **maven:** Maven section is no longer available by default. It can be additionally installed
|
|
88
|
+
from: https://github.com/spaceship-prompt/spaceship-maven
|
|
89
|
+
* **install:** Now users have to manually enable prompt system and choose spaceship
|
|
90
|
+
* **ember:** ember section is no longer available out of the box. It needs to be installed
|
|
91
|
+
additionally.
|
|
92
|
+
|
|
93
|
+
## [3.16.7](https://github.com/spaceship-prompt/spaceship-prompt/compare/v3.16.6...v3.16.7) (2022-05-10)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
### Bug Fixes
|
|
97
|
+
|
|
98
|
+
* revert problem with publishing to brew ([d76cc7b](https://github.com/spaceship-prompt/spaceship-prompt/commit/d76cc7ba804471c78dfc1d471f688019a65934a6))
|
|
99
|
+
|
|
100
|
+
## [3.16.6](https://github.com/spaceship-prompt/spaceship-prompt/compare/v3.16.5...v3.16.6) (2022-05-09)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
### Bug Fixes
|
|
104
|
+
|
|
105
|
+
* **brew:** Attempt to bump homebrew formula with main release ([5f476b1](https://github.com/spaceship-prompt/spaceship-prompt/commit/5f476b1d2942c778a9ca4d7609f4db2526c9430d))
|
|
106
|
+
|
|
1
107
|
## [3.16.5](https://github.com/spaceship-prompt/spaceship-prompt/compare/v3.16.4...v3.16.5) (2022-03-28)
|
|
2
108
|
|
|
3
109
|
|
package/README.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
[](https://stand-with-ukraine.pp.ua/)
|
|
2
|
+
|
|
1
3
|
<h1 align="center">
|
|
2
4
|
<a href="https://github.com/spaceship-prompt/spaceship-prompt">
|
|
3
5
|
<img alt="spaceship →~ prompt" src="https://cloud.githubusercontent.com/assets/3459374/21679181/46e24706-d34b-11e6-82ee-5efb3d2ba70f.png" width="400">
|
|
4
6
|
</a>
|
|
5
|
-
<br
|
|
7
|
+
<br>Spaceship Prompt 🚀⭐<br>
|
|
6
8
|
</h1>
|
|
7
9
|
|
|
8
10
|
<h4 align="center">
|
|
9
|
-
<a href="http://zsh.org" target="_blank"><code>Zsh</code></a> prompt
|
|
11
|
+
Minimalistic, powerful and extremely customizable <a href="http://zsh.org" target="_blank"><code>Zsh</code></a> prompt
|
|
10
12
|
</h4>
|
|
11
13
|
|
|
12
14
|
<p align="center">
|
|
@@ -46,10 +48,9 @@
|
|
|
46
48
|
<div align="center">
|
|
47
49
|
<h4>
|
|
48
50
|
<a href="https://spaceship-prompt.sh">Website</a> |
|
|
49
|
-
<a href="https://spaceship-prompt.sh/getting-started">
|
|
50
|
-
<a href="
|
|
51
|
-
<a href="https://spaceship-prompt.sh/
|
|
52
|
-
<a href="https://spaceship-prompt.sh/api">API</a>
|
|
51
|
+
<a href="https://spaceship-prompt.sh/getting-started">Installation</a> |
|
|
52
|
+
<a href="https://spaceship-prompt.sh/config/intro">Configuration</a> |
|
|
53
|
+
<a href="https://spaceship-prompt.sh/advanced/creating-section">Advanced Usage</a>
|
|
53
54
|
</h4>
|
|
54
55
|
</div>
|
|
55
56
|
|
|
@@ -60,116 +61,67 @@
|
|
|
60
61
|
</div>
|
|
61
62
|
<br>
|
|
62
63
|
|
|
63
|
-
[
|
|
64
|
-
|
|
65
|
-
Spaceship is a minimalistic, powerful and extremely customizable [Zsh][zsh-url] prompt. It combines everything you may need for convenient work, without unnecessary complications, like a real spaceship.
|
|
64
|
+
Spaceship is a minimalistic, powerful and extremely customizable [Zsh][zsh-url] prompt. Prompt is what you see when you type a command. It can show a lot of useful tips, saving your time and making user experience smooth and pleasant. It combines everything you may need for convenient work, without unnecessary complications, like a real spaceship.
|
|
66
65
|
|
|
67
66
|
<p align="center">
|
|
68
|
-
<
|
|
67
|
+
<a href="https://asciinema.org/a/513451">
|
|
68
|
+
<img alt="Spaceship with One Dark, zsh-autosuggestions and zsh-syntax-highlight" src="https://user-images.githubusercontent.com/3459374/183478313-5aa02cbe-fafc-42e0-a791-ea08a0902f56.gif" width="80%">
|
|
69
|
+
</a>
|
|
70
|
+
<br>
|
|
71
|
+
<sup>Visit <a href="https://deploy-preview-963--spaceship-prompt.netlify.app/faq/#why-doesnt-my-prompt-look-like-the-preview">Frequently Asked Question</a> for similar setup and find more examples with different color schemes in <a href="https://github.com/spaceship-prompt/spaceship-prompt/wiki/Screenshots">Screenshots </a>wiki-page.
|
|
72
|
+
</sup>
|
|
69
73
|
</p>
|
|
70
74
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
## Features
|
|
74
|
-
|
|
75
|
-
- Clever hostname and username displaying.
|
|
76
|
-
- Prompt character turns red if the last command exits with non-zero code.
|
|
77
|
-
- Current Git branch and rich repo status:
|
|
78
|
-
- `?` — untracked changes;
|
|
79
|
-
- `+` — uncommitted changes in the index;
|
|
80
|
-
- `!` — unstaged changes;
|
|
81
|
-
- `»` — renamed files;
|
|
82
|
-
- `✘` — deleted files;
|
|
83
|
-
- `$` — stashed changes;
|
|
84
|
-
- `=` — unmerged changes;
|
|
85
|
-
- `⇡` — ahead of remote branch;
|
|
86
|
-
- `⇣` — behind of remote branch;
|
|
87
|
-
- `⇕` — diverged changes.
|
|
88
|
-
- Current Mercurial bookmark/branch and rich repo status:
|
|
89
|
-
- `?` — untracked changes;
|
|
90
|
-
- `+` — uncommitted changes in the index;
|
|
91
|
-
- `!` — unstaged changes;
|
|
92
|
-
- `✘` — deleted files;
|
|
93
|
-
- Indicator for jobs in the background (`✦`).
|
|
94
|
-
- Current Node.js version, through fnm/nvm/nodenv/n (`⬢`).
|
|
95
|
-
- Current Ruby version, through rvm/rbenv/chruby/asdf (`💎`).
|
|
96
|
-
- Current Elm version (`🌳`)
|
|
97
|
-
- Current Elixir version, through kiex/exenv/elixir (`💧`).
|
|
98
|
-
- Current Swift version, through swiftenv (`🐦`).
|
|
99
|
-
- Current Xcode version, through xenv (`🛠`).
|
|
100
|
-
- Current Go version (`🐹`).
|
|
101
|
-
- Current PHP version (`🐘`).
|
|
102
|
-
- Current Rust version (`🦀`).
|
|
103
|
-
- Current version of Haskell GHC Compiler, defined in stack.yaml file (`λ`).
|
|
104
|
-
- Current Julia version (`ஃ`).
|
|
105
|
-
- Current Docker version and connected machine (`🐳`).
|
|
106
|
-
- Current Amazon Web Services (AWS) profile (`☁️`) ([Using named profiles](http://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html)).
|
|
107
|
-
- Current Google Cloud Platform gcloud active configuration (`☁️`).
|
|
108
|
-
- Current Python virtualenv.
|
|
109
|
-
- Current Conda virtualenv (`🅒`).
|
|
110
|
-
- Current Python pyenv (`🐍`).
|
|
111
|
-
- Current .NET SDK version, through dotnet-cli (`.NET`).
|
|
112
|
-
- Current Ember.js version, through ember-cli (`🐹`).
|
|
113
|
-
- Current Kubectl context (`☸️`).
|
|
114
|
-
- Current Terraform workspace (`🛠`).
|
|
115
|
-
- Current IBM Cloud account (`👔`).
|
|
116
|
-
- Package version, if there's is a package in current directory (`📦`).
|
|
117
|
-
- Current battery level and status:
|
|
118
|
-
- `⇡` - charging;
|
|
119
|
-
- `⇣` - discharging;
|
|
120
|
-
- `•` - fully charged.
|
|
121
|
-
- Current Vi-mode mode ([with handy aliases for temporarily enabling](./docs/options.md#vi-mode-vi_mode)).
|
|
122
|
-
- Optional exit-code of last command ([how to enable](./docs/options.md#exit-code-exit_code)).
|
|
123
|
-
- Optional time stamps 12/24hr in format ([how to enable](./docs/options.md#time-time)).
|
|
124
|
-
- Execution time of the last command if it exceeds the set threshold.
|
|
125
|
-
- Optional AWS now supports aws-vault ([aws-vault](https://github.com/99designs/aws-vault))
|
|
126
|
-
|
|
127
|
-
Want more features? Please, [open an issue](https://github.com/spaceship-prompt/spaceship-prompt/issues/new/choose) or send pull request.
|
|
75
|
+
## ✨ Features
|
|
128
76
|
|
|
129
|
-
|
|
77
|
+
Here are some sneak picks of what **Spaceship** can show:
|
|
130
78
|
|
|
131
|
-
|
|
79
|
+
- Clever hostname and username displaying
|
|
80
|
+
- Repository statuses (Git and Mercurial are supported)
|
|
81
|
+
- Runtime environments for various languages (Node.js, Rust, Python, Ruby, Swift, Go, PHP and many others)
|
|
82
|
+
- Docker version, Kubernetes context and connected machine
|
|
83
|
+
- Package version (npm, lerna, cargo, composer and others)
|
|
84
|
+
- Battery level and status
|
|
85
|
+
- Indicator for jobs in the background `✦`
|
|
86
|
+
- A lot of [useful information](https://spaceship-prompt.sh/sections)
|
|
87
|
+
- Custom [information of your choice](https://spaceship-prompt.sh/advanced/creating-section)
|
|
132
88
|
|
|
133
|
-
|
|
89
|
+
Want more features? Please, [open an issue](https://github.com/spaceship-prompt/spaceship-prompt/issues/new/choose) or send pull request.
|
|
134
90
|
|
|
135
|
-
|
|
136
|
-
- [Powerline Font](https://github.com/powerline/fonts) must be installed and used in your terminal (for example, switch font to [Fira Code](https://github.com/tonsky/FiraCode)).
|
|
91
|
+
## 🤝 Requirements
|
|
137
92
|
|
|
138
|
-
|
|
93
|
+
Before we begin, let's make sure you have the following installed:
|
|
139
94
|
|
|
140
|
-
|
|
95
|
+
- [Zsh](http://www.zsh.org/) (v5.2 or recent) must be installed. Run the following command to check you version of Zsh:
|
|
96
|
+
```zsh
|
|
97
|
+
echo $ZSH_VERSION #> 5.8.1
|
|
98
|
+
```
|
|
99
|
+
- [Powerline Font](https://github.com/powerline/fonts) or [Nerd Font](https://www.nerdfonts.com/) (even better) must be installed and used in your terminal. [Fira Code](https://github.com/tonsky/FiraCode) is a popular choice. To check if Powerline Font works for you, run:
|
|
100
|
+
```zsh
|
|
101
|
+
echo -e "\xee\x82\xa0" #>
|
|
102
|
+
```
|
|
141
103
|
|
|
142
|
-
|
|
104
|
+
## 🚀 Installation
|
|
143
105
|
|
|
144
|
-
|
|
145
|
-
<img alt="Become a patron" src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="150px">
|
|
146
|
-
</a>
|
|
106
|
+
Here's a few popular methods to install Spaceship. Select the one you use from the list below:
|
|
147
107
|
|
|
148
|
-
|
|
108
|
+
<details>
|
|
109
|
+
<summary>Homebrew</summary>
|
|
110
|
+
Installing Spaceship via Homebrew is a simple command:
|
|
149
111
|
|
|
150
|
-
```
|
|
112
|
+
```zsh title="Terminal"
|
|
151
113
|
brew install spaceship
|
|
152
114
|
```
|
|
153
115
|
|
|
154
|
-
|
|
116
|
+
Add prompt initialization to your `.zshrc`:
|
|
155
117
|
|
|
156
|
-
```
|
|
157
|
-
brew
|
|
118
|
+
```zsh title="Terminal"
|
|
119
|
+
echo "source $(brew --prefix)/opt/spaceship/spaceship.zsh" >>! ~/.zshrc
|
|
158
120
|
```
|
|
121
|
+
</details>
|
|
159
122
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
```
|
|
163
|
-
npm install -g spaceship-prompt
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
Done. This command should link `spaceship.zsh` as `prompt_spaceship_setup` to your `$fpath` and set `prompt spaceship` in `.zshrc`. Just reload your terminal.
|
|
167
|
-
Ensure that you have enabled post-scripts in npm by `npm config set ignore-scripts false` before starting installation.
|
|
168
|
-
|
|
169
|
-
**💡 Tip:** Update Spaceship to new versions as you would any other package.
|
|
170
|
-
|
|
171
|
-
### [oh-my-zsh]
|
|
172
|
-
|
|
123
|
+
<details>
|
|
124
|
+
<summary>Oh-My-Zsh</summary>
|
|
173
125
|
Clone this repo:
|
|
174
126
|
|
|
175
127
|
```zsh
|
|
@@ -183,61 +135,108 @@ ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/the
|
|
|
183
135
|
```
|
|
184
136
|
|
|
185
137
|
Set `ZSH_THEME="spaceship"` in your `.zshrc`.
|
|
138
|
+
</details>
|
|
139
|
+
|
|
140
|
+
<details>
|
|
141
|
+
<summary>npm</summary>
|
|
142
|
+
Install Spaceship via npm as you would with any other global package:
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
npm install -g spaceship-prompt
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
This command will download Spaceship. It will also ask you to source Spaceship in your `~/.zshrc` file.
|
|
186
149
|
|
|
187
|
-
|
|
150
|
+
</details>
|
|
151
|
+
|
|
152
|
+
<details>
|
|
153
|
+
<summary>prezto</summary>
|
|
188
154
|
|
|
189
155
|
- Follow [prezto-contrib#usage](https://github.com/belak/prezto-contrib#usage) to clone `prezto-contrib` to the proper location.
|
|
190
156
|
- Enable the `contrib-prompt` module (before the `prompt` module).
|
|
191
157
|
- Set `zstyle ':prezto:module:prompt' theme 'spaceship'` in your `.zpreztorc`.
|
|
192
158
|
|
|
193
|
-
|
|
159
|
+
</details>
|
|
194
160
|
|
|
195
|
-
|
|
161
|
+
<details>
|
|
162
|
+
<summary>zim</summary>
|
|
163
|
+
Add Spaceship to your `.zimrc`:
|
|
196
164
|
|
|
197
|
-
|
|
165
|
+
```zsh
|
|
166
|
+
zmodule spaceship-prompt/spaceship-prompt --name spaceship
|
|
167
|
+
```
|
|
198
168
|
|
|
199
|
-
|
|
169
|
+
Then install Spaceship:
|
|
200
170
|
|
|
171
|
+
```zsh
|
|
172
|
+
zim install
|
|
201
173
|
```
|
|
174
|
+
</details>
|
|
175
|
+
|
|
176
|
+
<details>
|
|
177
|
+
<summary>antigen</summary>
|
|
178
|
+
Add the following snippet in your `.zshrc`:
|
|
179
|
+
|
|
180
|
+
```zsh
|
|
202
181
|
antigen theme spaceship-prompt/spaceship-prompt
|
|
203
182
|
```
|
|
183
|
+
</details>
|
|
204
184
|
|
|
205
|
-
|
|
206
|
-
|
|
185
|
+
<details>
|
|
186
|
+
<summary>antibody</summary>
|
|
207
187
|
Update your `.zshrc` file with the following line:
|
|
208
188
|
|
|
209
|
-
```
|
|
189
|
+
```zsh
|
|
210
190
|
antibody bundle spaceship-prompt/spaceship-prompt
|
|
211
191
|
```
|
|
192
|
+
</details>
|
|
212
193
|
|
|
213
|
-
|
|
214
|
-
|
|
194
|
+
<details>
|
|
195
|
+
<summary>zinit</summary>
|
|
215
196
|
Add the following line to your `.zshrc` where you're adding your other Zsh plugins:
|
|
216
197
|
|
|
217
|
-
```
|
|
198
|
+
```zsh
|
|
218
199
|
zinit light spaceship-prompt/spaceship-prompt
|
|
219
200
|
```
|
|
201
|
+
</details>
|
|
220
202
|
|
|
221
|
-
|
|
222
|
-
|
|
203
|
+
<details>
|
|
204
|
+
<summary>zgen</summary>
|
|
223
205
|
Add the following line to your `.zshrc` where you're adding your other Zsh plugins:
|
|
224
206
|
|
|
225
|
-
```
|
|
207
|
+
```zsh
|
|
226
208
|
zgen load spaceship-prompt/spaceship-prompt spaceship
|
|
227
209
|
```
|
|
210
|
+
</details>
|
|
228
211
|
|
|
229
|
-
|
|
230
|
-
|
|
212
|
+
<details>
|
|
213
|
+
<summary>zplug</summary>
|
|
231
214
|
Use this command in your `.zshrc` to load Spaceship as prompt theme:
|
|
232
215
|
|
|
233
|
-
```
|
|
216
|
+
```zsh
|
|
234
217
|
zplug "spaceship-prompt/spaceship-prompt", use:spaceship.zsh, from:github, as:theme
|
|
235
218
|
```
|
|
219
|
+
</details>
|
|
236
220
|
|
|
237
|
-
|
|
221
|
+
<details>
|
|
222
|
+
<summary>sheldon</summary>
|
|
223
|
+
Add the following to your `plugins.toml` file (open it with `sheldon edit`):
|
|
238
224
|
|
|
239
|
-
|
|
225
|
+
```toml
|
|
226
|
+
[plugins.spaceship]
|
|
227
|
+
github = "spaceship-prompt/spaceship-prompt"
|
|
228
|
+
```
|
|
229
|
+
</details>
|
|
230
|
+
|
|
231
|
+
Or run the following to automatically add it:
|
|
232
|
+
|
|
233
|
+
```zsh
|
|
234
|
+
sheldon add spaceship --github spaceship-prompt/spaceship-prompt
|
|
235
|
+
```
|
|
236
|
+
</details>
|
|
240
237
|
|
|
238
|
+
<details>
|
|
239
|
+
<summary>Arch</summary>
|
|
241
240
|
Install the latest master from the AUR package [`spaceship-prompt-git`](https://aur.archlinux.org/packages/spaceship-prompt-git/):
|
|
242
241
|
|
|
243
242
|
```
|
|
@@ -245,138 +244,84 @@ git clone https://aur.archlinux.org/spaceship-prompt-git.git --depth=1
|
|
|
245
244
|
cd spaceship-prompt-git
|
|
246
245
|
makepkg -si
|
|
247
246
|
```
|
|
247
|
+
</details>
|
|
248
248
|
|
|
249
|
-
|
|
249
|
+
<details>
|
|
250
|
+
<summary>Manual</summary>
|
|
250
251
|
|
|
251
|
-
If
|
|
252
|
+
If none of the above methods works for you, you can install Spaceship manually.
|
|
252
253
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
#### Example
|
|
258
|
-
|
|
259
|
-
Run `echo $fpath` to see possible location and link `spaceship.zsh` there, like:
|
|
260
|
-
|
|
261
|
-
```zsh
|
|
262
|
-
$ ln -sf "$PWD/spaceship.zsh" "/usr/local/share/zsh/site-functions/prompt_spaceship_setup"
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
For a user-specific installation, simply add a directory to `$fpath` for that user in `.zshrc`:
|
|
266
|
-
|
|
267
|
-
```zsh
|
|
268
|
-
fpath=( "${ZDOTDIR:-$HOME}/.zfunctions" $fpath )
|
|
269
|
-
```
|
|
254
|
+
1. Clone this repo somewhere, for example to `$HOME/.zsh/spaceship`.
|
|
255
|
+
2. Add the path of the cloned repo to `$fpath` in `$HOME/.zshrc`.
|
|
256
|
+
3. Activate Spaceship prompt by `promptinit`.
|
|
270
257
|
|
|
271
|
-
|
|
258
|
+
### Example
|
|
272
259
|
|
|
273
260
|
```zsh
|
|
274
|
-
|
|
261
|
+
mkdir -p "$HOME/.zsh"
|
|
262
|
+
git clone --depth=1 https://github.com/spaceship-prompt/spaceship-prompt.git "$HOME/.zsh/spaceship"
|
|
275
263
|
```
|
|
276
264
|
|
|
277
265
|
For initializing prompt system add this to your `.zshrc`:
|
|
278
266
|
|
|
279
|
-
```zsh
|
|
280
|
-
|
|
281
|
-
autoload -U promptinit; promptinit
|
|
282
|
-
prompt spaceship
|
|
267
|
+
```zsh title=".zshrc"
|
|
268
|
+
source "~/.zsh/spaceship/spaceship.zsh"
|
|
283
269
|
```
|
|
270
|
+
</details>
|
|
284
271
|
|
|
285
|
-
##
|
|
272
|
+
## ⚙️ Configuration
|
|
286
273
|
|
|
287
274
|
Spaceship works well out of the box, but you can customize almost everything if you want.
|
|
288
275
|
|
|
289
|
-
- [**
|
|
290
|
-
- [**
|
|
276
|
+
- [**⚙️ Configuration**](https://spaceship-prompt.sh/config/intro) — Tweak section's behavior with tons of options.
|
|
277
|
+
- [**😎 Advanced Usage**](https://spaceship-prompt.sh/advanced/creating-section) — Learn how to create a custom section, benefit of per-directory configuration and more.
|
|
291
278
|
|
|
292
|
-
|
|
279
|
+
Additionally, join our community in [Discord](https://discord.gg/NTQWz8Dyt9) and follow our [Twitter](https//twitter.com/SpaceshipPrompt) for updates.
|
|
293
280
|
|
|
294
|
-
|
|
281
|
+
## 🫶 Contributing
|
|
295
282
|
|
|
296
|
-
|
|
297
|
-
# .zshrc
|
|
283
|
+
We're glad to accept contributions from developers of **all skill levels**! If you are interested in contributing to Spaceship, please take a look at our [Contribution Guide](./CONTRIBUTING.md) for more details. If you're looking for an easy way into the project, take one of the issues with [**good first issue**](https://github.com/spaceship-prompt/spaceship-prompt/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label.
|
|
298
284
|
|
|
299
|
-
|
|
285
|
+
If you are fluent in any other language besides English, we greatly appreciate any help with translating our documentation in other languages. If you would like to help, join the [team of translators on our Crowdin](https://translate.spaceship-prompt.sh).
|
|
300
286
|
|
|
301
|
-
|
|
302
|
-
# ...
|
|
303
|
-
}
|
|
287
|
+
If you're interested in helping other people, answer questions asked by other users of Spaceship and help to solve their issues. Additionally, join our [**Discord**](https://discord.gg/NTQWz8Dyt9) to discuss Spaceship and help people who need help.
|
|
304
288
|
|
|
305
|
-
|
|
306
|
-
```
|
|
289
|
+
## 💌 Sponsoring
|
|
307
290
|
|
|
308
|
-
|
|
291
|
+
If you really enjoy this project, you can contribute financially. Any contribution is highly appreciated, even the smallest one. There are several ways to donate:
|
|
309
292
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
293
|
+
* **Recurring donations**:
|
|
294
|
+
* [GitHub Sponsors](https://github.com/sponsors/denysdovhan?frequency=recurring)
|
|
295
|
+
* [Open Collective](https://opencollective.com/spaceship-prompt)
|
|
296
|
+
* [Patreon](https://patreon.com/denysdovhan)
|
|
297
|
+
* **One-time donations**:
|
|
298
|
+
* [GitHub Sponsors](https://github.com/sponsors/denysdovhan?frequency=one-time)
|
|
299
|
+
* [Buy Me A Coffee](https://buymeacoffee.com/denysdovhan)
|
|
300
|
+
* [Monobank Jar](https://send.monobank.ua/jar/2N46sWTaZZ)
|
|
301
|
+
* **Crypto donations**:
|
|
302
|
+
* Ethereum: `0x5C9496De5E51D48daf28354DC04d8f9D33955559`
|
|
303
|
+
* Bitcoin: `bc1q5ezjvpgftmx42f9qgdf5lscjz43uh4jf02uvje`
|
|
313
304
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
```shell
|
|
317
|
-
SPACESHIP_PROMPT_ORDER=(mysection $SPACESHIP_PROMPT_ORDER)
|
|
318
|
-
```
|
|
305
|
+
## 🤔 Having trouble?
|
|
319
306
|
|
|
320
|
-
|
|
307
|
+
Find answers on our troubleshooting page or get help by our community.
|
|
321
308
|
|
|
322
|
-
|
|
309
|
+
[**Issues**](https://github.com/spaceship-prompt/spaceship-prompt/issues) • [**Discussions**](https://github.com/spaceship-prompt/spaceship-prompt/discussions/) • [**Discord**](https://discord.gg/NTQWz8Dyt9)
|
|
323
310
|
|
|
324
|
-
|
|
311
|
+
Still struggling? Please, [*file an issue*](https://github.com/spaceship-prompt/spaceship-prompt/issues/new/choose), describe your problem, and we will gladly help you.
|
|
325
312
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
## Related Projects
|
|
313
|
+
## 👀 Derived Projects
|
|
329
314
|
|
|
330
315
|
Here's a list of related projects that have been inspired by Spaceship ZSH.
|
|
331
316
|
|
|
317
|
+
- [**denysdovhan/dotfiles**](https://github.com/denysdovhan/dotfiles) - Dotfiles of Spaceship's author from which Spaceship is originated.
|
|
332
318
|
- [**matchai/spacefish**](https://github.com/matchai/spacefish) - A port of Spaceship ZSH for fish shell intending to achieve complete feature parity.
|
|
333
319
|
- [**starship/starship**](https://github.com/starship/starship) - A blazing-fast, cross-shell prompt written in Rust, heavily inspired by Spaceship ZSH.
|
|
334
320
|
|
|
335
|
-
##
|
|
336
|
-
|
|
337
|
-
| [](http://denysdovhan.com) | [](https://github.com/salmanulfarzy) | [](https://github.com/maximbaz) | [](https://github.com/Runrioter) |
|
|
338
|
-
| :------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------: |
|
|
339
|
-
| [Denys Dovhan](https://github.com/denysdovhan) | [Salmanul Farzy](https://github.com/salmanulfarzy) | [Maxim Baz](https://github.com/maximbaz) | [Runrioter Wung](https://github.com/Runrioter) |
|
|
340
|
-
|
|
341
|
-
## Donate
|
|
342
|
-
|
|
343
|
-
Hi! I work on this project in my spare time, in addition to my primary job. I hope you enjoy using Spaceship ZSH. If you do, please, [become my patron 🤝][patreon-url].
|
|
344
|
-
|
|
345
|
-
| Patreon | Bitcoin | Ethereum |
|
|
346
|
-
| :--------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------: |
|
|
347
|
-
| [Become a patron][patreon-url] | `1FrPrQb6ACTkbSBAz9PduJWrDFfq41Ggb4` | `0x6aF39C917359897ae6969Ad682C14110afe1a0a1` |
|
|
348
|
-
| <a href="https://www.patreon.com/denysdovhan"><img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="150px"></a> | <img src="https://user-images.githubusercontent.com/3459374/33760933-1c9b81b4-dc10-11e7-8e4b-22d81f98c138.png" width="100px"/> | <img src="https://user-images.githubusercontent.com/3459374/33760932-1c7b3fb2-dc10-11e7-9774-411264d533da.png" width="100px"/> |
|
|
349
|
-
|
|
350
|
-
This is your way make a clear statement: **My work is valued.**
|
|
351
|
-
|
|
352
|
-
I would appreciate your support! _Thank you!_
|
|
353
|
-
|
|
354
|
-
## License
|
|
321
|
+
## 📄 License
|
|
355
322
|
|
|
356
323
|
MIT © [Denys Dovhan](http://denysdovhan.com)
|
|
357
324
|
|
|
358
|
-
<!--
|
|
359
|
-
|
|
360
|
-
[npm-url]: https://npmjs.org/package/spaceship-prompt
|
|
361
|
-
[npm-image]: https://img.shields.io/npm/v/spaceship-prompt.svg?style=flat-square
|
|
325
|
+
<!-- References -->
|
|
362
326
|
[zsh-url]: http://zsh.org/
|
|
363
|
-
[zsh-image]: https://img.shields.io/badge/zsh-%3E%3Dv5.2-777777.svg?style=flat-square
|
|
364
327
|
[patreon-url]: https://www.patreon.com/denysdovhan
|
|
365
|
-
[patreon-image]: https://img.shields.io/badge/zsh-%3E%3Dv5.2-777777.svg?style=flat-square
|
|
366
|
-
|
|
367
|
-
<!-- References -->
|
|
368
|
-
|
|
369
|
-
[oh-my-zsh]: http://ohmyz.sh/
|
|
370
|
-
[prezto]: https://github.com/sorin-ionescu/prezto
|
|
371
|
-
[zim]: https://github.com/zimfw/zimfw
|
|
372
|
-
[antigen]: http://antigen.sharats.me/
|
|
373
|
-
[zgen]: https://github.com/tarjoilija/zgen
|
|
374
|
-
[npm]: https://www.npmjs.com/
|
|
375
|
-
[antibody]: https://github.com/getantibody/antibody
|
|
376
|
-
[zplug]: https://github.com/zplug/zplug
|
|
377
|
-
[homebrew]: https://brew.sh
|
|
378
|
-
[n]: https://github.com/tj/n
|
|
379
|
-
[xcenv]: http://xcenv.org/
|
|
380
|
-
[swiftenv]: https://github.com/kylef/swiftenv
|
|
381
|
-
[powerline]: https://github.com/powerline/fonts
|
|
382
|
-
[zinit]: https://github.com/zdharma/zinit
|
package/lib/cache.zsh
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# ------------------------------------------------------------------------------
|
|
2
|
+
# CACHE
|
|
3
|
+
# Spaceship storage for data
|
|
4
|
+
# ------------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
# Declare a cache variable
|
|
7
|
+
typeset -gAh SPACESHIP_CACHE
|
|
8
|
+
|
|
9
|
+
# Get cache value from a given key
|
|
10
|
+
# USAGE:
|
|
11
|
+
# spaceship::cache::get <key>
|
|
12
|
+
spaceship::cache::get() {
|
|
13
|
+
local key="$1"
|
|
14
|
+
echo -n "${SPACESHIP_CACHE[$key]}"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
# Set cache value for a given key
|
|
18
|
+
# USAGE:
|
|
19
|
+
# spaceship::cache::set <key> <value>
|
|
20
|
+
spaceship::cache::set() {
|
|
21
|
+
local key="$1" value="$2"
|
|
22
|
+
SPACESHIP_CACHE[$key]="$value"
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
# Clear cache
|
|
26
|
+
# USAGE:
|
|
27
|
+
# spaceship::cache::clear
|
|
28
|
+
spaceship::cache::clear() {
|
|
29
|
+
SPACESHIP_CACHE=( )
|
|
30
|
+
}
|