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.md438
1 files changed, 222 insertions, 216 deletions
diff --git a/docs/zh-CN/config/README.md b/docs/zh-CN/config/README.md
index c2c21a262..7d7ffb9a7 100644
--- a/docs/zh-CN/config/README.md
+++ b/docs/zh-CN/config/README.md
@@ -303,16 +303,16 @@ symbol = "🅰 "
### 配置项
-| Option | 默认值 | 描述 |
-| -------------------- | --------------------------------- | --------------------------------------------------- |
-| `full_symbol` | `""` | 显示于电池充满时。 |
-| `charging_symbol` | `""` | 显示于正在充电时。 |
-| `discharging_symbol` | `""` | 显示于电池放电时。 |
-| `unknown_symbol` | `""` | The symbol shown when the battery state is unknown. |
-| `empty_symbol` | `""` | The symbol shown when the battery state is empty. |
-| `format` | `"[$symbol$percentage]($style) "` | 组件格式化模板。 |
-| `display` | [见下文](#battery-display) | Display threshold and style for the module. |
-| `disabled` | `false` | Disables the `battery` module. |
+| Option | 默认值 | 描述 |
+| -------------------- | --------------------------------- | ---------------- |
+| `full_symbol` | `""` | 显示于电池充满时。 |
+| `charging_symbol` | `""` | 显示于正在充电时。 |
+| `discharging_symbol` | `""` | 显示于电池放电时。 |
+| `unknown_symbol` | `""` | 显示于电池状态未知时 |
+| `empty_symbol` | `""` | 显示于电池状态为空时 |
+| `format` | `"[$symbol$percentage]($style) "` | 组件格式化模板。 |
+| `display` | [见下文](#battery-display) | 电量显示阈值和样式。 |
+| `disabled` | `false` | 禁用 `battery` 组件。 |
### 示例
@@ -328,7 +328,7 @@ discharging_symbol = "💀"
### 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. 默认设置如下:
+`display` 选项用于定义电池指示器的显示阈值(threshold)和显示效果(style)。 如果 `display` 没有设置, 默认设置如下:
```toml
[[battery.display]]
@@ -338,12 +338,12 @@ style = "bold red"
#### 配置项
-The `display` option is an array of the following table.
+`display` 字段的子字段如下:
-| Option | 描述 |
-| ----------- | ----------------------------------------------- |
-| `threshold` | The upper bound for the display option. |
-| `style` | The style used if the display option is in use. |
+| Option | 描述 |
+| ----------- | ---------------- |
+| `threshold` | 当前显示设置的电量上限(见示例) |
+| `style` | 若组件被显示,则使用此样式 |
#### 示例
@@ -362,9 +362,9 @@ style = "bold yellow"
## 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 (`❯`/`✖`)
@@ -379,7 +379,7 @@ By default it only changes color. If you also want to change it's shape take a l
| `success_symbol` | `"[❯](bold green)"` | The format string used before the text input if the previous command succeeded. |
| `error_symbol` | `"[❯](bold red)"` | The format string used before the text input if the previous command failed. |
| `vicmd_symbol` | `"[❮](bold green)"` | The format string used before the text input if the shell is in vim normal mode. |
-| `disabled` | `false` | Disables the `character` module. |
+| `disabled` | `false` | 禁用 `character` 组件。 |
### Variables
@@ -446,27 +446,27 @@ The `cmake` module shows the currently installed version of CMake if any of the
## 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
@@ -495,24 +495,24 @@ 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`。
:::
### 配置项
-| 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
@@ -606,33 +606,33 @@ 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`。
### 配置项
-| 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: "…/" |
+| 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: "…/" |
<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.
@@ -700,7 +700,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:
@@ -716,19 +716,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` | `"[$symbol$version( 🎯 $tfm)]($style) "` | 组件格式化模板。 |
-| `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` | `"[$symbol$version( 🎯 $tfm)]($style) "` | 组件格式化模板。 |
+| `symbol` | `"•NET "` | 这个字段的内容会显示在当前 .NET 版本之前。 |
+| `heuristic` | `true` | 使用更快的版本探测机制以保证 starship 的运行速度。 |
+| `style` | `"bold blue"` | 此组件的样式。 |
+| `disabled` | `false` | 禁用 `dotnet` 组件。 |
### Variables
@@ -827,20 +827,20 @@ 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` 组件显示选定的环境变量的当前值。 此组件只有满足以下条件之一时才会被显示:
- 设置的 `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) "` | 组件格式化模板。 |
-| `disabled` | `false` | Disables the `env_var` module. |
+| Option | 默认值 | 描述 |
+| ---------- | ------------------------------ | ------------------- |
+| `symbol` | | 这个字段的内容会显示在环境变量值之前。 |
+| `variable` | | 要显示的环境变量。 |
+| `default` | | 所选变量未定义时显示的默认值。 |
+| `format` | `"with [$env_value]($style) "` | 组件格式化模板。 |
+| `disabled` | `false` | 禁用 `env_var` 组件。 |
### Variables
@@ -959,20 +959,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 X 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 X 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
@@ -1005,13 +1005,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\\)]($style) [\\($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
@@ -1034,7 +1034,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)如果存在则也会被显示。
### 配置项
@@ -1049,7 +1049,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
@@ -1074,14 +1074,14 @@ cherry_pick = "[🍒 PICKING](bold red)"
## 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` |
@@ -1092,7 +1092,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
@@ -1122,9 +1122,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` | 显示相应的文件数量 |
### 示例
@@ -1157,7 +1157,7 @@ behind = "⇣${count}"
## Golang
-The `golang` module shows the currently installed version of Golang. 此组件将在符合以下任意条件之一时显示:
+`golang` 组件显示当前安装的 Golang 版本。 此组件将在符合以下任意条件之一时显示:
- 当前目录包含 `go.mod` 文件
- 当前目录包含 `go.sum` 文件
@@ -1175,7 +1175,7 @@ The `golang` module shows the currently installed version of Golang. 此组件
| `format` | `"via [$symbol$version]($style) "` | 组件格式化模板。 |
| `symbol` | `"🐹 "` | A format string representing the symbol of Go. |
| `style` | `"bold cyan"` | 此组件的样式。 |
-| `disabled` | `false` | Disables the `golang` module. |
+| `disabled` | `false` | 禁用 `golang` 组件。 |
### Variables
@@ -1233,17 +1233,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
@@ -1268,7 +1268,7 @@ disabled = false
## Java
-The `java` module shows the currently installed version of Java. 此组件将在符合以下任意条件之一时显示:
+`java` 组件显示当前安装的 Java 版本。 此组件将在符合以下任意条件之一时显示:
- The current directory contains a `pom.xml`, `build.gradle.kts`, `build.sbt`, `.java-version`, `.deps.edn`, `project.clj`, or `build.boot` file
- The current directory contains a file with the `.java`, `.class`, `.gradle`, `.jar`, `.clj`, or `.cljc` extension
@@ -1280,7 +1280,7 @@ The `java` module shows the currently installed version of Java. 此组件将在
| `format` | `"via [${symbol}${version}]($style) "` | 组件格式化模板。 |
| `symbol` | `"☕ "` | A format string representing the symbol of Java |
| `style` | `"red dimmed"` | 此组件的样式。 |
-| `disabled` | `false` | Disables the `java` module. |
+| `disabled` | `false` | 禁用 `java` 组件。 |
### Variables
@@ -1303,17 +1303,17 @@ 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 is more than 1 job, or more than the `threshold` config value, if it exists.
+`jobs` 组件显示当前正在运行的任务数量。 仅当有后台任务运行时,此组件才会显示。 如果有超过 1 个作业,模块将显示正在运行的作业数量,如果配置了 `threshold` 字段,则使用它作为显示作业数量的下限。
### 配置项
| Option | 默认值 | 描述 |
| ----------- | ----------------------------- | ------------------------------------------------ |
-| `threshold` | `1` | Show number of jobs if exceeded. |
+| `threshold` | `1` | 如果超过此字段的值,显示任务数量。 |
| `format` | `"[$symbol$number]($style) "` | 组件格式化模板。 |
| `symbol` | `"✦"` | A format string representing the number of jobs. |
| `style` | `"bold blue"` | 此组件的样式。 |
-| `disabled` | `false` | Disables the `jobs` module. |
+| `disabled` | `false` | 禁用 `jobs` 组件。 |
### Variables
@@ -1420,7 +1420,7 @@ Displays the current Kubernetes context name and, if set, the namespace from the
::: tip
-This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
+此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`。
:::
@@ -1459,13 +1459,13 @@ disabled = false
## 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` 组件,使提示成为单行。 |
### 示例
@@ -1515,25 +1515,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
@@ -1562,18 +1562,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 X 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` | 将显示的 hg 分支名截断到该数量的字素(graphemes) |
+| `truncation_symbol` | `"…"` | 此字段的内容用来表示分支名称被截断。 |
+| `disabled` | `true` | 禁用 `hg_branch` 组件。 |
### Variables
@@ -1636,7 +1636,7 @@ symbol = "🎣 "
## Nix-shell
-The `nix_shell` module shows the nix-shell environment. The module will be shown when inside a nix-shell environment.
+`nix_shell` 组件显示 nix-shell 环境。 当处于一个 nix-shell 环境中时,此组件会被显示。
### 配置项