docs(i18n): new Crowdin updates (#3085)

* New translations README.md (French)

* New translations README.md (Korean)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Arabic)

* New translations README.md (Russian)

* New translations README.md (Indonesian)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Vietnamese)

* New translations README.md (Chinese Traditional)

* New translations README.md (Chinese Simplified)

* New translations README.md (Turkish)

* New translations README.md (Portuguese)

* New translations README.md (French)

* New translations README.md (Polish)

* New translations README.md (Dutch)

* New translations README.md (Korean)

* New translations README.md (Japanese)

* New translations README.md (Italian)

* New translations README.md (German)

* New translations README.md (Spanish)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Korean)

* New translations README.md (Russian)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Vietnamese)

* New translations README.md (Chinese Traditional)

* New translations README.md (Chinese Simplified)

* New translations README.md (Turkish)

* New translations README.md (Portuguese)

* New translations README.md (French)

* New translations README.md (Polish)

* New translations README.md (Dutch)

* New translations README.md (Japanese)

* New translations README.md (Italian)

* New translations README.md (German)

* New translations README.md (Arabic)

* New translations README.md (Spanish)

* New translations README.md (Indonesian)

* New translations README.md (Russian)

* New translations README.md (Italian)

* New translations README.md (Japanese)

* New translations README.md (Korean)

* New translations README.md (Dutch)

* New translations README.md (Polish)

* New translations README.md (Portuguese)

* New translations README.md (Turkish)

* New translations README.md (Arabic)

* New translations README.md (Chinese Simplified)

* New translations README.md (Chinese Traditional)

* New translations README.md (Vietnamese)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Indonesian)

* New translations README.md (German)

* New translations README.md (Spanish)

* New translations README.md (French)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (German)

* New translations README.md (German)

* New translations README.md (German)

* New translations README.md (German)

* New translations README.md (German)

* New translations README.md (German)

* New translations README.md (German)

* New translations README.md (Korean)

* New translations README.md (Russian)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Vietnamese)

* New translations README.md (Chinese Traditional)

* New translations README.md (Chinese Simplified)

* New translations README.md (Turkish)

* New translations README.md (Portuguese)

* New translations README.md (French)

* New translations README.md (Polish)

* New translations README.md (Dutch)

* New translations README.md (Japanese)

* New translations README.md (Italian)

* New translations README.md (German)

* New translations README.md (Arabic)

* New translations README.md (Spanish)

* New translations README.md (Indonesian)

* New translations README.md (Korean)

* New translations README.md (Russian)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Vietnamese)

* New translations README.md (Chinese Traditional)

* New translations README.md (Chinese Simplified)

* New translations README.md (Turkish)

* New translations README.md (Portuguese)

* New translations README.md (French)

* New translations README.md (Polish)

* New translations README.md (Dutch)

* New translations README.md (Japanese)

* New translations README.md (Italian)

* New translations README.md (German)

* New translations README.md (Arabic)

* New translations README.md (Spanish)

* New translations README.md (Indonesian)

* New translations README.md (Japanese)

* New translations README.md (German)

* New translations README.md (Russian)

* New translations README.md (Indonesian)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Vietnamese)

* New translations README.md (Chinese Traditional)

* New translations README.md (Chinese Simplified)

* New translations README.md (Turkish)

* New translations README.md (Portuguese)

* New translations README.md (French)

* New translations README.md (Polish)

* New translations README.md (Dutch)

* New translations README.md (Korean)

* New translations README.md (Japanese)

* New translations README.md (Italian)

* New translations README.md (Arabic)

* New translations README.md (Spanish)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Korean)

* New translations README.md (Russian)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Vietnamese)

* New translations README.md (Chinese Traditional)

* New translations README.md (Chinese Simplified)

* New translations README.md (Turkish)

* New translations README.md (Portuguese)

* New translations README.md (French)

* New translations README.md (Polish)

* New translations README.md (Dutch)

* New translations README.md (Japanese)

* New translations README.md (Italian)

* New translations README.md (German)

* New translations README.md (Arabic)

* New translations README.md (Spanish)

* New translations README.md (Indonesian)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (German)

* New translations README.md (French)

* New translations README.md (Polish)

* New translations README.md (Spanish)

* New translations README.md (Arabic)

* New translations README.md (Italian)

* New translations README.md (Japanese)

* New translations README.md (Korean)

* New translations README.md (Dutch)

* New translations README.md (Portuguese)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Russian)

* New translations README.md (Turkish)

* New translations README.md (Chinese Simplified)

* New translations README.md (Vietnamese)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Indonesian)

* New translations README.md (French)

* New translations README.md (Russian)

* New translations README.md (Indonesian)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Vietnamese)

* New translations README.md (Chinese Traditional)

* New translations README.md (Chinese Simplified)

* New translations README.md (Turkish)

* New translations README.md (Portuguese)

* New translations README.md (Spanish)

* New translations README.md (Polish)

* New translations README.md (Dutch)

* New translations README.md (Korean)

* New translations README.md (Japanese)

* New translations README.md (Italian)

* New translations README.md (German)

* New translations README.md (Arabic)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Korean)

* New translations README.md (French)

* New translations README.md (Japanese)

* New translations README.md (Spanish)

* New translations README.md (Arabic)

* New translations README.md (German)

* New translations README.md (Italian)

* New translations README.md (Chinese Traditional)

* New translations README.md (Dutch)

* New translations README.md (Polish)

* New translations README.md (Portuguese)

* New translations README.md (Russian)

* New translations README.md (Turkish)

* New translations README.md (Chinese Simplified)

* New translations README.md (Vietnamese)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Indonesian)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Korean)

* New translations README.md (Russian)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Vietnamese)

* New translations README.md (Chinese Traditional)

* New translations README.md (Chinese Simplified)

* New translations README.md (Turkish)

* New translations README.md (Portuguese)

* New translations README.md (French)

* New translations README.md (Polish)

* New translations README.md (Dutch)

* New translations README.md (Japanese)

* New translations README.md (Italian)

* New translations README.md (German)

* New translations README.md (Arabic)

* New translations README.md (Spanish)

* New translations README.md (Indonesian)

* New translations README.md (Japanese)

* New translations README.md (Japanese)

