diff options
Diffstat (limited to 'docs/zh-CN/config/README.md')
-rw-r--r-- | docs/zh-CN/config/README.md | 110 |
1 files changed, 87 insertions, 23 deletions
diff --git a/docs/zh-CN/config/README.md b/docs/zh-CN/config/README.md index e715eef1b..4bd461d65 100644 --- a/docs/zh-CN/config/README.md +++ b/docs/zh-CN/config/README.md @@ -256,7 +256,7 @@ When using [AWSume](https://awsu.me) the profile is read from the `AWSUME_PROFIL | `region_aliases` | | 地区缩写列表,用来显示在 AWS 主机名之后。 | | `style` | `"bold yellow"` | 此组件的样式。 | | `expiration_symbol` | `X` | The symbol displayed when the temporary credentials have expired. | -| `disabled` | `false` | Disables the `AWS` module. | +| `disabled` | `false` | 禁用 `AWS` 组件。 | ### Variables @@ -389,7 +389,17 @@ discharging_symbol = 💦 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. ::: +::: warning + +`error_symbol` is not supported on elvish shell. + +::: + +::: warning + +`vicmd_symbol` is only supported in fish and zsh. + +::: ### 配置项 @@ -780,7 +790,6 @@ By default this module will only be shown in your prompt when one or more of the - `Directory.Build.props` - `Directory.Build.targets` - `Packages.props` -- `*.sln` - `*.csproj` - `*.fsproj` - `*.xproj` @@ -799,7 +808,7 @@ The module will also show the Target Framework Moniker (<https://docs.microsoft. | `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_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"` | 此组件的样式。 | @@ -2165,9 +2174,62 @@ python_binary = "python3" detect_extensions = [] ``` +```toml +# ~/.config/starship.toml + +[python] +# Display the version of python from inside a local venv. +# +# Note this will only work when the venv is inside the project and it will only +# work in the directory that contains the venv dir but maybe this is ok? +python_binary = ["./venv/bin/python", "python", "python3", "python2"] +``` + +## R + +The `rlang` module shows the currently installed version of R. The module will be shown if any of the following conditions are met: + +- The current directory contains a file with the `.R` extension. +- The current directory contains a file with the `.Rd` extension. +- The current directory contains a file with the `.Rmd` extension. +- The current directory contains a file with the `.Rproj` extension. +- The current directory contains a file with the `.Rsx` extension. +- The current directory contains a `.Rprofile` file +- The current directory contains a `.Rproj.user` folder + +### 配置项 + +| 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 R. | +| `style` | `"blue bold"` | 此组件的样式。 | +| `detect_extensions` | `["R", "Rd", "Rmd", "Rproj", "Rsx"]` | Which extensions should trigger this module | +| `detect_files` | `[".Rprofile"]` | Which filenames should trigger this module | +| `detect_folders` | `[".Rproj.user"]` | Which folders should trigger this module | +| `disabled` | `false` | Disables the `r` module. | + +### Variables + +| 字段 | 示例 | 描述 | +| ------- | ------------- | ------------------ | +| version | `v4.0.5` | The version of `R` | +| symbol | | `symbol`对应值 | +| style | `"blue bold"` | `style`对应值 | + +### 示例 + +```toml +# ~/.config/starship.toml + +[rlang] +format = "with [📐 $version](blue bold) " +``` + ## Red -By default the `red` module shows the currently installed version of [Red](https://www.red-lang.org/). 此组件将在符合以下任意条件之一时显示: +By default the `red` module shows the currently installed version of [Red](https://www.red-lang.org/). 此组件只有满足以下条件之一时才会被显示: - The current directory contains a file with `.red` or `.reds` extension @@ -2205,7 +2267,7 @@ symbol = "🔴 " ## Ruby -By default the `ruby` module shows the currently installed version of [Ruby](https://www.ruby-lang.org/). 此组件将在符合以下任意条件之一时显示: +By default the `ruby` module shows the currently installed version of [Ruby](https://www.ruby-lang.org/). 此组件只有满足以下条件之一时才会被显示: - 当前目录包含 `Gemfile` 文件 - The current directory contains a `.ruby-version` file @@ -2245,7 +2307,7 @@ symbol = "🔺 " ## Rust -By default the `rust` module shows the currently installed version of [Rust](https://www.rust-lang.org/). 此组件将在符合以下任意条件之一时显示: +By default the `rust` module shows the currently installed version of [Rust](https://www.rust-lang.org/). 此组件只有满足以下条件之一时才会被显示: - 当前目录包含 `Cargo.toml` 文件 - 当前目录包含一个使用 `.rs` 扩展名的文件 @@ -2492,7 +2554,7 @@ disabled = false ## Swift -By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). 此组件将在符合以下任意条件之一时显示: +By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). 此组件只有满足以下条件之一时才会被显示: - The current directory contains a `Package.swift` file - The current directory contains a file with the `.swift` extension @@ -2636,7 +2698,7 @@ time_range = "10:00:00-14:00:00" ## Username -`username` 组件显示当前活跃的用户名。 此组件将在符合以下任意条件之一时显示: +`username` 组件显示当前活跃的用户名。 此组件只有满足以下条件之一时才会被显示: - 当前用户是 root - 当前用户与登录用户不相同 @@ -2785,7 +2847,7 @@ format = "[🆅 $repo](bold blue) " ## Zig -By default the the `zig` module shows the currently installed version of [Zig](https://ziglang.org/). 此组件将在符合以下任意条件之一时显示: +By default the the `zig` module shows the currently installed version of [Zig](https://ziglang.org/). 此组件只有满足以下条件之一时才会被显示: - The current directory contains a `.zig` file @@ -2831,6 +2893,7 @@ These modules will be shown if any of the following conditions are met: - The current directory contains a directory whose name is in `directories` - The current directory contains a file whose extension is in `extensions` - The `when` command returns 0 +- The current Operating System (std::env::consts::OS) matchs with `os` field if defined. ::: tip @@ -2852,19 +2915,20 @@ The order in which custom modules are shown can be individually set by including ### 配置项 -| Option | 默认值 | 描述 | -| ------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. The command will be passed on stdin to the shell. | -| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | -| `shell` | | [See below](#custom-command-shell) | -| `description` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. | -| `files` | `[]` | The files that will be searched in the working directory for a match. | -| `directories` | `[]` | The directories that will be searched in the working directory for a match. | -| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | -| `symbol` | `""` | The symbol used before displaying the command output. | -| `style` | `"bold green"` | 此组件的样式。 | -| `format` | `"[$symbol($output )]($style)"` | 组件格式化模板。 | -| `disabled` | `false` | Disables this `custom` module. | +| Option | 默认值 | 描述 | +| ------------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `command` | | The command whose output should be printed. The command will be passed on stdin to the shell. | +| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | +| `shell` | | [See below](#custom-command-shell) | +| `描述` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. | +| `files` | `[]` | The files that will be searched in the working directory for a match. | +| `directories` | `[]` | The directories that will be searched in the working directory for a match. | +| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | +| `symbol` | `""` | The symbol used before displaying the command output. | +| `style` | `"bold green"` | 此组件的样式。 | +| `format` | `"[$symbol($output )]($style)"` | 组件格式化模板。 | +| `disabled` | `false` | Disables this `custom` module. | +| `os` | | Operating System name on which the module will be shown (unix, linux, macos, windows, ... ) [See possible values](https://doc.rust-lang.org/std/env/consts/constant.OS.html). | ### Variables |