diff options
Diffstat (limited to 'docs/zh-CN')
-rw-r--r-- | docs/zh-CN/README.md | 2 | ||||
-rw-r--r-- | docs/zh-CN/advanced-config/README.md | 2 | ||||
-rw-r--r-- | docs/zh-CN/config/README.md | 940 | ||||
-rw-r--r-- | docs/zh-CN/faq/README.md | 24 | ||||
-rw-r--r-- | docs/zh-CN/installing/README.md | 16 |
5 files changed, 505 insertions, 479 deletions
diff --git a/docs/zh-CN/README.md b/docs/zh-CN/README.md index cb069b635..a34dbcf27 100644 --- a/docs/zh-CN/README.md +++ b/docs/zh-CN/README.md @@ -32,7 +32,7 @@ description: Starship is the minimal, blazing fast, and extremely customizable p - A [Nerd Font](https://www.nerdfonts.com/) installed and enabled in your terminal. -### Quick Install +### 快速安装 1. 安装 **starship** 二进制文件: diff --git a/docs/zh-CN/advanced-config/README.md b/docs/zh-CN/advanced-config/README.md index 0d17d1c3c..e9ad05392 100644 --- a/docs/zh-CN/advanced-config/README.md +++ b/docs/zh-CN/advanced-config/README.md @@ -81,7 +81,7 @@ starship_precmd_user_func="set_win_title" - `<color>` - `none` -`<color>` 是颜色说明符(下面解释)。 `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter. +`<color>` 是颜色说明符(下面解释)。 `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. 字符串中的单词顺序不影响显示结果。 The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. 未来可能会将 `none` 与其它标识符一起使用视为一种错误。 diff --git a/docs/zh-CN/config/README.md b/docs/zh-CN/config/README.md index 823977525..954962c06 100644 --- a/docs/zh-CN/config/README.md +++ b/docs/zh-CN/config/README.md @@ -3,7 +3,7 @@ 您需要创建配置文件 `~/.config/starship.toml` 以供 Starship 使用。 ```sh -mkdir -p ~/.config && starship print-config --default > ~/.config/starship.toml +mkdir -p ~/.config && touch ~/.config/starship.toml ``` Starship 的所有配置都在此 [TOML](https://github.com/toml-lang/toml) 配置文件中完成: @@ -49,9 +49,9 @@ $ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" ### 术语 -**组件(Module)**:提示符的组成部分,通过来自系统的上下文信息向用户显示各种信息。 比如“nodejs”组件会在当前目录是一个 NodeJS 项目时显示您当前安装的 NodeJS 版本。 +**组件(Module)**:提示符的组成部分,通过来自系统的上下文信息向用户显示各种信息。 For example, the "nodejs" module shows the version of Node.js that is currently installed on your computer, if your current directory is a Node.js project. -**Variable**: Smaller sub-components that contain information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of NodeJS. +**Variable**: Smaller sub-components that contain information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of Node.js. By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. @@ -310,7 +310,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% 时显示。 ### 配置项 @@ -338,7 +338,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]] @@ -350,12 +350,12 @@ 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 | 默认值 | 描述 | | -------------------- | ---------- | --------------------------------------------------------------------------------------------------------- | -| `threshold` | `10` | The upper bound for the display option. | -| `style` | `bold red` | The style used if the display option is in use. | +| `threshold` | `10` | 当前显示设置的电量上限(见示例) | +| `style` | `bold red` | 若组件被显示,则使用此样式 | | `charging_symbol` | `-` | Optional symbol displayed if display option is in use, defaults to battery's `charging_symbol` option. | | `discharging_symbol` | `-` | Optional symbol displayed if display option is in use, defaults to battery's `discharging_symbol` option. | @@ -377,14 +377,14 @@ 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 (`❯`/`✖`) -By default it only changes color. If you also want to change it's shape take a look at [this example](#with-custom-error-shape). +By default it only changes color. If you also want to change its shape take a look at [this example](#with-custom-error-shape). ::: warning `error_symbol` is not supported on elvish shell. ::: @@ -437,22 +437,23 @@ vicmd_symbol = "[V](bold green) " ## CMake -The `cmake` module shows the currently installed version of CMake. By default the module will be activated if any of the following conditions are met: +The `cmake` module shows the currently installed version of [CMake](https://cmake.org/). By default the module will be activated if any of the following conditions are met: - The current directory contains a `CMakeLists.txt` file - The current directory contains a `CMakeCache.txt` file ### 配置项 -| Option | 默认值 | 描述 | -| ------------------- | -------------------------------------- | -------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | 组件格式化模板。 | -| `symbol` | `"△ "` | The symbol used before the version of cmake. | -| `detect_extensions` | `[]` | Which extensions should trigger this module | -| `detect_files` | `["CMakeLists.txt", "CMakeCache.txt"]` | Which filenames should trigger this module | -| `detect_folders` | `[]` | Which folders should trigger this module | -| `style` | `"bold blue"` | 此组件的样式。 | -| `disabled` | `false` | Disables the `cmake` module. | +| Option | 默认值 | 描述 | +| ------------------- | -------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | 组件格式化模板。 | +| `version_format` | `v{raw}` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"△ "` | The symbol used before the version of cmake. | +| `detect_extensions` | `[]` | Which extensions should trigger this module | +| `detect_files` | `["CMakeLists.txt", "CMakeCache.txt"]` | Which filenames should trigger this module | +| `detect_folders` | `[]` | Which folders should trigger this module | +| `style` | `"bold blue"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `cmake` module. | ### Variables @@ -466,15 +467,15 @@ The `cmake` module shows the currently installed version of CMake. By default th ## 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` 两个列表,就可以照常运行了。 ### 配置项 @@ -515,11 +516,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`。 ::: @@ -555,22 +556,23 @@ format = "[$symbol$environment](dimmed green) " ## Crystal -The `crystal` module shows the currently installed version of Crystal. By default the module will be shown if any of the following conditions are met: +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: - 当前目录包含一个 `shard.yml` 文件 - The current directory contains a `.cr` file ### 配置项 -| Option | 默认值 | 描述 | -| ------------------- | ------------------------------------ | --------------------------------------------------------- | -| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. | -| `style` | `"bold red"` | 此组件的样式。 | -| `detect_extensions` | `["cr"]` | Which extensions should trigger this module. | -| `detect_files` | `["shard.yml"]` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this module. | -| `format` | `"via [$symbol($version )]($style)"` | 组件格式化模板。 | -| `disabled` | `false` | Disables the `crystal` module. | +| Option | 默认值 | 描述 | +| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- | +| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. | +| `format` | `"via [$symbol($version )]($style)"` | 组件格式化模板。 | +| `version_format` | `v{raw}` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `style` | `"bold red"` | 此组件的样式。 | +| `detect_extensions` | `["cr"]` | Which extensions should trigger this module. | +| `detect_files` | `["shard.yml"]` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this module. | +| `disabled` | `false` | Disables the `crystal` module. | ### Variables @@ -593,7 +595,7 @@ format = "via [✨ $version](bold blue) " ## Dart -The `dart` module shows the currently installed version of Dart. By default the module will be shown if any of the following conditions are met: +The `dart` module shows the currently installed version of [Dart](https://dart.dev/). By default the module will be shown if any of the following conditions are met: - The current directory contains a file with `.dart` extension - The current directory contains a `.dart_tool` directory @@ -601,15 +603,16 @@ The `dart` module shows the currently installed version of Dart. By default the ### 配置项 -| Option | 默认值 | 描述 | -| ------------------- | ------------------------------------------------- | ----------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | 组件格式化模板。 | -| `symbol` | `"🎯 "` | A format string representing the symbol of Dart | -| `detect_extensions` | `['dart']` | Which extensions should trigger this module. | -| `detect_files` | `["pubspec.yaml", "pubspec.yml", "pubspec.lock"]` | Which filenames should trigger this module. | -| `detect_folders` | `[".dart_tool"]` | Which folders should trigger this module. | -| `style` | `"bold blue"` | 此组件的样式。 | -| `disabled` | `false` | Disables the `dart` module. | +| Option | 默认值 | 描述 | +| ------------------- | ------------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | 组件格式化模板。 | +| `version_format` | `v{raw}` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🎯 "` | A format string representing the symbol of Dart | +| `detect_extensions` | `["dart"]` | Which extensions should trigger this module. | +| `detect_files` | `["pubspec.yaml", "pubspec.yml", "pubspec.lock"]` | Which filenames should trigger this module. | +| `detect_folders` | `[".dart_tool"]` | Which folders should trigger this module. | +| `style` | `"bold blue"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `dart` module. | ### Variables @@ -632,20 +635,21 @@ format = "via [🔰 $version](bold red) " ## Deno -The `deno` module shows you your currently installed version of Deno. By default the module will be shown if any of the following conditions are met: +The `deno` module shows you your currently installed version of [Deno](https://deno.land/). By default the module will be shown if any of the following conditions are met: - The current directory contains a `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### 配置项 -| Option | 默认值 | 描述 | -| ------------------- | -------------------------------------------- | ----------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | 组件格式化模板。 | -| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | -| `detect_extensions` | `[]` | Which extensions should trigger this module. | -| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this module. | -| `style` | `"green bold"` | 此组件的样式。 | -| `disabled` | `false` | Disables the `deno` module. | +| Option | 默认值 | 描述 | +| ------------------- | -------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | 组件格式化模板。 | +| `version_format` | `v{raw}` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | +| `detect_extensions` | `[]` | Which extensions should trigger this module. | +| `detect_files` | `["mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this module. | +| `style` | `"green bold"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `deno` module. | ### Variables @@ -666,33 +670,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. @@ -764,7 +768,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. +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: @@ -780,22 +784,23 @@ 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. ### 配置项 -| 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. | -| `detect_extensions` | `["sln", "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. | +| Option | 默认值 | 描述 | +| ------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"[$symbol($version )(🎯 $tfm )]($style)"` | 组件格式化模板。 | +| `version_format` | `v{raw}` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `".NET "` | 这个字段的内容会显示在当前 .NET 版本之前。 | +| `heuristic` | `true` | 使用更快的版本探测机制以保证 starship 的运行速度。 | +| `detect_extensions` | `["sln", "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` | 禁用 `dotnet` 组件。 | ### Variables @@ -821,21 +826,22 @@ heuristic = false ## Elixir -The `elixir` module shows the currently installed version of Elixir and Erlang/OTP. By default the module will be shown if any of the following conditions are met: +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` 文件. ### 配置项 -| Option | 默认值 | 描述 | -| ------------------- | ----------------------------------------------------------- | --------------------------------------------------------------- | -| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. | -| `detect_extensions` | `[]` | Which extensions should trigger this module. | -| `detect_files` | `["mix.exs"]` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this modules. | -| `style` | `"bold purple"` | 此组件的样式。 | -| `format` | `'via [$symbol($version \(OTP $otp_version\) )]($style)'` | The format for the module elixir. | -| `disabled` | `false` | Disables the `elixir` module. | +| Option | 默认值 | 描述 | +| ------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `'via [$symbol($version \(OTP $otp_version\) )]($style)'` | The format for the module elixir. | +| `version_format` | `v{raw}` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. | +| `detect_extensions` | `[]` | Which extensions should trigger this module. | +| `detect_files` | `["mix.exs"]` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this modules. | +| `style` | `"bold purple"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `elixir` module. | ### Variables @@ -859,25 +865,26 @@ symbol = "🔮 " ## Elm -The `elm` module shows the currently installed version of Elm. By default the module will be shown if any of the following conditions are met: +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 ### 配置项 -| Option | 默认值 | 描述 | -| ------------------- | -------------------------------------------------- | ----------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | 组件格式化模板。 | -| `symbol` | `"🌳 "` | A format string representing the symbol of Elm. | -| `detect_extensions` | `["elm"]` | Which extensions should trigger this module. | -| `detect_files` | `["elm.json", "elm-package.json", ".elm-version"]` | Which filenames should trigger this module. | -| `detect_folders` | `["elm-stuff"]` | Which folders should trigger this modules. | -| `style` | `"cyan bold"` | 此组件的样式。 | -| `disabled` | `false` | Disables the `elm` module. | +| Option | 默认值 | 描述 | +| ------------------- | -------------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | 组件格式化模板。 | +| `version_format` | `v{raw}` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🌳 "` | A format string representing the symbol of Elm. | +| `detect_extensions` | `["elm"]` | Which extensions should trigger this module. | +| `detect_files` | `["elm.json", "elm-package.json", ".elm-version"]` | Which filenames should trigger this module. | +| `detect_folders` | `["elm-stuff"]` | Which folders should trigger this modules. | +| `style` | `"cyan bold"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `elm` module. | ### Variables @@ -900,20 +907,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` 组件显示选定的环境变量的当前值。 此组件只有满足以下条件之一时才会被显示: -- 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) "` | 组件格式化模板。 | -| `disabled` | `false` | Disables the `env_var` module. | +| Option | 默认值 | 描述 | +| ---------- | ------------------------------ | ------------------- | +| `symbol` | | 这个字段的内容会显示在环境变量值之前。 | +| `variable` | | 要显示的环境变量。 | +| `default` | | 所选变量未定义时显示的默认值。 | +| `format` | `"with [$env_value]($style) "` | 组件格式化模板。 | +| `disabled` | `false` | 禁用 `env_var` 组件。 | ### Variables @@ -937,22 +944,23 @@ default = "unknown shell" ## Erlang -The `erlang` module shows the currently installed version of Erlang/OTP. By default the module will be shown if any of the following conditions are met: +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` 文件. ### 配置项 -| Option | 默认值 | 描述 | -| ------------------- | ------------------------------------ | -------------------------------------------------------- | -| `symbol` | `" "` | The symbol used before displaying the version of erlang. | -| `style` | `"bold red"` | 此组件的样式。 | -| `detect_extensions` | `[]` | Which extensions should trigger this module. | -| `detect_files` | `["rebar.config", "elang.mk"]` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this modules. | -| `format` | `"via [$symbol($version )]($style)"` | 组件格式化模板。 | -| `disabled` | `false` | Disables the `erlang` module. | +| Option | 默认值 | 描述 | +| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- | +| `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 erlang. | +| `style` |