summaryrefslogtreecommitdiffstats
path: root/docs/zh-CN
diff options
context:
space:
mode:
authorMatan Kushner <hello@matchai.dev>2021-11-07 18:07:39 +0000
committerGitHub <noreply@github.com>2021-11-07 19:07:39 +0100
commit7526e20eb4ac327e988b3c7f8164c7974bc0d191 (patch)
tree8db305fbb02b30096c42bff623d6fd88239e9eda /docs/zh-CN
parentb3fe17caf45947ef29d83f1f6c71ef844ac9172b (diff)
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)
Diffstat (limited to 'docs/zh-CN')
-rw-r--r--docs/zh-CN/advanced-config/README.md37
-rw-r--r--docs/zh-CN/config/README.md423
-rw-r--r--docs/zh-CN/faq/README.md38
-rw-r--r--docs/zh-CN/guide/README.md32
-rw-r--r--docs/zh-CN/installing/README.md10
-rw-r--r--docs/zh-CN/presets/README.md66
6 files changed, 388 insertions, 218 deletions
diff --git a/docs/zh-CN/advanced-config/README.md b/docs/zh-CN/advanced-config/README.md
index 65fc5ff41..08ee734c9 100644
--- a/docs/zh-CN/advanced-config/README.md
+++ b/docs/zh-CN/advanced-config/README.md
@@ -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`.
diff --git a/docs/zh-CN/config/README.md b/docs/zh-CN/config/README.md
index 68e7e2696..9db6a26a8 100644
--- a/docs/zh-CN/config/README.md
+++ b/docs/zh-CN/config/README.md
@@ -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`