spaceship-prompt 3.16.7 → 4.2.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.
Files changed (67) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/README.md +155 -212
  3. package/lib/cache.zsh +30 -0
  4. package/lib/cli.zsh +336 -0
  5. package/lib/config.zsh +32 -0
  6. package/lib/core.zsh +154 -0
  7. package/lib/hooks.zsh +60 -11
  8. package/lib/prompts.zsh +65 -0
  9. package/lib/section.zsh +93 -43
  10. package/lib/testkit.zsh +19 -0
  11. package/lib/utils.zsh +168 -14
  12. package/package.json +17 -8
  13. package/scripts/install +12 -0
  14. package/scripts/{tests.sh → tests} +0 -0
  15. package/scripts/uninstall +10 -0
  16. package/sections/async.zsh +45 -0
  17. package/sections/aws.zsh +6 -4
  18. package/sections/battery.zsh +7 -5
  19. package/sections/bun.zsh +41 -0
  20. package/sections/char.zsh +7 -7
  21. package/sections/conda.zsh +6 -5
  22. package/sections/dir.zsh +8 -6
  23. package/sections/docker.zsh +11 -7
  24. package/sections/docker_context.zsh +2 -1
  25. package/sections/dotnet.zsh +9 -6
  26. package/sections/elixir.zsh +9 -5
  27. package/sections/elm.zsh +8 -5
  28. package/sections/exec_time.zsh +6 -5
  29. package/sections/exit_code.zsh +5 -4
  30. package/sections/gcloud.zsh +14 -12
  31. package/sections/git.zsh +20 -5
  32. package/sections/git_branch.zsh +5 -2
  33. package/sections/git_status.zsh +10 -16
  34. package/sections/golang.zsh +8 -6
  35. package/sections/haskell.zsh +9 -6
  36. package/sections/hg.zsh +19 -5
  37. package/sections/hg_branch.zsh +3 -2
  38. package/sections/hg_status.zsh +3 -2
  39. package/sections/host.zsh +4 -4
  40. package/sections/ibmcloud.zsh +16 -14
  41. package/sections/java.zsh +35 -0
  42. package/sections/jobs.zsh +6 -5
  43. package/sections/julia.zsh +6 -4
  44. package/sections/kubectl.zsh +15 -6
  45. package/sections/kubectl_context.zsh +20 -19
  46. package/sections/kubectl_version.zsh +6 -5
  47. package/sections/line_sep.zsh +3 -1
  48. package/sections/node.zsh +11 -9
  49. package/sections/package.zsh +85 -38
  50. package/sections/php.zsh +8 -5
  51. package/sections/python.zsh +44 -0
  52. package/sections/ruby.zsh +9 -6
  53. package/sections/rust.zsh +10 -6
  54. package/sections/swift.zsh +7 -5
  55. package/sections/terraform.zsh +7 -5
  56. package/sections/time.zsh +7 -7
  57. package/sections/user.zsh +5 -5
  58. package/sections/venv.zsh +8 -6
  59. package/sections/xcode.zsh +7 -5
  60. package/spaceship.zsh +57 -88
  61. package/scripts/install.sh +0 -126
  62. package/scripts/uninstall.sh +0 -113
  63. package/sections/ember.zsh +0 -36
  64. package/sections/gradle.zsh +0 -93
  65. package/sections/maven.zsh +0 -97
  66. package/sections/pyenv.zsh +0 -37
  67. package/sections/vi_mode.zsh +0 -58
