diff options
Diffstat (limited to 'docs/zh-CN')
-rw-r--r-- | docs/zh-CN/config/README.md | 110 | ||||
-rw-r--r-- | docs/zh-CN/guide/README.md | 7 | ||||
-rw-r--r-- | docs/zh-CN/presets/README.md | 278 |
3 files changed, 372 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 diff --git a/docs/zh-CN/guide/README.md b/docs/zh-CN/guide/README.md index f8dcbb781..9fe009aff 100644 --- a/docs/zh-CN/guide/README.md +++ b/docs/zh-CN/guide/README.md @@ -163,6 +163,13 @@ To update the Starship itself, rerun the above script. It will replace the current version without touching Starship's configuration. + **Note** - The defaults of the install script can be overridden see the built-in help. + + ```sh + sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --help + ``` + + #### 通过软件包管理器安装 diff --git a/docs/zh-CN/presets/README.md b/docs/zh-CN/presets/README.md index 02333ecdd..413b7403f 100644 --- a/docs/zh-CN/presets/README.md +++ b/docs/zh-CN/presets/README.md @@ -81,6 +81,284 @@ symbol = " " [scala] symbol = " " +[shlvl] +symbol = " " + [swift] symbol = "ﯣ " ``` + +## Bracketed Segments + +This preset changes the format of all the built-in modules to show their segment in brackets instead of using the default Starship wording ("via", "on", etc.). + +Before: + +![Screenshot of default Starship configuration](/presets/bracketed-segments-before.png) + +After: + +![Screenshot of Bracketed Segments preset](/presets/bracketed-segments-after.png) + +### 配置 + +```toml +[aws] +format = '\[[$symbol($profile)(\($region\))(\[$duration\])]($style)\]' + +[cmake] +format = '\[[$symbol($version)]($style)\]' + +[cmd_duration] +format = "[⏱ $duration]($style)" + +[conda] +format = '\[[$symbol$environment]($style)\]' + +[crystal] +format = '\[[$symbol($version)]($style)\]' + +[dart] +format = '\[[$symbol($version)]($style)\]' + +[deno] +format = '\[[$symbol($version)]($style)\]' + +[docker_context] +format = '\[[$symbol$context]($style)\]' + +[dotnet] +format = '\[[$symbol($version)(🎯 $tfm)]($style)\]' + +[elixir] +format = '\[[$symbol($version \(OTP $otp_version\))]($style)\]' + +[elm] +format = '\[[$symbol($version)]($style)\]' + +[erlang] +format = '\[[$symbol($version)]($style)\]' + +[gcloud] +format = '\[[$symbol$account(@$domain)(\($region\))]($style)\]' + +[git_branch] +format = '\[[$symbol$branch]($style)\]' + +[git_status] +format = '([\[$all_status$ahead_behind\]]($style))' + +[golang] +format = '\[[$symbol($version)]($style)\]' + +[helm] +format = '\[[$symbol($version)]($style)\]' + +[hg_branch] +format = '\[[$symbol$branch]($style)\]' + +[java] +format = '\[[$symbol($version)]($style)\]' + +[julia] +format = '\[[$symbol($version)]($style)\]' + +[kotlin] +format = '\[[$symbol($version)]($style)\]' + +[kubernetes] +format = '\[[$symbol$context( \($namespace\))]($style)\]' + +[lua] +format = '\[[$symbol($version)]($style)\]' + +[memory_usage] +format = '\[$symbol[$ram( | $swap)]($style)\]' + +[nim] +format = '\[[$symbol($version)]($style)\]' + +[nix_shell] +format = '\[[$symbol$state( \($name\))]($style)\]' + +[nodejs] +format = '\[[$symbol($version)]($style)\]' + +[ocaml] +format = '\[[$symbol($version)(\($switch_indicator$switch_name\))]($style)\]' + +[openstack] +format = '\[[$symbol$cloud(\($project\))]($style)\]' + +[package] +format = '\[[$symbol$version]($style)\]' + +[perl] +format = '\[[$symbol($version)]($style)\]' + +[php] +format = '\[[$symbol($version)]($style)\]' + +[purescript] +format = '\[[$symbol($version)]($style)\]' + +[python] +format = '\[[${symbol}${pyenv_prefix}(${version})(\($virtualenv\))]($style)\]' + +[red] +format = '\[[$symbol($version)]($style)\]' + +[ruby] +format = '\[[$symbol($version)]($style)\]' + +[rust] +format = '\[[$symbol($version)]($style)\]' + +[scala] +format = '\[[$symbol($version)]($style)\]' + +[swift] +format = '\[[$symbol($version)]($style)\]' + +[terraform] +format = '\[[$symbol$workspace]($style)\]' + +[time] +format = '\[[$time]($style)\]' + +[username] +format = '\[[$user]($style)\]' + +[vagrant] +format = '\[[$symbol($version)]($style)\]' + +[vlang] +format = '\[[$symbol($version)]($style)\]' + +[zig] +format = '\[[$symbol($version)]($style)\]' +``` + +## Plain Text Symbols + +This preset changes the symbols into plain text. If your terminal/font could not render the NerdFonts/emojis, maybe you could try this preset! + +Before (default setting with Fixedsys font): + +![Screenshot of default Starship configuration with Fixedsys font](/presets/plain-text-symbols-before.png) + +After (Plain Text Symbols): + +![Screenshot of Plain Text Symbols preset](/presets/plain-text-symbols-after.png) + +### 配置 + +```toml +[character] +success_symbol = "[>](bold green)" +error_symbol = "[x](bold red)" +vicmd_symbol = "[<](bold green)" + +[git_commit] +tag_symbol = " tag " + +[git_status] +ahead = ">" +behind = "<" +diverged = "<>" +renamed = "r" +deleted = "x" + +[aws] +symbol = "aws " + +[conda] +symbol = "conda " + +[crystal] +symbol = "cr " + +[cmake] +symbol = "cmake " + +[dart] +symbol = "dart " + +[deno] +symbol = "deno " + +[dotnet] +symbol = ".NET " + +[directory] +read_only = " ro" + +[docker_context] +symbol = "docker " + +[elixir] +symbol = "exs " + +[elm] +symbol = "elm " + +[git_branch] +symbol = "git " + +[golang] +symbol = "go " + +[hg_branch] +symbol = "hg " + +[java] +symbol = "java " + +[julia] +symbol = "jl " + +[kotlin] +symbol = "kt " + +[nodejs] +symbol = "nodejs " + +[memory_usage] +symbol = "memory " + +[nim] +symbol = "nim " + +[nix_shell] +symbol = "nix " + +[ocaml] +symbol = "ml " + +[package] +symbol = "pkg " + +[perl] +symbol = "pl " + +[php] +symbol = "php " + +[purescript] +symbol = "purs " + +[python] +symbol = "py " + +[ruby] +symbol = "rb " + +[rust] +symbol = "rs " + +[scala] +symbol = "scala " + +[swift] +symbol = "swift " +``` |