* New translations README.md (Japanese)
This commit is contained in:
Matan Kushner
2021-11-07 18:07:39 +00:00
committed by GitHub
parent b3fe17caf4
commit 7526e20eb4
113 changed files with 8472 additions and 5414 deletions
+30 -7
View File
@@ -21,7 +21,7 @@ function blastoff(){
starship_precmd_user_func="blastoff"
```
- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). 然而,您**必须**在捕捉 DEBUG 信号*之前*启动 Starship Starship 可以保留 DEBUG trap 的值,但如果该 trap 在 starship 启动后被覆盖,一些功能将会被破坏。
- 要在一个命令运行前运行自定义函数,您可以使用 [`DEBUG` trap 机制](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/) 然而,您**必须**在捕捉 DEBUG 信号*之前*启动 Starship Starship 可以保留 DEBUG trap 的值,但如果该 trap 在 starship 启动后被覆盖,一些功能将会被破坏。
```bash
function blastoff(){
@@ -31,11 +31,23 @@ trap blastoff DEBUG # 启动 starship *之前* 设置 DEBUG trap
eval $(starship init bash)
```
## 更改窗口标题
## Custom pre-prompt and pre-execution Commands in PowerShell
Some shell prompts will automatically change the window title for you (e.g. to reflect your working directory). Fish 甚至默认会执行此功能。 Starship 没有实现此功能,但将这个功能添加到 `bash``zsh` 是相当简单的。
PowerShell does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `powershell`. 然而,Starship 确实能使您有限地在提示符渲染过程中插入自己的函数执行:
首先,定义窗口标题更改函数(在 bash 和 zsh 中相同):
Create a function named `Invoke-Starship-PreCommand`
```powershell
function Invoke-Starship-PreCommand {
$host.ui.Write("🚀")
}
```
## Change Window Title
Some shell prompts will automatically change the window title for you (e.g. to reflect your working directory). Fish even does it by default. Starship does not do this, but it's fairly straightforward to add this functionality to `bash` or `zsh`.
First, define a window title change function (identical in bash and zsh):
```bash
function set_win_title(){
@@ -43,15 +55,15 @@ function set_win_title(){
}
```
您可以使用变量来定制标题(常用的有 `$USER``$HOSTNAME` `$PWD`)。
You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices).
`bash` 中,设置此函数为 starship 预执行函数:
In `bash`, set this function to be the precmd starship function:
```bash
starship_precmd_user_func="set_win_title"
```
`zsh`中,将此函数添加到 `reservmd_functions` 列表:
In `zsh`, add this to the `precmd_functions` array:
```bash
precmd_functions+=(set_win_title)
@@ -68,6 +80,17 @@ function set_win_title(){
starship_precmd_user_func="set_win_title"
```
You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`.
```powershell
# edit $PROFILE
function Invoke-Starship-PreCommand {
$host.ui.Write("`e]0; PS> $env:USERNAME@$env:COMPUTERNAME`: $pwd `a")
}
Invoke-Expression (&starship init powershell)
```
## Enable Right Prompt
Some shells support a right prompt which renders on the same line as the input. Starship can set the content of the right prompt using the `right_format` option. Any module that can be used in `format` is also supported in `right_format`. The `$all` variable will only contain modules not explicitly used in either `format` or `right_format`.
+248 -175
View File
@@ -146,9 +146,9 @@ format = '''
| ----------------- | ----------------------------- | ---------------------------------------------------------------- |
| `format` | [见下文](#default-prompt-format) | 配置提示符的格式。 |
| `right_format` | `""` | See [Enable Right Prompt](/advanced-config/#enable-right-prompt) |
| `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). |
| `command_timeout` | `500` | Timeout for commands executed by starship (in milliseconds). |
| `add_newline` | `true` | Inserts blank line between shell prompts. |
| `scan_timeout` | `30` | Starship 扫描文件的超时时间(单位:毫秒)。 |
| `command_timeout` | `500` | Startship 执行命令的超时时间(单位:毫秒)。 |
| `add_newline` | `true` | 在 shell 提示符之间插入空行。 |
### 示例
@@ -212,6 +212,7 @@ $nodejs\
$ocaml\
$perl\
$php\
$pulumi\
$purescript\
$python\
$rlang\
@@ -252,7 +253,7 @@ format="$all$directory$character"
## AWS
The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials.
`aws` 组件显示当前 AWS 主机所在区域与配置信息。 各组件基于 `AWS_REGION``AWS_DEFAULT_REGION` `AWS_PROFILE` 环境变量与 `~/.aws/config` 文件。 This module also shows an expiration timer when using temporary credentials.
When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var.
@@ -326,7 +327,7 @@ symbol = "🅰 "
## Battery
The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%.
`battery` 组件显示电池充电情况和当前充电状态。 这个组件只会在当前电量低于 10% 时显示。
### 配置项
@@ -354,7 +355,7 @@ discharging_symbol = "💀 "
### Battery 组件的显示
The `display` configuration option is used to define when the battery indicator should be shown (threshold), which symbol would be used (symbol), and what it would like (style). If no `display` is provided. 默认设置如下:
The `display` configuration option is used to define when the battery indicator should be shown (threshold), which symbol would be used (symbol), and what it would like (style). 如果 `display` 没有设置, 默认设置如下:
```toml
[[battery.display]]
@@ -366,7 +367,7 @@ The default value for the `charging_symbol` and `discharging_symbol` option is r
#### 配置项
The `display` option is an array of the following table.
`display` 字段的子字段如下:
| Option | 默认值 | 描述 |
| -------------------- | ---------- | --------------------------------------------------------------------------------------------------------- |
@@ -385,7 +386,7 @@ style = "bold red"
[[battery.display]] # "bold yellow" style and 💦 symbol when capacity is between 10% and 30%
threshold = 30
style = "bold yellow"
discharging_symbol = 💦
discharging_symbol = "💦"
# when capacity is over 30%, the battery indicator will not be displayed
@@ -393,9 +394,9 @@ discharging_symbol = 💦
## Character
The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal.
`character` 组件用于在您输入终端的文本旁显示一个字符(通常是一个箭头)。
The character will tell you whether the last command was successful or not. It can do this in two ways:
这个字符可以告诉您最后一个命令是否执行成功。 It can do this in two ways:
- changing color (`red`/`green`)
- changing shape (``/`✖`)
@@ -523,27 +524,27 @@ The `cobol` module shows the currently installed version of COBOL. By default, t
## Command Duration
The `cmd_duration` module shows how long the last command took to execute. The module will be shown only if the command took longer than two seconds, or the `min_time` config value, if it exists.
`cmd_duration` 组件显示上一个命令执行的时间。 此组件只在命令执行时间长于两秒时显示,或者当其 `min_time` 字段被设置时,按此值为执行时间的显示下限。
::: warning Do not hook the DEBUG trap in Bash
::: warning 不要在 Bash 里捕获 DEBUG 信号
If you are running Starship in `bash`, do not hook the `DEBUG` trap after running `eval $(starship init $0)`, or this module **will** break.
如果您正在 `bash` 上使用 Starship,在运行 `eval $(starship)` 后,不要捕获 `DEBUG` 信号,否则此组件**将会**坏掉。
:::
Bash users who need preexec-like functionality can use [rcaloras's bash_preexec framework](https://github.com/rcaloras/bash-preexec). Simply define the arrays `preexec_functions` and `precmd_functions` before running `eval $(starship init $0)`, and then proceed as normal.
需要在自动每一条命令前执行某些操作的 Bash 用户可以使用 [rcaloras bash_preexec 框架](https://github.com/rcaloras/bash-preexec)。 只需要在执行 `eval $(starship init $0)` 前简单地定义 `preexec_functions` `precmd_functions` 两个列表,就可以照常运行了。
### 配置项
| Option | 默认值 | 描述 |
| -------------------- | ----------------------------- | ---------------------------------------------------------- |
| `min_time` | `2_000` | Shortest duration to show time for (in milliseconds). |
| `show_milliseconds` | `false` | Show milliseconds in addition to seconds for the duration. |
| `format` | `"took [$duration]($style) "` | 组件格式化模板。 |
| `style` | `"bold yellow"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `cmd_duration` module. |
| `show_notifications` | `false` | Show desktop notifications when command completes. |
| `min_time_to_notify` | `45_000` | Shortest duration for notification (in milliseconds). |
| Option | 默认值 | 描述 |
| -------------------- | ----------------------------- | ----------------------------------------------------- |
| `min_time` | `2_000` | 显示此组件所需的最短执行时长(单位:毫秒)。 |
| `show_milliseconds` | `false` | 除了秒数外在执行时长中额外显示毫秒。 |
| `format` | `"took [$duration]($style) "` | 组件格式化模板。 |
| `style` | `"bold yellow"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `cmd_duration` 组件。 |
| `show_notifications` | `false` | Show desktop notifications when command completes. |
| `min_time_to_notify` | `45_000` | Shortest duration for notification (in milliseconds). |
::: tip
@@ -576,20 +577,20 @@ The `conda` module shows the current [Conda](https://docs.conda.io/en/latest/) e
::: tip
This does not suppress conda's own prompt modifier, you may want to run `conda config --set changeps1 False`.
此组件没有禁用 conda 自带的提示符修改,您可能需要执行 `conda config --set changeps1 False`
:::
### 配置项
| Option | 默认值 | 描述 |
| ------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `truncation_length` | `1` | The number of directories the environment path should be truncated to, if the environment was created via `conda create -p [path]`. `0` means no truncation. Also see the [`directory`](#directory) module. |
| `symbol` | `"🅒 "` | The symbol used before the environment name. |
| `style` | `"bold green"` | 此组件的样式。 |
| `format` | `"via [$symbol$environment]($style) "` | 组件格式化模板。 |
| `ignore_base` | `true` | Ignores `base` environment when activated. |
| `disabled` | `false` | Disables the `conda` module. |
| Option | 默认值 | 描述 |
| ------------------- | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `truncation_length` | `1` | 如果这个 conda 环境是通过 `conda create -p [path]` 创建的,环境路径的目录深度应该被截断到此数量。 `0` 表示不用截断。 另请参阅 [`directory`](#directory) 组件。 |
| `symbol` | `"🅒 "` | 在环境名之前显示的符号。 |
| `style` | `"bold green"` | 此组件的样式。 |
| `format` | `"via [$symbol$environment]($style) "` | 组件格式化模板。 |
| `ignore_base` | `true` | Ignores `base` environment when activated. |
| `disabled` | `false` | 禁用 `conda` 组件。 |
### Variables
@@ -614,7 +615,7 @@ format = "[$symbol$environment](dimmed green) "
The `crystal` module shows the currently installed version of [Crystal](https://crystal-lang.org/). By default the module will be shown if any of the following conditions are met:
- The current directory contains a `shard.yml` file
- 当前目录包含 `shard.yml` 文件
- The current directory contains a `.cr` file
### 配置项
@@ -655,7 +656,7 @@ The `dart` module shows the currently installed version of [Dart](https://dart.d
- The current directory contains a file with `.dart` extension
- The current directory contains a `.dart_tool` directory
- The current directory contains a `pubspec.yaml`, `pubspec.yml` or `pubspec.lock` file
- 当前目录包含 `pubspec.yaml``pubspec.yml` `pubspec.lock` 文件
### 配置项
@@ -726,33 +727,33 @@ format = "via [🦕 $version](green bold) "
## Directory
The `directory` module shows the path to your current directory, truncated to three parent folders. Your directory will also be truncated to the root of the git repo that you're currently in.
`directory` 组件显示当前目录的路径,显示的路径会截断到三个父目录以内。 如果您处于一个 git 仓库中,显示的路径则最多会截断到该仓库的根目录。
When using the fish style pwd option, instead of hiding the path that is truncated, you will see a shortened name of each directory based on the number you enable for the option.
当使用 fish 风格的当前目录显示样式时,您会看到基于您的设置的每个上级目录的短名称,而不是隐藏被截断的上级目录。
For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, and the option set to `1`. You will now see `~/D/N/nixpkgs/pkgs`, whereas before it would have been `nixpkgs/pkgs`.
例如,对于 `~/Dev/Nix/nixpkgs/pkgs`,其中 `nixpkgs` 是 git 仓库根目录,fish 风格相关选项设置为 `1`。 您将会看到 `~/D/N/nixpkgs/pkgs`,而在设置 fish 风格之前,当前路径将显示成 `nixpkgs/pkgs`
### 配置项
| Option | 默认值 | 描述 |
| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------- |
| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. |
| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. |
| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | 组件格式化模板。 |
| `style` | `"bold cyan"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `directory` module. |
| `read_only` | `"🔒"` | The symbol indicating current directory is read only. |
| `read_only_style` | `"red"` | The style for the read only symbol. |
| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| Option | 默认值 | 描述 |
| ------------------- | -------------------------------------------------- | ----------------------------------------------------- |
| `truncation_length` | `3` | 当前目录路径被截断后最多保留的父目录数量。 |
| `truncate_to_repo` | `true` | 是否只截断到您当前处于的 git 仓库根目录下。 |
| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | 组件格式化模板。 |
| `style` | `"bold cyan"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `directory` 组件。 |
| `read_only` | `"🔒"` | The symbol indicating current directory is read only. |
| `read_only_style` | `"red"` | The style for the read only symbol. |
| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
<details>
<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
<summary>此组件有几个高级配置选项来控制当前目录路径的显示方式。</summary>
| Advanced Option | 默认值 | 描述 |
| --------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `substitutions` | | A table of substitutions to be made to the path. |
| `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. |
| `fish_style_pwd_dir_length` | `0` | 使用 fish shell 当前目录路径逻辑时每个省略目录名使用的字符数。 |
| `use_logical_path` | `true` | If `true` render the logical path sourced from the shell via `PWD` or `--logical-path`. If `false` instead render the physical filesystem path with symlinks resolved. |
`substitutions` allows you to define arbitrary replacements for literal strings that occur in the path, for example long network prefixes or development directories (i.e. Java). Note that this will disable the fish style PWD.
@@ -788,7 +789,7 @@ truncation_symbol = "…/"
## Docker Context
The `docker_context` module shows the currently active [Docker context](https://docs.docker.com/engine/context/working-with-contexts/) if it's not set to `default` or if the `DOCKER_HOST` or `DOCKER_CONTEXT` environment variables are set (as they are meant to override the context in use).
The `docker_context` module shows the currently active [Docker context](https://docs.docker.com/engine/context/working-with-contexts/) if it's not set to `default` or if the `DOCKER_MACHINE_NAME`, `DOCKER_HOST` or `DOCKER_CONTEXT` environment variables are set (as they are meant to override the context in use).
### 配置项
@@ -824,7 +825,7 @@ format = "via [🐋 $context](blue bold)"
## Dotnet
The `dotnet` module shows the relevant version of the [.NET Core SDK](https://dotnet.microsoft.com/) for the current directory. If the SDK has been pinned in the current directory, the pinned version is shown. Otherwise the module shows the latest installed version of the SDK.
The `dotnet` module shows the relevant version of the [.NET Core SDK](https://dotnet.microsoft.com/) for the current directory. 如果当前目录已被绑定了一个版本的 SDK,则显示被帮定的版本。 否则此组件将显示最新安装的 SDK 版本。
By default this module will only be shown in your prompt when one or more of the following files are present in the current directory:
@@ -839,7 +840,7 @@ By default this module will only be shown in your prompt when one or more of the
You'll also need the .NET Core SDK installed in order to use it correctly.
Internally, this module uses its own mechanism for version detection. Typically it is twice as fast as running `dotnet --version`, but it may show an incorrect version if your .NET project has an unusual directory layout. If accuracy is more important than speed, you can disable the mechanism by setting `heuristic = false` in the module options.
在内部,此组件使用自己的版本检测机制。 一般来说此组件是直接执行 `dotnet --version` 的两倍快,但当你的 .NET 项目使用了不常见的目录布局时此组件可能显示一个错误的版本。 如果相比于速度您更需要正确的版本号,您可以在组件设置中设置 `heuristic = false` 来禁用该机制。
The module will also show the Target Framework Moniker (<https://docs.microsoft.com/en-us/dotnet/standard/frameworks#supported-target-framework-versions>) when there is a csproj file in the current directory.
@@ -849,13 +850,13 @@ The module will also show the Target Framework Moniker (<https://docs.microsoft.
| ------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )(🎯 $tfm )]($style)"` | 组件格式化模板。 |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `".NET "` | The symbol used before displaying the version of dotnet. |
| `heuristic` | `true` | Use faster version detection to keep starship snappy. |
| `symbol` | `".NET "` | 这个字段的内容会显示在当前 .NET 版本之前。 |
| `heuristic` | `true` | 使用更快的版本探测机制以保证 starship 的运行速度。 |
| `detect_extensions` | `["csproj", "fsproj", "xproj"]` | Which extensions should trigger this module. |
| `detect_files` | `["global.json", "project.json", "Directory.Build.props", "Directory.Build.targets", "Packages.props"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this modules. |
| `style` | `"bold blue"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `dotnet` module. |
| `disabled` | `false` | 禁用 `dotnet` 组件。 |
### Variables
@@ -883,7 +884,7 @@ heuristic = false
The `elixir` module shows the currently installed version of [Elixir](https://elixir-lang.org/) and [Erlang/OTP](https://erlang.org/doc/). By default the module will be shown if any of the following conditions are met:
- The current directory contains a `mix.exs` file.
- 当前目录包含 `mix.exs` 文件.
### 配置项
@@ -922,8 +923,8 @@ symbol = "🔮 "
The `elm` module shows the currently installed version of [Elm](https://elm-lang.org/). By default the module will be shown if any of the following conditions are met:
- The current directory contains a `elm.json` file
- The current directory contains a `elm-package.json` file
- 当前目录包含 `elm.json` 文件
- 当前目录包含 `elm-package.json` 文件
- The current directory contains a `.elm-version` file
- The current directory contains a `elm-stuff` folder
- The current directory contains a `*.elm` files
@@ -962,10 +963,10 @@ format = "via [ $version](cyan bold) "
## Environment Variable
The `env_var` module displays the current value of a selected environment variables. The module will be shown only if any of the following conditions are met:
The `env_var` module displays the current value of a selected environment variables. 此组件只有满足以下条件之一时才会被显示:
- The `variable` configuration option matches an existing environment variable
- The `variable` configuration option is not defined, but the `default` configuration option is
- 设置的 `variable` 是一个已存在的环境变量
- 未定义 `variable`,但定义了 `default`
::: tip Multiple environmental variables can be displayed by using a `.`. (see example) If the `variable` configuration option is not set, the module will display value of variable under the name of text after the `.` character.
@@ -981,13 +982,13 @@ default = "unknown user"
### 配置项
| Option | 默认值 | 描述 |
| ---------- | ------------------------------ | ---------------------------------------------------------------------------- |
| `symbol` | | The symbol used before displaying the variable value. |
| `variable` | | The environment variable to be displayed. |
| `default` | | The default value to be displayed when the selected variable is not defined. |
| `format` | `"with [$env_value]($style) "` | 组件格式化模板。 |
| `disabled` | `false` | Disables the `env_var` module. |
| Option | 默认值 | 描述 |
| ---------- | ------------------------------ | ------------------- |
| `symbol` | `""` | 这个字段的内容会显示在环境变量值之前。 |
| `variable` | | 要显示的环境变量。 |
| `default` | | 所选变量未定义时显示的默认值。 |
| `format` | `"with [$env_value]($style) "` | 组件格式化模板。 |
| `disabled` | `false` | 禁用 `env_var` 组件。 |
### Variables
@@ -1024,8 +1025,8 @@ default = "unknown user"
The `erlang` module shows the currently installed version of [Erlang/OTP](https://erlang.org/doc/). By default the module will be shown if any of the following conditions are met:
- The current directory contains a `rebar.config` file.
- The current directory contains a `erlang.mk` file.
- 当前目录包含 `rebar.config` 文件.
- 当前目录包含 `erlang.mk` 文件.
### 配置项
@@ -1065,10 +1066,11 @@ The `fill` module fills any extra space on the line with a symbol. If multiple `
### 配置项
| Option | 默认值 | 描述 |
| -------- | -------------- | --------------------------------- |
| `symbol` | `"."` | The symbol used to fill the line. |
| `style` | `"bold black"` | 此组件的样式。 |
| Option | 默认值 | 描述 |
| ---------- | -------------- | --------------------------------- |
| `symbol` | `"."` | The symbol used to fill the line. |
| `style` | `"bold black"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `fill` module |
### 示例
@@ -1151,20 +1153,20 @@ asia-northeast1 = "an1"
## Git Branch
The `git_branch` module shows the active branch of the repo in your current directory.
`git_branch` 组件显示当前目录的 git 仓库的活动分支。
### 配置项
| Option | 默认值 | 描述 |
| -------------------- | -------------------------------- | ---------------------------------------------------------------------------------------- |
| `always_show_remote` | `false` | Shows the remote tracking branch name, even if it is equal to the local branch name. |
| `format` | `"on [$symbol$branch]($style) "` | 组件格式化模板。 Use `"$branch"` to refer to the current branch name. |
| `symbol` | `" "` | A format string representing the symbol of git branch. |
| `style` | `"bold purple"` | 此组件的样式。 |
| `truncation_length` | `2^63 - 1` | Truncates a git branch to `N` graphemes. |
| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. You can use `""` for no symbol. |
| `only_attached` | `false` | Only show the branch name when not in a detached `HEAD` state. |
| `disabled` | `false` | Disables the `git_branch` module. |
| Option | 默认值 | 描述 |
| -------------------- | -------------------------------- | ------------------------------------------------------------------------------------ |
| `always_show_remote` | `false` | Shows the remote tracking branch name, even if it is equal to the local branch name. |
| `format` | `"on [$symbol$branch]($style) "` | 组件格式化模板。 Use `"$branch"` to refer to the current branch name. |
| `symbol` | `" "` | A format string representing the symbol of git branch. |
| `style` | `"bold purple"` | 此组件的样式。 |
| `truncation_length` | `2^63 - 1` | Truncates a git branch to `N` graphemes. |
| `truncation_symbol` | `"…"` | 此字段的内容用来表示分支名称被截断。 You can use `""` for no symbol. |
| `only_attached` | `false` | Only show the branch name when not in a detached `HEAD` state. |
| `disabled` | `false` | 禁用 `git_branch` 组件。 |
### Variables
@@ -1197,13 +1199,13 @@ The `git_commit` module shows the current commit hash and also the tag (if any)
| Option | 默认值 | 描述 |
| -------------------- | ---------------------------------- | ------------------------------------------------------- |
| `commit_hash_length` | `7` | The length of the displayed git commit hash. |
| `commit_hash_length` | `7` | 显示的 git 提交哈希值的长度。 |
| `format` | `"[\\($hash$tag\\)]($style) "` | 组件格式化模板。 |
| `style` | `"bold green"` | 此组件的样式。 |
| `only_detached` | `true` | Only show git commit hash when in detached `HEAD` state |
| `tag_disabled` | `true` | Disables showing tag info in `git_commit` module. |
| `tag_symbol` | `" 🏷 "` | Tag symbol prefixing the info shown |
| `disabled` | `false` | Disables the `git_commit` module. |
| `disabled` | `false` | 禁用 `git_commit` 组件。 |
### Variables
@@ -1226,7 +1228,7 @@ tag_symbol = "🔖 "
## Git State
The `git_state` module will show in directories which are part of a git repository, and where there is an operation in progress, such as: _REBASING_, _BISECTING_, etc. If there is progress information (e.g., REBASING 3/10), that information will be shown too.
`git_state` 组件会显示当前目录在哪个 git 仓库中,以及正在进行的操作,例如:_REBASING__BISECTING_ 等。 进度信息(例如 REBASING 3/10)如果存在则也会被显示。
### 配置项
@@ -1241,7 +1243,7 @@ The `git_state` module will show in directories which are part of a git reposito
| `am_or_rebase` | `"AM/REBASE"` | A format string displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. |
| `style` | `"bold yellow"` | 此组件的样式。 |
| `format` | `'\([$state( $progress_current/$progress_total)]($style)\) '` | 组件格式化模板。 |
| `disabled` | `false` | Disables the `git_state` module. |
| `disabled` | `false` | 禁用 `git_state` 模块 |
### Variables
@@ -1270,7 +1272,7 @@ The `git_metrics` module will show the number of added and deleted lines in the
::: tip
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`
:::
@@ -1307,14 +1309,14 @@ format = '[+$added]($added_style)/[-$deleted]($deleted_style) '
## Git Status
The `git_status` module shows symbols representing the state of the repo in your current directory.
`git_status`组件通过相应的符号显示您当前目录中 git 仓库的状态。
### 配置项
| Option | 默认值 | 描述 |
| ------------ | ----------------------------------------------- | ----------------------------------- |
| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` |
| `conflicted` | `"="` | This branch has merge conflicts. |
| `conflicted` | `"="` | 这个分支有合并冲突。 |
| `ahead` | `"⇡"` | The format of `ahead` |
| `behind` | `"⇣"` | The format of `behind` |
| `diverged` | `"⇕"` | The format of `diverged` |
@@ -1326,7 +1328,7 @@ The `git_status` module shows symbols representing the state of the repo in your
| `renamed` | `"»"` | The format of `renamed` |
| `deleted` | `"✘"` | The format of `deleted` |
| `style` | `"bold red"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `git_status` module. |
| `disabled` | `false` | 禁用 `git_status` 组件。 |
### Variables
@@ -1356,9 +1358,9 @@ The following variables can be used in `diverged`:
The following variables can be used in `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` and `deleted`:
| 字段 | 描述 |
| ------- | ------------------------ |
| `count` | Show the number of files |
| 字段 | 描述 |
| ------- | --------- |
| `count` | 显示相应的文件数量 |
### 示例
@@ -1394,14 +1396,14 @@ behind = "⇣${count}"
The `golang` module shows the currently installed version of [Go](https://golang.org/). By default the module will be shown if any of the following conditions are met:
- The current directory contains a `go.mod` file
- The current directory contains a `go.sum` file
- The current directory contains a `glide.yaml` file
- The current directory contains a `Gopkg.yml` file
- The current directory contains a `Gopkg.lock` file
- 当前目录包含 `go.mod` 文件
- 当前目录包含 `go.sum` 文件
- 当前目录包含 `glide.yaml` 文件
- 当前目录包含 `Gopkg.yml` 文件
- 当前目录包含 `Gopkg.lock` 文件
- The current directory contains a `.go-version` file
- The current directory contains a `Godeps` directory
- The current directory contains a file with the `.go` extension
- 当前目录包含 `Godeps` 目录
- 当前目录包含一个使用 `.go` 扩展名的文件
### 配置项
@@ -1414,7 +1416,7 @@ The `golang` module shows the currently installed version of [Go](https://golang
| `detect_files` | `["go.mod", "go.sum", "glide.yaml", "Gopkg.yml", "Gopkg.lock", ".go-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `["Godeps"]` | Which folders should trigger this module. |
| `style` | `"bold cyan"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `golang` module. |
| `disabled` | `false` | 禁用 `golang` 组件。 |
### Variables
@@ -1439,7 +1441,7 @@ format = "via [🏎💨 $version](bold cyan) "
The `helm` module shows the currently installed version of [Helm](https://helm.sh/). By default the module will be shown if any of the following conditions are met:
- The current directory contains a `helmfile.yaml` file
- 当前目录包含 `helmfile.yaml` 文件
- The current directory contains a `Chart.yaml` file
### 配置项
@@ -1476,17 +1478,17 @@ format = "via [⎈ $version](bold white) "
## Hostname
The `hostname` module shows the system hostname.
`hostname` 组件显示系统主机名。
### 配置项
| Option | 默认值 | 描述 |
| ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `ssh_only` | `true` | Only show hostname when connected to an SSH session. |
| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation |
| `format` | `"[$hostname]($style) in "` | 组件格式化模板。 |
| `style` | `"bold dimmed green"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `hostname` module. |
| Option | 默认值 | 描述 |
| ---------- | --------------------------- | ------------------------------------------------------------------ |
| `ssh_only` | `true` | 仅在连接到 SSH 会话时显示主机名。 |
| `trim_at` | `"."` | 当主机名过长被截断时,会截断成第一次匹配该字符串之前的主机名。 `"."` 会让主机名截断到第一个点处。 `""` 会禁用任何截断。 |
| `format` | `"[$hostname]($style) in "` | 组件格式化模板。 |
| `style` | `"bold dimmed green"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `hostname` 组件。 |
### Variables
@@ -1527,7 +1529,7 @@ The `java` module shows the currently installed version of [Java](https://www.or
| `detect_folders` | `[]` | Which folders should trigger this modules. |
| `symbol` | `"☕ "` | A format string representing the symbol of Java |
| `style` | `"red dimmed"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `java` module. |
| `disabled` | `false` | 禁用 `java` 组件。 |
### Variables
@@ -1550,7 +1552,7 @@ symbol = "🌟 "
## Jobs
The `jobs` module shows the current number of jobs running. The module will be shown only if there are background jobs running. The module will show the number of jobs running if there are at least 2 jobs, or more than the `number_threshold` config value, if it exists. The module will show a symbol if there is at least 1 job, or more than the `symbol_threshold` config value, if it exists. You can set both values to 0 in order to *always* show the symbol and number of jobs, even if there are 0 jobs running.
`jobs` 组件显示当前正在运行的任务数量。 仅当有后台任务运行时,此组件才会显示。 The module will show the number of jobs running if there are at least 2 jobs, or more than the `number_threshold` config value, if it exists. The module will show a symbol if there is at least 1 job, or more than the `symbol_threshold` config value, if it exists. You can set both values to 0 in order to *always* show the symbol and number of jobs, even if there are 0 jobs running.
The default functionality is:
@@ -1574,13 +1576,13 @@ The `threshold` option is deprecated, but if you want to use it, the module will
| Option | 默认值 | 描述 |
| ------------------ | ----------------------------- | ------------------------------------------------------------------------ |
| `threshold`\* | `1` | Show number of jobs if exceeded. |
| `threshold`\* | `1` | 如果超过此字段的值,显示任务数量。 |
| `symbol_threshold` | `1` | Show `symbol` if the job count is at least `symbol_threshold`. |
| `number_threshold` | `2` | Show the number of jobs if the job count is at least `number_threshold`. |
| `format` | `"[$symbol$number]($style) "` | 组件格式化模板。 |
| `symbol` | `"✦"` | The string used to represent the `symbol` variable. |
| `style` | `"bold blue"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `jobs` module. |
| `disabled` | `false` | 禁用 `jobs` 组件。 |
\*: This option is deprecated, please use the
`number_threshold` and `symbol_threshold` options instead.
@@ -1699,7 +1701,7 @@ Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/co
::: tip
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`
:::
@@ -1761,13 +1763,13 @@ Long and automatically generated cluster names can be identified and shortened u
## Line Break
The `line_break` module separates the prompt into two lines.
`line_break` 组件将提示分隔为两行。
### 配置项
| Option | 默认值 | 描述 |
| ---------- | ------- | ------------------------------------------------------------------ |
| `disabled` | `false` | Disables the `line_break` module, making the prompt a single line. |
| Option | 默认值 | 描述 |
| ---------- | ------- | --------------------------- |
| `disabled` | `false` | 禁用 `line_break` 组件,使提示成为单行。 |
### 示例
@@ -1821,25 +1823,25 @@ format = "via [🌕 $version](bold blue) "
## Memory Usage
The `memory_usage` module shows current system memory and swap usage.
`memory_usage` 组件显示当前系统内存和交换区使用情况。
By default the swap usage is displayed if the total system swap is non-zero.
默认情况下,如果系统交换区使用不为 0,则会显示交换区使用情况。
::: tip
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`
:::
### 配置项
| Option | 默认值 | 描述 |
| ----------- | ----------------------------------------------- | -------------------------------------------------------- |
| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. |
| `format` | `"via $symbol [${ram}( \| ${swap})]($style) "` | 组件格式化模板。 |
| `symbol` | `"🐏"` | The symbol used before displaying the memory usage. |
| `style` | `"bold dimmed white"` | 此组件的样式。 |
| `disabled` | `true` | Disables the `memory_usage` module. |
| Option | 默认值 | 描述 |
| ----------- | ----------------------------------------------- | ---------------------- |
| `threshold` | `75` | 隐藏内存使用情况,除非它超过这个百分比。 |
| `format` | `"via $symbol [${ram}( \| ${swap})]($style) "` | 组件格式化模板。 |
| `symbol` | `"🐏"` | 这个字段的内容会显示在当前内存使用情况之前。 |
| `style` | `"bold dimmed white"` | 此组件的样式。 |
| `disabled` | `true` | 禁用 `memory_usage` 模块 |
### Variables
@@ -1868,18 +1870,18 @@ style = "bold dimmed green"
## Mercurial Branch
The `hg_branch` module shows the active branch of the repo in your current directory.
`hg_branch` 组件显示当前目录的 hg 仓库的活动分支。
### 配置项
| Option | 默认值 | 描述 |
| ------------------- | -------------------------------- | -------------------------------------------------------------------------------------------- |
| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. |
| `style` | `"bold purple"` | 此组件的样式。 |
| `format` | `"on [$symbol$branch]($style) "` | 组件格式化模板。 |
| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to `N` graphemes |
| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. |
| `disabled` | `true` | Disables the `hg_branch` module. |
| Option | 默认值 | 描述 |
| ------------------- | -------------------------------- | --------------------------------------------- |
| `symbol` | `" "` | 该字段的内容显示于当前仓库的 hg 书签或活动分支名之前。 |
| `style` | `"bold purple"` | 此组件的样式。 |
| `format` | `"on [$symbol$branch]($style) "` | 组件格式化模板。 |
| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to `N` graphemes |
| `truncation_symbol` | `"…"` | 此字段的内容用来表示分支名称被截断。 |
| `disabled` | `true` | 禁用 `hg_branch` 组件。 |
### Variables
@@ -1906,7 +1908,7 @@ truncation_symbol = ""
The `nim` module shows the currently installed version of [Nim](https://nim-lang.org/). By default the module will be shown if any of the following conditions are met:
- The current directory contains a `nim.cfg` file
- 当前目录包含 `nim.cfg` 文件
- The current directory contains a file with the `.nim` extension
- The current directory contains a file with the `.nims` extension
- The current directory contains a file with the `.nimble` extension
@@ -1946,7 +1948,7 @@ symbol = "🎣 "
## Nix-shell
The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/developing-with-nix-shell.html) environment. The module will be shown when inside a nix-shell environment.
The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/developing-with-nix-shell.html) environment. 当处于一个 nix-shell 环境中时,此组件会被显示。
### 配置项
@@ -1957,7 +1959,7 @@ The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/
| `style` | `"bold blue"` | 此组件的样式。 |
| `impure_msg` | `"impure"` | A format string shown when the shell is impure. |
| `pure_msg` | `"pure"` | A format string shown when the shell is pure. |
| `disabled` | `false` | Disables the `nix_shell` module. |
| `disabled` | `false` | 禁用 `nix_shell` 组件。 |
### Variables
@@ -1986,10 +1988,10 @@ format = 'via [☃️ $state( \($name\))](bold blue) '
The `nodejs` module shows the currently installed version of [Node.js](https://nodejs.org/). By default the module will be shown if any of the following conditions are met:
- The current directory contains a `package.json` file
- 当前目录包含 `package.json` 文件
- The current directory contains a `.node-version` file
- The current directory contains a `.nvmrc` file
- The current directory contains a `node_modules` directory
- 当前目录包含 `node_modules` 目录
- The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension
- The current directory contains a file with the `.ts` extension
@@ -2004,7 +2006,7 @@ The `nodejs` module shows the currently installed version of [Node.js](https://n
| `detect_files` | `["package.json", ".node-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `["node_modules"]` | Which folders should trigger this module. |
| `style` | `"bold green"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `nodejs` module. |
| `disabled` | `false` | 禁用 `nodejs` 组件。 |
| `not_capable_style` | `bold red` | The style for the module when an engines property in package.json does not match the Node.js version. |
### Variables
@@ -2110,7 +2112,7 @@ symbol = "☁️ "
## Package Version
The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `nimble`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix` and `helm` packages.
当前目录是软件包的代码仓库时,将显示 `package` 组件,并显示软件包当前版本。 The module currently supports `npm`, `nimble`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix`, `helm` and `shards` packages.
- [**npm**](https://docs.npmjs.com/cli/commands/npm) The `npm` package version is extracted from the `package.json` present in the current directory
- [**Cargo**](https://doc.rust-lang.org/cargo/) The `cargo` package version is extracted from the `Cargo.toml` present in the current directory
@@ -2124,6 +2126,7 @@ The `package` module is shown when the current directory is the repository for a
- [**Helm**](https://helm.sh/docs/helm/helm_package/) - The `helm` chart version is extracted from the `Chart.yaml` present
- [**Maven**](https://maven.apache.org/) - The `maven` package version is extracted from the `pom.xml` present
- [**Meson**](https://mesonbuild.com/) - The `meson` package version is extracted from the `meson.build` present
- [**Shards**](https://crystal-lang.org/reference/the_shards_command/index.html) - The `shards` package version is extracted from the `shard.yml` present
- [**V**](https://vlang.io) - The `vlang` package version is extracted from the `v.mod` present
> ⚠ 此组件显示的是源代码在当前目录中的软件包的版本,而不是包管理器的版本。
@@ -2133,11 +2136,11 @@ The `package` module is shown when the current directory is the repository for a
| Option | 默认值 | 描述 |
| ----------------- | --------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"is [$symbol$version]($style) "` | 组件格式化模板。 |
| `symbol` | `"📦 "` | The symbol used before displaying the version the package. |
| `symbol` | `"📦 "` | 这个字段的内容会显示在当前软件包版本之前。 |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `style` | `"bold 208"` | 此组件的样式。 |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | Disables the `package` module. |
| `disabled` | `false` | 禁用 `package` 组件。 |
### Variables
@@ -2202,7 +2205,7 @@ format = "via [🦪 $version]($style) "
The `php` module shows the currently installed version of [PHP](https://www.php.net/). By default the module will be shown if any of the following conditions are met:
- The current directory contains a `composer.json` file
- 当前目录包含一个 `composer.json` 文件
- The current directory contains a `.php-version` file
- The current directory contains a `.php` extension
@@ -2212,12 +2215,12 @@ The `php` module shows the currently installed version of [PHP](https://www.php.
| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | 组件格式化模板。 |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. |
| `symbol` | `"🐘 "` | 这个字段的内容会显示在当前 PHP 版本之前。 |
| `detect_extensions` | `["php"]` | Which extensions should trigger this module. |
| `detect_files` | `["composer.json", ".php-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this module. |
| `style` | `"147 bold"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `php` module. |
| `disabled` | `false` | 禁用 `php` 组件。 |
### Variables
@@ -2238,6 +2241,63 @@ The `php` module shows the currently installed version of [PHP](https://www.php.
format = "via [🔹 $version](147 bold) "
```
## Pulumi
The `pulumi` module shows the currently selected [Pulumi Stack](https://www.pulumi.com/docs/intro/concepts/stack/) and version.
::: tip
By default the Pulumi version is not shown, since it takes an order of magnitude longer to load then most plugins (~70ms). If you still want to enable it, [follow the example shown below](#with-pulumi-version).
:::
By default the module will be shown if any of the following conditions are met:
- The current directory contains either `Pulumi.yaml` or `Pulumi.yml`
- A parent directory contains either `Pulumi.yaml` or `Pulumi.yml`
### 配置项
| Option | 默认值 | 描述 |
| ---------------- | -------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol$stack]($style) "` | The format string for the module. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `" "` | A format string shown before the Pulumi stack. |
| `style` | `"bold 5"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `pulumi` module. |
### Variables
| 字段 | 示例 | 描述 |
| --------- | ---------- | ------------------------ |
| version | `v0.12.24` | The version of `pulumi` |
| stack | `dev` | The current Pulumi stack |
| symbol | | `symbol`对应值 |
| style\* | | `style`对应值 |
\*: This variable can only be used as a part of a style string
### 示例
#### With Pulumi Version
```toml
# ~/.config/starship.toml
[pulumi]
format = "[🛥 ($version )$stack]($style) "
```
#### Without Pulumi version
```toml
# ~/.config/starship.toml
[pulumi]
symbol = "🛥 "
format = "[$symbol$stack]($style) "
```
## PureScript
The `purescript` module shows the currently installed version of [PureScript](https://www.purescript.org/) version. By default the module will be shown if any of the following conditions are met:
@@ -2571,31 +2631,35 @@ The `shell` module shows an indicator for currently used shell.
::: tip
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`
:::
### 配置项
| Option | 默认值 | 描述 |
| ---------------------- | ------------ | ------------------------------------------------------------ |
| `bash_indicator` | `bsh` | A format string used to represent bash. |
| `fish_indicator` | `fsh` | A format string used to represent fish. |
| `zsh_indicator` | `zsh` | A format string used to represent zsh. |
| `powershell_indicator` | `psh` | A format string used to represent powershell. |
| `ion_indicator` | `ion` | A format string used to represent ion. |
| `elvish_indicator` | `esh` | A format string used to represent elvish. |
| `tcsh_indicator` | `tsh` | A format string used to represent tcsh. |
| `xonsh_indicator` | `xsh` | A format string used to represent xonsh. |
| `unknown_indicator` | | The default value to be displayed when the shell is unknown. |
| `format` | `$indicator` | 组件格式化模板。 |
| `disabled` | `true` | Disables the `shell` module. |
| Option | 默认值 | 描述 |
| ---------------------- | ------------------------- | ------------------------------------------------------------ |
| `bash_indicator` | `bsh` | A format string used to represent bash. |
| `fish_indicator` | `fsh` | A format string used to represent fish. |
| `zsh_indicator` | `zsh` | A format string used to represent zsh. |
| `powershell_indicator` | `psh` | A format string used to represent powershell. |
| `ion_indicator` | `ion` | A format string used to represent ion. |
| `elvish_indicator` | `esh` | A format string used to represent elvish. |
| `tcsh_indicator` | `tsh` | A format string used to represent tcsh. |
| `xonsh_indicator` | `xsh` | A format string used to represent xonsh. |
| `unknown_indicator` | | The default value to be displayed when the shell is unknown. |
| `format` | `"[$indicator]($style) "` | 组件格式化模板。 |
| `style` | `"white bold"` | 此组件的样式。 |
| `disabled` | `true` | Disables the `shell` module. |
### Variables
| 字段 | 默认值 | 描述 |
| --------- | --- | ---------------------------------------------------------- |
| indicator | | Mirrors the value of `indicator` for currently used shell. |
| style\* | | Mirrors the value of option `style`. |
\*: This variable can only be used as a part of a style string
### Examples
@@ -2606,6 +2670,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
fish_indicator = ""
powershell_indicator = "_"
unknown_indicator = "mystery shell"
style = "cyan bold"
disabled = false
```
@@ -2683,7 +2748,7 @@ The `status` module displays the exit code of the previous command. The module w
::: tip
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`
:::
@@ -2791,7 +2856,7 @@ By default the Terraform version is not shown, since this is slow for current ve
By default the module will be shown if any of the following conditions are met:
- The current directory contains a `.terraform` folder
- Current directory contains a file with the `.tf` or `.hcl` extensions
- Current directory contains a file with the `.tf`, `.tfplan` or `.tfstate` extensions
### 配置项
@@ -2800,7 +2865,7 @@ By default the module will be shown if any of the following conditions are met:
| `format` | `"via [$symbol$workspace]($style) "` | The format string for the module. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `"💠"` | A format string shown before the terraform workspace. |
| `detect_extensions` | `["tf", "hcl"]` | Which extensions should trigger this module. |
| `detect_extensions` | `["tf", "tfplan", "tfstate"]` | Which extensions should trigger this module. |
| `detect_files` | `[]` | Which filenames should trigger this module. |
| `detect_folders` | `[".terraform"]` | Which folders should trigger this module. |
| `style` | `"bold 105"` | 此组件的样式。 |
@@ -2843,7 +2908,7 @@ The `time` module shows the current **local** time. The `format` configuration v
::: tip
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`
:::
@@ -3101,11 +3166,19 @@ The order in which custom modules are shown can be individually set by including
:::
::: warning Command output is printed unescaped to the prompt
Whatever output the command generates is printed unmodified in the prompt. This means if the output contains special sequences that are interpreted by your shell they will be expanded when displayed. These special sequences are shell specific, e.g. you can write a command module that writes bash sequences, e.g. `\h`, but this module will not work in a fish or zsh shell.
Format strings can also contain shell specific prompt sequences, e.g. [Bash](https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html), [Zsh](https://zsh.sourceforge.io/Doc/Release/Prompt-Expansion.html).
:::
### 配置项
| Option | 默认值 | 描述 |
| ------------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `command` | | The command whose output should be printed. The command will be passed on stdin to the shell. |
| `command` | `""` | The command whose output should be printed. The command will be passed on stdin to the shell. |
| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. |
| `shell` | | [See below](#custom-command-shell) |
| `description` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
@@ -3164,12 +3237,12 @@ Automatic detection of shells and proper parameters addition are currently imple
[custom.foo]
command = "echo foo" # shows output of command
files = ["foo"] # can specify filters
files = ["foo"] # can specify filters but wildcards are not supported
when = """ test "$HOME" == "$PWD" """
format = " transcending [$output]($style)"
[custom.time]
command = "time /T"
files = ["*.pst"]
extensions = ["pst"] # filters *.pst files
shell = ["pwsh.exe", "-NoProfile", "-Command", "-"]
```
+32 -6
View File
@@ -56,13 +56,39 @@ If you get an error like "_version 'GLIBC_2.18' not found (required by starship)
sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --platform unknown-linux-musl
```
## Why do I see `Executing command "..." timed out.` warnings?
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout` key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
## I see symbols I don't understand or expect, what do they mean?
If you see symbols that you don't recognise you can use `starship explain` to explain the currently showing modules.
## Starship is doing something unexpected, how can I debug it?
You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module.
```sh
env STARHIP_LOG=trace starship module rust
```
If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame.
```sh
env STARHIP_LOG=trace starship timings
```
This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output.
Finally if you find a bug you can use the `bug-report` command to create a Github issue.
```sh
starship bug-report
```
## Why don't I see a glyph symbol in my prompt?
最常见的原因是系统配置有问题。 有个别Linux发行版不自带对字体的支持。 请确保:
The most common cause of this is system misconfiguration. Some Linux distros in particular do not come with font support out-of-the-box. You need to ensure that:
- Your locale is set to a UTF-8 value, like `de_DE.UTF-8` or `ja_JP.UTF-8`. If `LC_ALL` is not a UTF-8 value, [you will need to change it](https://www.tecmint.com/set-system-locales-in-linux/).
- 安装了 emoji 字体。 大部分系统都会自带 emoji 字体,但有些系统(例如 Arch Linux)则没有。 字体一般可以用系统的包管理器安装,常见的字体有 [Noto emoji](https://www.google.com/get/noto/help/emoji/) 等。
@@ -75,20 +101,20 @@ echo -e "\xf0\x9f\x90\x8d"
echo -e "\xee\x82\xa0"
```
第一行应该显示出一个[蛇的 emoji](https://emojipedia.org/snake/),第二行应该显示出 [powerline 的分支符号(e0a0)。](https://github.com/ryanoasis/powerline-extra-symbols#glyphs).
The first line should produce a [snake emoji](https://emojipedia.org/snake/), while the second should produce a [powerline branch symbol (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs).
If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose)
## 如何卸载 Starship
## How do I uninstall Starship?
Starship 的卸载过程与安装过程一样简单。
Starship is just as easy to uninstall as it is to install in the first place.
1. 将 shell 的配置文件(比如 `~/.bashrc`)中初始化 Starship 的部分全部删除。
1. 删除 Starship 的二进制文件。
如果 Starship 是用包管理器安装的,请到包管理器的文档中查找卸载的步骤。
If Starship was installed using a package manager, please refer to their docs for uninstallation instructions.
如果 Starship 是用安装脚本安装的,可以用以下命令删除二进制文件:
If Starship was installed using the install script, the following command will delete the binary:
```sh
# Locate and delete the starship binary
+2 -30
View File
@@ -181,7 +181,7 @@
#### 通过软件包管理器安装
##### Example: [Homebrew](https://brew.sh/):
##### 使用 [Homebrew](https://brew.sh/)
```sh
brew install starship
@@ -304,37 +304,9 @@ If you are fluent in a non-English language, we greatly appreciate any help keep
如果您有兴趣贡献于 Starship,请查看我们的[贡献指南](https://github.com/starship/starship/blob/master/CONTRIBUTING.md)。 另外,你可以自由加入我们的 [Discord 服务器](https://discord.gg/8Jzqu3T) 。 👋
### 代码贡献者
这个项目的存在要感谢所有贡献者。 [[贡献说明](https://github.com/starship/starship/blob/master/CONTRIBUTING.md)]
<a href="https://github.com/starship/starship/graphs/contributors"><img src="https://opencollective.com/starship/contributors.svg?width=890&button=false" /></a>
### 项目资助者
成为项目资助者,并帮助我们维持我们的社区。 [[成为项目资助者](https://opencollective.com/starship/contribute)]
#### 资助人
<a href="https://opencollective.com/starship"><img src="https://opencollective.com/starship/individuals.svg?width=890"></a>
#### 资助组织
与您的组织一起支持该项目。 您的组织的徽标将显示在此处,并带有指向您的组织的网站的链接。 [[成为项目资助者](https://opencollective.com/starship/contribute)]
<a href="https://opencollective.com/starship/organization/0/website"><img src="https://opencollective.com/starship/organization/0/avatar.svg"></a>
<a href="https://opencollective.com/starship/organization/1/website"><img src="https://opencollective.com/starship/organization/1/avatar.svg"></a>
<a href="https://opencollective.com/starship/organization/2/website"><img src="https://opencollective.com/starship/organization/2/avatar.svg"></a>
<a href="https://opencollective.com/starship/organization/3/website"><img src="https://opencollective.com/starship/organization/3/avatar.svg"></a>
<a href="https://opencollective.com/starship/organization/4/website"><img src="https://opencollective.com/starship/organization/4/avatar.svg"></a>
<a href="https://opencollective.com/starship/organization/5/website"><img src="https://opencollective.com/starship/organization/5/avatar.svg"></a>
<a href="https://opencollective.com/starship/organization/6/website"><img src="https://opencollective.com/starship/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/starship/organization/7/website"><img src="https://opencollective.com/starship/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/starship/organization/8/website"><img src="https://opencollective.com/starship/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/starship/organization/9/website"><img src="https://opencollective.com/starship/organization/9/avatar.svg"></a>
## 💭该项目受以下项目启发
请参考这些曾经为 Starship 提供启发的工程。 🙏
Please check out these previous works that helped inspire the creation of starship. 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - A ZSH prompt for astronauts.
+10
View File
@@ -35,6 +35,16 @@ pkg install getconf
sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --bin-dir /data/data/com.termux/files/usr/bin
```
## [Funtoo Linux](https://www.funtoo.org/Welcome)
### 安装
On Funtoo Linux, starship can be installed from [core-kit](https://github.com/funtoo/core-kit/tree/1.4-release/app-shells/starship) via Portage:
```sh
emerge app-shells/starship
```
## [Nix](https://nixos.wiki/wiki/Nix)
### Getting the Binary
+66
View File
@@ -202,6 +202,9 @@ format = '\[[$symbol($version)]($style)\]'
[php]
format = '\[[$symbol($version)]($style)\]'
[pulumi]
format = '\[[$symbol$stack]($style)\]'
[purescript]
format = '\[[$symbol($version)]($style)\]'
@@ -350,6 +353,9 @@ symbol = "pl "
[php]
symbol = "php "
[pulumi]
symbol = "pulumi "
[purescript]
symbol = "purs "
@@ -435,6 +441,9 @@ format = 'via [$symbol]($style)'
[php]
format = 'via [$symbol]($style)'
[pulumi]
format = 'via [$symbol$stack]($style)'
[purescript]
format = 'via [$symbol]($style)'
@@ -462,3 +471,60 @@ format = 'via [$symbol]($style)'
[zig]
format = 'via [$symbol]($style)'
```
## Pure
This preset emulates the look and behavior of [Pure](https://github.com/sindresorhus/pure).
![Screenshot of Pure preset](/presets/pure-prompt.png)
### 配置
```toml
format = """
$username\
$hostname\
$directory\
$git_branch\
$git_state\
$git_status\
$cmd_duration\
$line_break\
$python\
$character"""
[directory]
style = "blue"
[character]
success_symbol = "[](purple)"
error_symbol = "[](red)"
vicmd_symbol = "[](green)"
[git_branch]
format = "[$branch]($style)"
style = "bright-black"
[git_status]
format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style)"
style = "cyan"
conflicted = ""
untracked = ""
modified = ""
staged = ""
renamed = ""
deleted = ""
stashed = "≡"
[git_state]
format = '\([$state( $progress_current/$progress_total)]($style)\) '
style = "bright-black"
[cmd_duration]
format = "[$duration]($style) "
style = "yellow"
[python]
format = "[$virtualenv]($style) "
style = "bright-black"
```