summaryrefslogtreecommitdiffstats
path: root/docs/zh-CN/config/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/zh-CN/config/README.md')
-rw-r--r--docs/zh-CN/config/README.md962
1 files changed, 481 insertions, 481 deletions
diff --git a/docs/zh-CN/config/README.md b/docs/zh-CN/config/README.md
index c176fd9ae..d8a418f73 100644
--- a/docs/zh-CN/config/README.md
+++ b/docs/zh-CN/config/README.md
@@ -1,12 +1,12 @@
# 配置
-To get started configuring starship, create the following file: `~/.config/starship.toml`.
+您需要创建配置文件 `~/.config/starship.toml` 以供 Starship 使用。
```sh
mkdir -p ~/.config && touch ~/.config/starship.toml
```
-All configuration for starship is done in this [TOML](https://github.com/toml-lang/toml) file:
+Starship 的所有配置都在此 [TOML](https://github.com/toml-lang/toml) 配置文件中完成:
```toml
# Don't print a new line at the start of the prompt
@@ -21,7 +21,7 @@ success_symbol = "[➜](bold green)" # The "success_symbol" segment is being
disabled = true
```
-You can change default `starship.toml` file location with `STARSHIP_CONFIG` environment variable:
+你可以设置环境变量 `STARSHIP_CONFIG` 来修改 starship 查找配置文件 `starship.toml` 时查找的位置:
```sh
export STARSHIP_CONFIG=~/.starship
@@ -47,9 +47,9 @@ Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE
$ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp"
```
-### Terminology
+### 术语
-**Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of NodeJS that is currently installed on your computer, if your current directory is a NodeJS project.
+**组件(Module)**:提示符的组成部分,通过来自系统的上下文信息向用户显示各种信息。 比如“nodejs”组件会在当前目录是一个 NodeJS 项目时显示您当前安装的 NodeJS 版本。
**Variable**: Smaller sub-components that contains information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of NodeJS.
@@ -85,7 +85,7 @@ For example:
#### 样式设定
-Most modules in starship allow you to configure their display styles. This is done with an entry (usually called `style`) which is a string specifying the configuration. Here are some examples of style strings along with what they do. For details on the full syntax, consult the [advanced config guide](/advanced-config/).
+Starship 中的大多数组件允许您为其设置显示样式。 显示样式可以通过一个字符串字段(一般是 `style`)来设置。 以下的例子给出了一些样式字符串并描述了它们的效果。 样式字符串的完整语法请查阅 [高级配置指南](/advanced-config/)。
- `"fg:green bg:blue"` 在蓝色背景上显示绿色文本
- `"bg:blue fg:bright-green"` 在蓝色背景上显示亮绿色文本
@@ -94,7 +94,7 @@ Most modules in starship allow you to configure their display styles. This is do
- `"bold italic fg:purple"` 设置文本为粗体、意大利体,颜色为紫色
- `""` 显式禁用所有样式
-Note that what styling looks like will be controlled by your terminal emulator. For example, some terminal emulators will brighten the colors instead of bolding text, and some color themes use the same values for the normal and bright colors. Also, to get italic text, your terminal must support italics.
+请注意,最终的显示样式将由您的终端模拟器控制。 例如,有的终端模拟器对于“bold”属性的文本是加亮颜色而不是加粗文字,有的颜色主题对“普通”和“明亮”两种属性的颜色使用相同的颜色值。 此外,要获得意大利体文本(一般设计为斜体),您的终端必须支持意大利体显示。
#### Conditional Format Strings
@@ -138,15 +138,15 @@ format = '''
## 提示符
-This is the list of prompt-wide configuration options.
+以下是关于提示符的配置项。
### 配置项
-| Option | 默认值 | 描述 |
-| -------------- | ----------------------------- | ----------------------------------------------------- |
-| `format` | [见下文](#default-prompt-format) | Configure the format of the prompt. |
-| `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). |
-| `add_newline` | `true` | Add a new line before the start of the prompt. |
+| Option | 默认值 | 描述 |
+| -------------- | ----------------------------- | ----------------------------------- |
+| `format` | [见下文](#default-prompt-format) | Configure the format of the prompt. |
+| `scan_timeout` | `30` | Starship 扫描文件的超时时间(单位:毫秒)。 |
+| `add_newline` | `true` | 在提示符与提示信息间换行。 |
### 示例
@@ -168,7 +168,7 @@ add_newline = false
### Default Prompt Format
-The default `format` is used to define the format of the prompt, if empty or no `format` is provided. The default is as shown:
+The default `format` is used to define the format of the prompt, if empty or no `format` is provided. 默认设置如下:
```toml
format = "$all"
@@ -228,28 +228,28 @@ $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.
+`aws` 组件显示当前 AWS 主机所在区域与配置信息。 各组件基于 `AWS_REGION`,`AWS_DEFAULT_REGION` 和 `AWS_PROFILE` 环境变量与 `~/.aws/config` 文件。
When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var.
### 配置项
-| Option | 默认值 | 描述 |
-| ---------------- | ---------------------------------------------------- | -------------------------- |
-| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | The format for the module. |
-| `symbol` | `"☁️ "` | 这个字段的内容会显示在当前 AWS 配置信息之前。 |
-| `region_aliases` | | 地区缩写列表,用来显示在 AWS 主机名之后。 |
-| `style` | `"bold yellow"` | 此组件的样式。 |
-| `disabled` | `false` | 禁用 `AWS` 组件。 |
+| Option | 默认值 | 描述 |
+| ---------------- | ---------------------------------------------------- | ------------------------- |
+| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | 组件格式化模板。 |
+| `symbol` | `"☁️ "` | 这个字段的内容会显示在当前 AWS 配置信息之前。 |
+| `region_aliases` | | 地区缩写列表,用来显示在 AWS 主机名之后。 |
+| `style` | `"bold yellow"` | 此组件的样式。 |
+| `disabled` | `false` | 禁用 `AWS` 组件。 |
### Variables
-| 字段 | 示例 | 描述 |
-| --------- | ---------------- | ------------------------------------ |
-| region | `ap-northeast-1` | The current AWS region |
-| profile | `astronauts` | The current AWS profile |
-| symbol | | Mirrors the value of option `symbol` |
-| style\* | | Mirrors the value of option `style` |
+| 字段 | 示例 | 描述 |
+| --------- | ---------------- | ----------------------- |
+| region | `ap-northeast-1` | The current AWS region |
+| profile | `astronauts` | The current AWS profile |
+| symbol | | `symbol`对应值 |
+| style\* | | `style`对应值 |
\*: This variable can only be used as a part of a style string
@@ -296,28 +296,28 @@ 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% 时显示。
### 配置项
-| Option | 默认值 | 描述 |
-| -------------------- | --------------------------------- | -------------------------- |
-| `full_symbol` | `"•"` | 显示于电池充满时。 |
-| `charging_symbol` | `"⇡"` | 显示于正在充电时。 |
-| `discharging_symbol` | `"⇣"` | 显示于电池放电时。 |
-| `format` | `"[$symbol$percentage]($style) "` | The format for the module. |
-| `display` | [见下文](#battery-display) | 电量显示阈值和样式。 |
-| `disabled` | `false` | 禁用 `battery` 组件。 |
+| Option | 默认值 | 描述 |
+| -------------------- | --------------------------------- | ---------------- |
+| `full_symbol` | `"•"` | 显示于电池充满时。 |
+| `charging_symbol` | `"⇡"` | 显示于正在充电时。 |
+| `discharging_symbol` | `"⇣"` | 显示于电池放电时。 |
+| `format` | `"[$symbol$percentage]($style) "` | 组件格式化模板。 |
+| `display` | [见下文](#battery-display) | 电量显示阈值和样式。 |
+| `disabled` | `false` | 禁用 `battery` 组件。 |
<details>
-<summary>There are also options for some uncommon battery states.</summary>
+<summary>也有一些给不常见的电源状态设立的字段。</summary>
| 字段 | 描述 |
| ---------------- | ---------- |
| `unknown_symbol` | 显示于电池状态未知时 |
| `empty_symbol` | 显示于电池状态为空时 |
-Note: Battery indicator will be hidden if the status is `unknown` or `empty` unless you specify the option in the config.
+注意:如果状态为 `unknown` 或 `empty`,电池指示器将被隐藏,除非您在配置中指定相关选项。
</details>
@@ -332,9 +332,9 @@ charging_symbol = "⚡️"
discharging_symbol = "💀"
```
-### Battery Display
+### Battery 组件的显示
-The `display` configuration option is used to define when the battery indicator should be shown (threshold) and what it looks like (style). If no `display` is provided. The default is as shown:
+`display` 选项用于定义电池指示器的显示阈值(threshold)和显示效果(style)。 如果 `display` 没有设置, 默认设置如下:
```toml
[[battery.display]]
@@ -344,7 +344,7 @@ style = "bold red"
#### 配置项
-The `display` option is an array of the following table.
+`display` 字段的子字段如下:
| 字段 | 描述 |
| ----------- | ---------------- |
@@ -354,23 +354,23 @@ The `display` option is an array of the following table.
#### 示例
```toml
-[[battery.display]] # "bold red" style when capacity is between 0% and 10%
+[[battery.display]] # 当电量在 0% 到 10% 时以 "bold red" 样式显示
threshold = 10
style = "bold red"
-[[battery.display]] # "bold yellow" style when capacity is between 10% and 30%
+[[battery.display]] # 当电量在 10% 到 30% 时以 "bold yellow" 样式显示
threshold = 30
style = "bold yellow"
-# when capacity is over 30%, the battery indicator will not be displayed
+# 当电量在 30% 时以上时,电池指示器组件将不会显示出来
```
## 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 (`❯`/`✖`)
@@ -434,49 +434,49 @@ The `cmake` module shows the currently installed version of CMake if:
| Option | 默认值 | 描述 |
| ---------- | ---------------------------------- | -------------------------------------------- |
-| `format` | `"via [$symbol$version]($style) "` | The format for the module. |
+| `format` | `"via [$symbol$version]($style) "` | 组件格式化模板。 |
| `symbol` | `"🛆 "` | The symbol used before the version of cmake. |
| `style` | `"bold blue"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `cmake` module. |
### Variables
-| 字段 | 示例 | 描述 |
-| --------- | --------- | ------------------------------------ |
-| version | `v3.17.3` | The version of cmake |
-| symbol | | Mirrors the value of option `symbol` |
-| style\* | | Mirrors the value of option `style` |
+| 字段 | 示例 | 描述 |
+| --------- | --------- | -------------------- |
+| version | `v3.17.3` | The version of cmake |
+| symbol | | `symbol`对应值 |
+| style\* | | `style`对应值 |
\*: This variable can only be used as a part of a style string
## 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` | 显示此组件所需的最短执行时长(单位:毫秒)。 |
-| `show_milliseconds` | `false` | 除了秒数外在执行时长中额外显示毫秒。 |
-| `format` | `"took [$duration]($style) "` | The format for the module. |
-| `style` | `"bold yellow"` | 此组件的样式。 |
-| `disabled` | `false` | 禁用 `cmd_duration` 组件。 |
+| Option | 默认值 | 描述 |
+| ------------------- | ----------------------------- | ---------------------- |
+| `min_time` | `2_000` | 显示此组件所需的最短执行时长(单位:毫秒)。 |
+| `show_milliseconds` | `false` | 除了秒数外在执行时长中额外显示毫秒。 |
+| `format` | `"took [$duration]($style) "` | 组件格式化模板。 |
+| `style` | `"bold yellow"` | 此组件的样式。 |
+| `disabled` | `false` | 禁用 `cmd_duration` 组件。 |
### Variables
| 字段 | 示例 | 描述 |
| --------- | -------- | --------------------------------------- |
| duration | `16m40s` | The time it took to execute the command |
-| style\* | | Mirrors the value of option `style` |
+| style\* | | `style`对应值 |
\*: This variable can only be used as a part of a style string
@@ -492,11 +492,11 @@ format = "underwent [$duration](bold yellow)"
## Conda
-The `conda` module shows the current conda environment, if `$CONDA_DEFAULT_ENV` is set.
+`conda` 组件在 `$CONDA_DEFAULT_ENV` 被设置时显示当前 conda 环境。
::: 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`。
:::
@@ -507,17 +507,17 @@ This does not suppress conda's own prompt modifier, you may want to run `conda c
| `truncation_length` | `1` | 如果这个 conda 环境是通过 `conda create -p [path]` 创建的,环境路径的目录深度应该被截断到此数量。 `0` 表示不用截断。 另请参阅 [`directory`](#directory) 组件。 |
| `symbol` | `"🅒 "` | 在环境名之前显示的符号。 |
| `style` | `"bold green"` | 此组件的样式。 |
-| `format` | `"[$symbol$environment]($style) "` | The format for the module. |
+| `format` | `"[$symbol$environment]($style) "` | 组件格式化模板。 |
| `ignore_base` | `true` | Ignores `base` environment when activated. |
-| `disabled` | `false` | Disables the `conda` module. |
+| `disabled` | `false` | 禁用 `conda` 组件。 |
### Variables
-| 字段 | 示例 | 描述 |
-| ----------- | ------------ | ------------------------------------ |
-| environment | `astronauts` | The current conda environment |
-| symbol | | Mirrors the value of option `symbol` |
-| style\* | | Mirrors the value of option `style` |
+| 字段 | 示例 | 描述 |
+| ----------- | ------------ | ----------------------------- |
+| environment | `astronauts` | The current conda environment |
+| symbol | | `symbol`对应值 |
+| style\* | | `style`对应值 |
\*: This variable can only be used as a part of a style string
@@ -543,16 +543,16 @@ The `crystal` module shows the currently installed version of Crystal. 此组件
| ---------- | ---------------------------------- | --------------------------------------------------------- |
| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. |
| `style` | `"bold red"` | 此组件的样式。 |
-| `format` | `"via [$symbol$version]($style) "` | The format for the module. |
+| `format` | `"via [$symbol$version]($style) "` | 组件格式化模板。 |
| `disabled` | `false` | Disables the `crystal` module. |
### Variables
-| 字段 | 示例 | 描述 |
-| --------- | --------- | ------------------------------------ |
-| version | `v0.32.1` | The version of `crystal` |
-| symbol | | Mirrors the value of option `symbol` |
-| style\* | | Mirrors the value of option `style` |
+| 字段 | 示例 | 描述 |
+| --------- | --------- | ------------------------ |
+| version | `v0.32.1` | The version of `crystal` |
+| symbol | | `symbol`对应值 |
+| style\* | | `style`对应值 |
\*: This variable can only be used as a part of a style string
@@ -577,18 +577,18 @@ The `dart` module shows the currently installed version of Dart. 此组件将在
| 字段 | 默认值 | 描述 |
| ---------- | ---------------------------------- | ----------------------------------------------- |
-| `format` | `"via [$symbol$version]($style) "` | The format for the module. |
+| `format` | `"via [$symbol$version]($style) "` | 组件格式化模板。 |
| `symbol` | `"🎯 "` | A format string representing the symbol of Dart |
| `style` | `"bold blue"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `dart` module. |
### Variables
-| 字段 | 示例 | 描述 |
-| --------- | -------- | ------------------------------------ |
-| version | `v2.8.4` | The version of `dart` |
-| symbol | | Mirrors the value of option `symbol` |
-| style\* | | Mirrors the value of option `style` |
+| 字段 | 示例 | 描述 |
+| --------- | -------- | --------------------- |
+| version | `v2.8.4` | The version of `dart` |
+| symbol | | `symbol`对应值 |
+| style\* | | `style`对应值 |
\*: This variable can only be used as a part of a style string
@@ -603,32 +603,32 @@ format = "via [🔰 $version](bold red) "
## 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`。
### 配置项
-| 字段 | 默认值 | 描述 |
-| ------------------------ | ----------------------------------------------- | -------------------------------------------------------------------------------- |
-| `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)[$lock_symbol]($lock_style) "` | The format for the module. |
-| `style` | `"bold cyan"` | 此组件的样式。 |
-| `disabled` | `false` | Disables the `directory` module. |
-| `read_only_symbol` | `"🔒"` | The symbol indicating current directory is read only. |
-| `read_only_symbol_style` | `"red"` | The style for the read only symbol. |
+| 字段 | 默认值 | 描述 |
+| ------------------- | -------------------------------------------------- | ----------------------------------------------------- |
+| `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. |
<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. |
-| `use_logical_path` | `true` | Displays the logical path provided by the shell (`PWD`) instead of the path from the OS. |
+| Advanced Option | 默认值 | 描述 |
+| --------------------------- | ------ | ------------------------------------------------ |
+| `substitutions` | | A table of substitutions to be made to the path. |
+| `fish_style_pwd_dir_length` | `0` | 使用 fish shell 当前目录路径逻辑时每个省略目录名使用的字符数。 |
+| `use_logical_path` | `true` | 显示由 shell 提供的逻辑路径(`PWD`)而不是 OS 提供的路径。 |
`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.
@@ -644,10 +644,10 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
### Variables
-| 字段 | 示例 | 描述 |
-| --------- | --------------------- | ----------------------------------- |
-| path | `"D:/Projects"` | The current directory path |
-| style\* | `"black bold dimmed"` | Mirrors the value of option `style` |
+| 字段 | 示例 | 描述 |
+| --------- | --------------------- | -------------------------- |
+| path | `"D:/Projects"` | The current directory path |
+| style\* | `"black bold dimmed"` | `style`对应值 |
\*: This variable can only be used as a part of a style string
@@ -668,7 +668,7 @@ The `docker_context` module shows the currently active [Docker context](https://
| Option | 默认值 | 描述 |
| ----------------- | ---------------------------------- | --------------------------------------------------------------------------------------- |
-| `format` | `"via [$symbol$context]($style) "` | The format for the module. |
+| `format` | `"via [$symbol$context]($style) "` | 组件格式化模板。 |
| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context. |
| `style` | `"blue bold"` | 此组件的样式。 |
| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. |
@@ -676,11 +676,11 @@ The `docker_context` module shows the currently active [Docker context](https://
### Variables
-| 字段 | 示例 | 描述 |
-| --------- | -------------- | ------------------------------------ |
-| context | `test_context` | The current docker context |
-| symbol | | Mirrors the value of option `symbol` |
-| style\* | | Mirrors the value of option `style` |
+| 字段 | 示例 | 描述 |
+| --------- | -------------- | -------------------------- |
+| context | `test_context` | The current docker context |
+| symbol | | `symbol`对应值 |
+| style\* | | `style`对应值 |
\*: This variable can only be used as a part of a style string
@@ -695,7 +695,7 @@ format = "via [🐋 $context](blue bold)"
## Dotnet
-The `dotnet` module shows the relevant version of the .NET Core SDK 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.
+`dotnet` 模块显示与当前目录下使用的 .NET Core SDK 相关联的版本。 如果当前目录已被绑定了一个版本的 SDK,则显示被帮定的版本。 否则此组件将显示最新安装的 SDK 版本。
This module will only be shown in your prompt when one or more of the following files are present in the current directory:
@@ -711,19 +711,19 @@ This module will only be shown in your prompt when one or more of the following
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.
### 配置项
-| Option | 默认值 | 描述 |
-| ----------- | ---------------------------------------- | -------------------------------------------------------- |
-| `format` | `"v[$symbol$version( 🎯 $tfm)]($style) "` | The format for the module. |
-| `symbol` | `"•NET "` | The symbol used before displaying the version of dotnet. |
-| `heuristic` | `true` | Use faster version detection to keep starship snappy. |
-| `style` | `"bold blue"` | 此组件的样式。 |
-| `disabled` | `false` | Disables the `dotnet` module. |
+| Option | 默认值 | 描述 |
+| ----------- | ---------------------------------------- | ------------------------------ |
+| `format` | `"v[$symbol$version( 🎯 $tfm)]($style) "` | 组件格式化模板。 |
+| `symbol` | `"•NET "` | 这个字段的内容会显示在当前 .NET 版本之前。 |
+| `heuristic` | `true` | 使用更快的版本探测机制以保证 starship 的运行速度。 |
+| `style` | `"bold blue"` | 此组件的样式。 |
+| `disabled` | `false` | 禁用 `dotnet` 组件。 |
### Variables
@@ -731,8 +731,8 @@ The module will also show the Target Framework Moniker (<https://docs.microsoft.
| --------- | ---------------- | ------------------------------------------------------------------ |
| version | `v3.1.201` | The version of `dotnet` sdk |
| tfm | `netstandard2.0` | The Target Framework Moniker that the current project is targeting |
-| symbol | | Mirrors the value of option `symbol` |
-| style\* | | Mirrors the value of option `style` |
+| symbol | | `symbol`对应值 |
+| style\* | | `style`对应值 |
\*: This variable can only be used as a part of a style string
@@ -751,7 +751,7 @@ heuristic = false
The `elixir` module shows the currently installed version of Elixir and Erlang/OTP. 此组件将在符合以下任意条件之一时显示:
-- The current directory contains a `mix.exs` file.
+- 当前目录包含一个 `mix.exs` 文件.
### 配置项
@@ -764,12 +764,12 @@ The `elixir` module shows the currently installed version of Elixir and Erlang/O
### Variables
-| 字段 | 示例 | 描述 |
-| ----------- | ------- | ------------------------------------ |
-| version | `v1.10` | The version of `elixir` |
-| otp_version | | The otp version of `elixir` |
-| symbol | | Mirrors the value of option `symbol` |
-| style\* | | Mirrors the value of option `style` |
+| 字段 | 示例 | 描述 |
+| ----------- | ------- | --------------------------- |
+| version | `v1.10` | The version of `elixir` |
+| otp_version | | The otp version of `elixir` |
+| symbol | | `symbol`对应值 |
+| style\* | | `style`对应值 |
\*: This variable can only be used as a part of a style string
@@ -786,8 +786,8 @@ symbol = "🔮 "
The `elm` module shows the currently installed version of Elm. 此组件将在符合以下任意条件之一时显示:
-- 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
@@ -796,18 +796,18 @@ The `elm` module shows the currently installed version of Elm. 此组件将在
| Option | 默认值 | 描述 |
| ---------- | ---------------------------------- | ----------------------------------------------- |
-| `format` | `"via [$symbol$version]($style) "` | The format for the module. |
+| `format` | `"via [$symbol$version]($style) "` | 组件格式化模板。 |
| `symbol` | `"🌳 "` | A format string representing the symbol of Elm. |
| `style` | `"cyan bold"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `elm` module. |
### Variables
-| 字段 | 示例 | 描述 |
-| --------- | --------- | ------------------------------------ |
-| version | `v0.19.1` | The version of `elm` |
-| symbol | | Mirrors the value of option `symbol` |
-| style\* | | Mirrors the value of option `style` |
+| 字段 | 示例 | 描述 |
+| --------- | --------- | -------------------- |
+| version | `v0.19.1` | The version of `elm` |
+| symbol | | `symbol`对应值 |
+| style\* | | `style`对应值 |
\*: This variable can only be used as a part of a style string
@@ -822,28 +822,28 @@ format = "via [ $version](cyan bold) "
## Environment Variable
-The `env_var` module displays the current value of a selected environment variable. The module will be shown only if any of the following conditions are met:
+`env_var` 组件显示选定的环境变量的当前值。 此组件只有满足以下条件之一时才会被显示:
-- 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`
### 配置项
-| 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) "` | The format for the module. |
-| `disabled` | `false` | Disables the `env_var` module. |
+| Option | 默认值 | 描述 |
+| ---------- | ------------------------------ | ------------------- |
+| `symbol` | | 这个字段的内容会显示在环境变量值之前。 |
+| `variable` | | 要显示的环境变量。 |
+| `default` | | 所选变量未定义时显示的默认值。 |
+| `format` | `"with [$env_value]($style) "` | 组件格式化模板。 |
+| `disabled` | `false` | 禁用 `env_var` 组件。 |
### Variables
| 字段 | 示例 | 描述 |
| --------- | ------------------------------------------- | ------------------------------------------ |
| env_value | `Windows NT` (if _variable_ would be `$OS`) | The environment value of option `variable` |
-| symbol | | Mirrors the value of option `symbol` |
-| style\* | `black bold dimmed` | Mirrors the value of option `style` |
+| symbol | | `symbol`对应值 |
+| style\* | `black bold dimmed` | `style`对应值 |
\*: This variable can only be used as a part of a style string
@@ -861,8 +861,8 @@ default = "unknown shell"
The `erlang` module shows the currently installed version of Erlang/OTP. 此组件将在符合以下任意条件之一时显示:
-- The current directory contains a `rebar.config` file.
-- The current directory contains a `erlang.mk` file.
+- 当前目录包含一个 `rebar.config` 文件.
+- 当前目录包含一个 `erlang.mk` 文件.
### 配置项
@@ -870,16 +870,16 @@ The `erlang` module shows the currently installed version of Erlang/OTP. 此组
| ---------- | ---------------------------------- | -------------------------------------------------------- |
| `symbol` | `"🖧 "` | The symbol used before displaying the version of erlang. |
| `style` | `"bold red"` | 此组件的样式。 |
-| `format` | `"via [$symbol$version]($style) "` | The format for the module. |
+| `format` | `"via [$symbol$version]($style) "` | 组件格式化模板。 |
| `disabled` | `false` | Disables the `erlang` module. |
### Variables
-| 字段 | 示例 | 描述 |
-| --------- | --------- | ------------------------------------ |
-| version | `v22.1.3` | The version of `erlang` |
-| symbol | | Mirrors the value of opti