package/CHANGELOG.md CHANGED
@@ -1,3 +1,109 @@
1
+ # [4.2.0](https://github.com/spaceship-prompt/spaceship-prompt/compare/v4.1.0...v4.2.0) (2022-09-02)
2
+
3
+
4
+ ### Features
5
+
6
+ * Add ruby interpreter in datafile util ([005f9fa](https://github.com/spaceship-prompt/spaceship-prompt/commit/005f9fa6191dc94d29cb6db3bd860b6b05b59ef9))
7
+
8
+ # [4.1.0](https://github.com/spaceship-prompt/spaceship-prompt/compare/v4.0.0...v4.1.0) (2022-09-02)
9
+
10
+
11
+ ### Features
12
+
13
+ * **bun:** Add Bun section ([83ce0ee](https://github.com/spaceship-prompt/spaceship-prompt/commit/83ce0ee893757aee1c41b11c5433849a4c9de61d))
14
+
15
+ # [4.0.0](https://github.com/spaceship-prompt/spaceship-prompt/compare/v3.16.7...v4.0.0) (2022-09-01)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * add permissions to scripts ([7c3e427](https://github.com/spaceship-prompt/spaceship-prompt/commit/7c3e42727531ff612588722c509da643566f57fd))
21
+ * add x permissions to files ([9a34149](https://github.com/spaceship-prompt/spaceship-prompt/commit/9a341498bb6d31bf6d179121adbe781972fcde26))
22
+ * **async:** remove obsolete runtime variables ([2128ab0](https://github.com/spaceship-prompt/spaceship-prompt/commit/2128ab0046080d633c29a69f86322ca4ca9bed90))
23
+ * cherry pick [#1089](https://github.com/spaceship-prompt/spaceship-prompt/issues/1089) ([52448c1](https://github.com/spaceship-prompt/spaceship-prompt/commit/52448c121f7d3602e2e046ae674b70c5a8bbdafa))
24
+ * **cli:** Add missing commands in help message ([c2eb3e3](https://github.com/spaceship-prompt/spaceship-prompt/commit/c2eb3e35e8088c014cc0ed04aaab8133afaa3dd6))
25
+ * compdef only when compdef is available ([c309af6](https://github.com/spaceship-prompt/spaceship-prompt/commit/c309af62cbb8411583228a179ccb37d8329d2af6))
26
+ * **docker:** add additional utils inside docker image ([8813eb0](https://github.com/spaceship-prompt/spaceship-prompt/commit/8813eb0b691d1ccab1042c93edffc1c43764a0b5))
27
+ * 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)
28
+ * **git:** Add explicit variable for async rendering ([cfa95e6](https://github.com/spaceship-prompt/spaceship-prompt/commit/cfa95e6c80ee9d5d9dfa486daf892c1021278140))
29
+ * **git:** fix ahead/behind indicators ([a067c4d](https://github.com/spaceship-prompt/spaceship-prompt/commit/a067c4df0b663410f7e617e9a2240393f9219095))
30
+ * **git:** Fix typo in a section signature ([f8ed612](https://github.com/spaceship-prompt/spaceship-prompt/commit/f8ed612d8b5328d934a86c5664a745e9fbc0628d))
31
+ * **hg:** Add options for async rendering ([d5bdfa4](https://github.com/spaceship-prompt/spaceship-prompt/commit/d5bdfa42dc969fe9098792a305b34352d1ba4048))
32
+ * **kubectl:** fix kubectl section ([1b71e09](https://github.com/spaceship-prompt/spaceship-prompt/commit/1b71e096dd68be80672173686ea1974d8095ea45))
33
+ * make core variables readonly ([1cd4756](https://github.com/spaceship-prompt/spaceship-prompt/commit/1cd4756caf2080f8a13bd5aab15d927660f3d836))
34
+ * NEWLINE variable doesn't work ([28b37f5](https://github.com/spaceship-prompt/spaceship-prompt/commit/28b37f566ebc141c93395d003601e1447f6bf91f))
35
+ * **ps2:** print PS2 properly ([0d9766c](https://github.com/spaceship-prompt/spaceship-prompt/commit/0d9766c8b65707cb3e7eef19f78bb080cdda3e1b))
36
+ * put user config loading in a proper place ([5c68702](https://github.com/spaceship-prompt/spaceship-prompt/commit/5c68702d6e695b517ca89593777651d665c8719e))
37
+ * **python:** use python3 command ([0466bb8](https://github.com/spaceship-prompt/spaceship-prompt/commit/0466bb8a9c443e930d9ba11318b5fe6b0f8a6cca))
38
+ * **renderer:** fix missing options for globes ([107429c](https://github.com/spaceship-prompt/spaceship-prompt/commit/107429ce5ea936d25fc8cbf813fcf256be75c683))
39
+ * rendering docker context ([b6a49f8](https://github.com/spaceship-prompt/spaceship-prompt/commit/b6a49f8e00f28f265c13340183d102a1bbe5252f))
40
+ * Resolve newline issue with command expansion ([bcfce70](https://github.com/spaceship-prompt/spaceship-prompt/commit/bcfce70c8552d4b8e378e7b542754da4115ce7b8))
41
+ * **scripts:** Stop on errors ([ccee8e9](https://github.com/spaceship-prompt/spaceship-prompt/commit/ccee8e994d5bd1ddda8c3ed89e9d6767792a7b67))
42
+ * 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))
43
+ * 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)
44
+ * **tests:** render prefixes and suffixes only when they are not empty ([73c2c71](https://github.com/spaceship-prompt/spaceship-prompt/commit/73c2c7135edfeadb92b285c7db70af63566f7852))
45
+ * **upsearch:** Check repo properly ([4764ed9](https://github.com/spaceship-prompt/spaceship-prompt/commit/4764ed921d2b6a78c2ea72641ba91ed072e7b3b5))
46
+
47
+
48
+ ### Code Refactoring
49
+
50
+ * **ember:** remove ember from built-in sections ([05beb8b](https://github.com/spaceship-prompt/spaceship-prompt/commit/05beb8b56f6203d215c50c0b26ff27174b9104ab))
51
+ * **gradle:** migrate Gradle to a separate repo ([984bc01](https://github.com/spaceship-prompt/spaceship-prompt/commit/984bc01c073c399dfb7484c5ecdff672062a213f))
52
+ * **install:** simplify the installation process ([824f876](https://github.com/spaceship-prompt/spaceship-prompt/commit/824f87657309b1f2579173252667a3cfb88c881e))
53
+ * **maven:** migrate Maven to a separate repo ([3efd48b](https://github.com/spaceship-prompt/spaceship-prompt/commit/3efd48b55029ae2c68bbf4e3a43fb922c8b3e942))
54
+ * **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)
55
+
56
+
57
+ ### Features
58
+
59
+ * add ability to forcefully render a section synchronously ([216f0f2](https://github.com/spaceship-prompt/spaceship-prompt/commit/216f0f2c710191b1f3436c744c52b7de21129b4b))
60
+ * 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))
61
+ * Add is_async util ([d539ee5](https://github.com/spaceship-prompt/spaceship-prompt/commit/d539ee5d61714addb80ba2d531a36d1029cc3d18))
62
+ * Add java section ([713f406](https://github.com/spaceship-prompt/spaceship-prompt/commit/713f406a3f1bdbeda50bf6924dbf957230361595))
63
+ * **async:** add an option to globaly disable/enable async rendering ([0ca1463](https://github.com/spaceship-prompt/spaceship-prompt/commit/0ca1463b1891edfcad0d25897a0c733dfdd19d73))
64
+ * **async:** introduce async jobs indicator ([f0a75ce](https://github.com/spaceship-prompt/spaceship-prompt/commit/f0a75cece5361963b4c9a39fbd9151093ec3502d))
65
+ * **cli:** add a print command for CLI ([6843105](https://github.com/spaceship-prompt/spaceship-prompt/commit/6843105f2a061629cc912d255f6e9ace98cc485b))
66
+ * **cli:** add CLI ([205cb16](https://github.com/spaceship-prompt/spaceship-prompt/commit/205cb16eef6783d6e37af47d2492861d5c5aba7a))
67
+ * **cli:** add command completions for cli ([2ae45a4](https://github.com/spaceship-prompt/spaceship-prompt/commit/2ae45a4ec0c4231b69c2090d3a7ed2211051945a))
68
+ * **cli:** Add edit command ([b029587](https://github.com/spaceship-prompt/spaceship-prompt/commit/b029587ed9473ba9b8efc19ddaf8135636ae2d08))
69
+ * **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)
70
+ * **config:** Add ability to store config in ~/.config/spaceship ([b5dee37](https://github.com/spaceship-prompt/spaceship-prompt/commit/b5dee377c85b54e4f70071de42bc1cff52816f82))
71
+ * **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)
72
+ * **docker:** add docker image and publishing it to ghcr.io ([77d7457](https://github.com/spaceship-prompt/spaceship-prompt/commit/77d74570b7a68c934bb4e5c5ac1a7b36e9fd96cb))
73
+ * **exec_time:** display exec time with precision ([7b04aed](https://github.com/spaceship-prompt/spaceship-prompt/commit/7b04aed499175e22ec37b9af55fb3375d5fd48b1))
74
+ * **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)
75
+ * **haskell:** Look for .hs files ([b2eb8a3](https://github.com/spaceship-prompt/spaceship-prompt/commit/b2eb8a35f3c41b73a7d48787a3f4f413c390407f))
76
+ * **ibmcloud:** Enable async rendering for ibmcloud ([8391054](https://github.com/spaceship-prompt/spaceship-prompt/commit/8391054c79bacd68c87032ae9011f9c8deb424c6))
77
+ * **package:** Add composer and julia support ([3f8bb1e](https://github.com/spaceship-prompt/spaceship-prompt/commit/3f8bb1e5a41ad33f55f5c078ed893a4ef7cee214))
78
+ * **perf:** Compile to zwc ([3549bbf](https://github.com/spaceship-prompt/spaceship-prompt/commit/3549bbf9050670b70f79b61c6c90755022448b7e))
79
+ * **registry:** Add custom sections registry ([86d64dd](https://github.com/spaceship-prompt/spaceship-prompt/commit/86d64ddbba4c42092a6fcb98dc06822726531a49))
80
+ * **renderer:** render sync section on every render ([4e93ae0](https://github.com/spaceship-prompt/spaceship-prompt/commit/4e93ae0ccbb7cd692995b5e78942e783bb25aa71))
81
+ * **section:** migrate default section to v4 ([0684171](https://github.com/spaceship-prompt/spaceship-prompt/commit/0684171c41783c278cfaa84fbc844a18a1b4a7ed))
82
+ * **section:** Migrate sections to new signature ([b3249fb](https://github.com/spaceship-prompt/spaceship-prompt/commit/b3249fb756a31dec21f1c11beca1a37bf961332d))
83
+ * **section:** Named arguments for section ([201496b](https://github.com/spaceship-prompt/spaceship-prompt/commit/201496b4311852e070b315b473dcfbe1d9a792cc))
84
+ * **testkit:** add a simple testkit ([1ceca85](https://github.com/spaceship-prompt/spaceship-prompt/commit/1ceca858ddfe8888418e7096e3f863df5d611d6e))
85
+ * Upsearch for project files up the tree ([08f6d70](https://github.com/spaceship-prompt/spaceship-prompt/commit/08f6d70e972fc56fa47dccb42f1e44b0bdce352b))
86
+ * **vsc:** Make git and hg async ([9ddb9be](https://github.com/spaceship-prompt/spaceship-prompt/commit/9ddb9be29df8058e06b43a4a7504b4faa87cd677))
87
+
88
+
89
+ ### Performance Improvements
90
+
91
+ * **zwc:** Precompile root file and async ([ee5afc5](https://github.com/spaceship-prompt/spaceship-prompt/commit/ee5afc5caf87b22bf3467679f8a6849c04956b03))
92
+ * **zwc:** spaceship::precompile compiles sources to zwc ([58758e7](https://github.com/spaceship-prompt/spaceship-prompt/commit/58758e785d948ba3d5a1718dc5cc11321339ab81))
93
+
94
+
95
+ ### BREAKING CHANGES
96
+
97
+ * **section:** spaceship::section:v4 uses flags instead of arguments order to pass section params.
98
+ * **vi_mode:** vi_mode section is not include in core anymore
99
+ * **gradle:** Gradle section is not included by default. It can be installed additionally from:
100
+ https://github.com/spaceship-prompt/spaceship-gradle
101
+ * **maven:** Maven section is no longer available by default. It can be additionally installed
102
+ from: https://github.com/spaceship-prompt/spaceship-maven
103
+ * **install:** Now users have to manually enable prompt system and choose spaceship
104
+ * **ember:** ember section is no longer available out of the box. It needs to be installed
105
+ additionally.
106
+
1
107
  ## [3.16.7](https://github.com/spaceship-prompt/spaceship-prompt/compare/v3.16.6...v3.16.7) (2022-05-10)
2
108
 
3
109
 
package/README.md CHANGED
@@ -1,12 +1,14 @@
1
+ [![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct-single.svg)](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>🚀⭐ Spaceship ZSH <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 for Astronauts.
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">
@@ -15,7 +17,7 @@
15
17
  alt="NPM Version" />
16
18
  </a>
17
19
 
18
- <a href="https://githucom/spaceship-prompt/spaceship-prompt/actions">
20
+ <a href="https://github.com/spaceship-prompt/spaceship-prompt/actions">
19
21
  <img src="https://img.shields.io/github/workflow/status/spaceship-prompt/spaceship-prompt/ci?style=flat-square"
20
22
  alt="GitHub Workflow Status" />
21
23
  </a>
@@ -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">Installing</a> |
50
- <a href="#features">Features</a> |
51
- <a href="https://spaceship-prompt.sh/options">Options</a> |
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
- [![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct-single.svg)](https://stand-with-ukraine.pp.ua/)
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
- <img alt="Spaceship with Hyper and One Dark" src="https://user-images.githubusercontent.com/10276208/36086434-5de52ace-0ff2-11e8-8299-c67f9ab4e9bd.gif" width="980px">
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
- <sub>Visit <a href="./docs/troubleshooting.md#why-doesnt-my-prompt-look-like-the-preview">Troubleshooting</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.</sub>
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
- **💡 Tip:** Follow [our Twitter](https://twitter.com/SpaceshipPrompt) to keep yourself updated about new features, improvements, and bugfixes.
77
+ Here are some sneak picks of what **Spaceship** can show:
130
78
 
131
- ## Requirements
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
- To work correctly, you will first need:
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
- - [`zsh`](http://www.zsh.org/) (v5.2 or recent) must be installed.
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
- ## Installing
93
+ Before we begin, let's make sure you have the following installed:
139
94
 
140
- Now that the requirements are satisfied, you can install Spaceship ZSH via any of the following tools.
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
- **💡 Tip:** If you like this project ~~and want to get some stickers and postcards~~, consider becoming a patron:
104
+ ## 🚀 Installation
143
105
 
144
- <a href="https://patreon.com/denysdovhan">
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
- ### [Homebrew]
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
- You can also add the following to your [`Brewfile`](https://github.com/Homebrew/homebrew-bundle#usage):
116
+ Add prompt initialization to your `.zshrc`:
155
117
 
156
- ```ruby
157
- brew "spaceship"
118
+ ```zsh title="Terminal"
119
+ echo "source $(brew --prefix)/opt/spaceship/spaceship.zsh" >>! ~/.zshrc
158
120
  ```
121
+ </details>
159
122
 
160
- ### [npm]
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,107 @@ 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
- ### [prezto]
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
- ### [zim]
159
+ </details>
194
160
 
195
- Add `zmodule spaceship-prompt/spaceship-prompt --name spaceship` to your `.zimrc` and run `zimfw install`.
161
+ <details>
162
+ <summary>zim</summary>
163
+ Add Spaceship to your `.zimrc`:
196
164
 
197
- ### [antigen]
165
+ ```zsh
166
+ zmodule spaceship-prompt/spaceship-prompt --name spaceship --no-submodules
167
+ ```
198
168
 
199
- Add the following snippet in your `.zshrc`:
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
- ### [antibody]
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
- ### [zinit]
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
- ### [zgen]
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
- ### [zplug]
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
- ### Linux package manager
221
+ <details>
222
+ <summary>sheldon</summary>
223
+ Add the following to your `plugins.toml` file (open it with `sheldon edit`):
238
224
 
239
- #### Arch Linux
225
+ ```toml
226
+ [plugins.spaceship]
227
+ github = "spaceship-prompt/spaceship-prompt"
228
+ ```
229
+
230
+ Or run the following to automatically add it:
231
+
232
+ ```zsh
233
+ sheldon add spaceship --github spaceship-prompt/spaceship-prompt
234
+ ```
235
+ </details>
240
236
 
237
+ <details>
238
+ <summary>Arch</summary>
241
239
  Install the latest master from the AUR package [`spaceship-prompt-git`](https://aur.archlinux.org/packages/spaceship-prompt-git/):
242
240
 
243
241
  ```
@@ -245,138 +243,83 @@ git clone https://aur.archlinux.org/spaceship-prompt-git.git --depth=1
245
243
  cd spaceship-prompt-git
246
244
  makepkg -si
247
245
  ```
246
+ </details>
248
247
 
249
- ### Manual
248
+ <details>
249
+ <summary>Manual</summary>
250
250
 
251
- If you have problems with approaches above, follow these instructions:
251
+ If none of the above methods works for you, you can install Spaceship manually.
252
252
 
253
- - Clone this repo `git clone https://github.com/spaceship-prompt/spaceship-prompt.git --depth=1`
254
- - Symlink `spaceship.zsh` to somewhere in [`$fpath`](http://www.refining-linux.org/archives/46/ZSH-Gem-12-Autoloading-functions/) as `prompt_spaceship_setup`.
255
- - Initialize prompt system and choose `spaceship`.
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
- ```
253
+ 1. Clone this repo somewhere, for example to `$HOME/.zsh/spaceship`.
254
+ 2. Source Spaceship in your `~/.zshrc`.
270
255
 
271
- Then install the theme like this:
256
+ ### Example
272
257
 
273
258
  ```zsh
274
- $ ln -sf "$PWD/spaceship.zsh" "${ZDOTDIR:-$HOME}/.zfunctions/prompt_spaceship_setup"
259
+ mkdir -p "$HOME/.zsh"
260
+ git clone --depth=1 https://github.com/spaceship-prompt/spaceship-prompt.git "$HOME/.zsh/spaceship"
275
261
  ```
276
262
 
277
263
  For initializing prompt system add this to your `.zshrc`:
278
264
 
279
- ```zsh
280
- # .zshrc
281
- autoload -U promptinit; promptinit
282
- prompt spaceship
265
+ ```zsh title=".zshrc"
266
+ source "~/.zsh/spaceship/spaceship.zsh"
283
267
  ```
268
+ </details>
284
269
 
285
- ## Customization
270
+ ## ⚙️ Configuration
286
271
 
287
272
  Spaceship works well out of the box, but you can customize almost everything if you want.
288
273
 
289
- - [**Options**](./docs/options.md) — Tweak section's behavior with tons of options.
290
- - [**API**](./docs/api.md) — Define a custom section that will do exactly what you want.
274
+ - [**⚙️ Configuration**](https://spaceship-prompt.sh/config/intro) — Tweak section's behavior with tons of options.
275
+ - [**😎 Advanced Usage**](https://spaceship-prompt.sh/advanced/creating-section) — Learn how to create a custom section, benefit of per-directory configuration and more.
291
276
 
292
- You have the ability to customize or disable specific elements of Spaceship. Set options and define new sections in your `.zshrc` file, **after** the theme. To include a custom section you have defined in your prompt, add it to the `SPACESHIP_PROMPT_ORDER`.
277
+ Additionally, join our community in [Discord](https://discord.gg/NTQWz8Dyt9) and follow our [Twitter](https//twitter.com/SpaceshipPrompt) for updates.
293
278
 
294
- For example:
279
+ ## 🫶 Contributing
295
280
 
296
- ```shell
297
- # .zshrc
281
+ 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
282
 
299
- # add Spaceship (differs by setup, see Installating above)
283
+ 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
284
 
301
- section_mysection() {
302
- # ...
303
- }
285
+ 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
286
 
305
- SPACESHIP_PROMPT_ORDER=(<any preceding sections> mysection <any following sections>)
306
- ```
287
+ ## 💌 Sponsoring
307
288
 
308
- To append custom sections to the default Spaceship prompt, follow the form:
289
+ 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
290
 
310
- ```shell
311
- SPACESHIP_PROMPT_ORDER=($SPACESHIP_PROMPT_ORDER mysection)
312
- ```
291
+ * **Recurring donations**:
292
+ * [GitHub Sponsors](https://github.com/sponsors/denysdovhan?frequency=recurring)
293
+ * [Open Collective](https://opencollective.com/spaceship-prompt)
294
+ * [Patreon](https://patreon.com/denysdovhan)
295
+ * **One-time donations**:
296
+ * [GitHub Sponsors](https://github.com/sponsors/denysdovhan?frequency=one-time)
297
+ * [Buy Me A Coffee](https://buymeacoffee.com/denysdovhan)
298
+ * [Monobank Jar](https://send.monobank.ua/jar/2N46sWTaZZ)
299
+ * **Crypto donations**:
300
+ * Ethereum: `0x5C9496De5E51D48daf28354DC04d8f9D33955559`
301
+ * Bitcoin: `bc1q5ezjvpgftmx42f9qgdf5lscjz43uh4jf02uvje`
313
302
 
314
- To prepend custom sections to the default Spaceship prompt, follow the form:
315
-
316
- ```shell
317
- SPACESHIP_PROMPT_ORDER=(mysection $SPACESHIP_PROMPT_ORDER)
318
- ```
303
+ ## 🤔 Having trouble?
319
304
 
320
- **💡 Tip:** Take a look at popular option presets or share your own configuration on [Presets](https://github.com/spaceship-prompt/spaceship-prompt/wiki/Presets) wiki page.
305
+ Find answers on our troubleshooting page or get help by our community.
321
306
 
322
- ## Troubleshooting
307
+ [**Issues**](https://github.com/spaceship-prompt/spaceship-prompt/issues) • [**Discussions**](https://github.com/spaceship-prompt/spaceship-prompt/discussions/) • [**Discord**](https://discord.gg/NTQWz8Dyt9)
323
308
 
324
- Having trouble? Take a look at out [Troubleshooting](./docs/troubleshooting.md) page.
309
+ 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
310
 
326
- 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.
327
-
328
- ## Related Projects
311
+ ## 👀 Derived Projects
329
312
 
330
313
  Here's a list of related projects that have been inspired by Spaceship ZSH.
331
314
 
315
+ - [**denysdovhan/dotfiles**](https://github.com/denysdovhan/dotfiles) - Dotfiles of Spaceship's author from which Spaceship is originated.
332
316
  - [**matchai/spacefish**](https://github.com/matchai/spacefish) - A port of Spaceship ZSH for fish shell intending to achieve complete feature parity.
333
317
  - [**starship/starship**](https://github.com/starship/starship) - A blazing-fast, cross-shell prompt written in Rust, heavily inspired by Spaceship ZSH.
334
318
 
335
- ## Team
336
-
337
- | [![Denys Dovhan](https://github.com/denysdovhan.png?size=100)](http://denysdovhan.com) | [![Salmanul Farzy](https://github.com/salmanulfarzy.png?size=100)](https://github.com/salmanulfarzy) | [![Maxim Baz](https://github.com/maximbaz.png?size=100)](https://github.com/maximbaz) | [![Runrioter Wung](https://github.com/Runrioter.png?size=100)](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
319
+ ## 📄 License
355
320
 
356
321
  MIT © [Denys Dovhan](http://denysdovhan.com)
357
322
 
358
- <!-- Badges -->
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
323
+ <!-- References -->
362
324
  [zsh-url]: http://zsh.org/
363
- [zsh-image]: https://img.shields.io/badge/zsh-%3E%3Dv5.2-777777.svg?style=flat-square
364
325
  [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