mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
docs(i18n): new Crowdin translations (#1047)
This commit is contained in:
+239
-180
@@ -98,6 +98,7 @@ prompt_order = [
|
||||
"git_state",
|
||||
"git_status",
|
||||
"hg_branch",
|
||||
"docker_context",
|
||||
"package",
|
||||
"dotnet",
|
||||
"elixir",
|
||||
@@ -105,6 +106,7 @@ prompt_order = [
|
||||
"golang",
|
||||
"haskell",
|
||||
"java",
|
||||
"julia",
|
||||
"nodejs",
|
||||
"php",
|
||||
"python",
|
||||
@@ -130,6 +132,8 @@ prompt_order = [
|
||||
|
||||
`aws` 组件显示当前 AWS 主机所在区域与配置信息。 各组件基于 `AWS_REGION`,`AWS_DEFAULT_REGION` 和 `AWS_PROFILE` 环境变量与 `~/.aws/config` 文件。
|
||||
|
||||
When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var.
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
@@ -193,7 +197,7 @@ discharging_symbol = "💀"
|
||||
|
||||
### Battery 组件的显示
|
||||
|
||||
`display` 选项用于定义电池指示器的显示阈值(threshold)和显示效果(style)。 如果 `display` 没有设置, 默认配置如下所示:
|
||||
`display` 选项用于定义电池指示器的显示阈值(threshold)和显示效果(style)。 如果 `display` 没有设置, 默认设置如下:
|
||||
|
||||
```toml
|
||||
[[battery.display]]
|
||||
@@ -316,9 +320,9 @@ style = "dimmed green"
|
||||
|
||||
## Crystal
|
||||
|
||||
The `crystal` module shows the currently installed version of Crystal. 此组件只有满足以下条件之一时才会被显示:
|
||||
The `crystal` module shows the currently installed version of Crystal. 此组件将在符合以下任意条件时显示:
|
||||
|
||||
- The current directory contains a `shard.yml` file
|
||||
- 当前目录包含一个 `shard.yml` 文件
|
||||
- The current directory contains a `.cr` file
|
||||
|
||||
### 配置项
|
||||
@@ -341,29 +345,29 @@ style = "bold blue"
|
||||
|
||||
## 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`。
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ------------------- | ------------- | -------------------------------------------------------------------------------- |
|
||||
| `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. |
|
||||
| `prefix` | `"in "` | Prefix to display immediately before the directory. |
|
||||
| `style` | `"bold cyan"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | Disables the `directory` module. |
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ------------------- | ------------- | ------------------------ |
|
||||
| `truncation_length` | `3` | 当前目录路径被截断后最多保留的父目录数量。 |
|
||||
| `truncate_to_repo` | `true` | 是否只截断到您当前处于的 git 仓库根目录下。 |
|
||||
| `prefix` | `"in "` | 直接在显示路径前显示的前缀。 |
|
||||
| `style` | `"bold cyan"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | 禁用 `directory` 组件。 |
|
||||
|
||||
<details>
|
||||
<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
|
||||
<summary>此组件有几个高级配置选项来控制当前目录路径的显示方式。</summary>
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| --------------------------- | ------ | ---------------------------------------------------------------------------------------- |
|
||||
| `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. |
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| --------------------------- | ------ | ------------------------------------- |
|
||||
| `fish_style_pwd_dir_length` | `0` | 使用 fish shell 当前目录路径逻辑时每个省略目录名使用的字符数。 |
|
||||
| `use_logical_path` | `true` | 显示由 shell 提供的逻辑路径(`PWD`)而不是 OS 提供的路径。 |
|
||||
|
||||
`fish_style_pwd_dir_length` interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero, the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`.
|
||||
|
||||
@@ -378,22 +382,44 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
|
||||
truncation_length = 8
|
||||
```
|
||||
|
||||
## Dotnet
|
||||
## Docker Context
|
||||
|
||||
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.
|
||||
|
||||
This module will only be shown in your prompt when one of the following files are present in the current directory: `global.json`, `project.json`, `*.sln`, `*.csproj`, `*.fsproj`, `*.xproj`. You'll also need the .NET Core command-line tools 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.
|
||||
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`.
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ----------- | ------------- | -------------------------------------------------------- |
|
||||
| `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. |
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ----------------- | ------------- | --------------------------------------------------------------------------------------- |
|
||||
| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context . |
|
||||
| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. |
|
||||
| `style` | `"bold blue"` | 此组件的样式。 |
|
||||
| `disabled` | `true` | Disables the `docker_context` module. |
|
||||
|
||||
### 示例
|
||||
|
||||
```toml
|
||||
# ~/.config/starship.toml
|
||||
|
||||
[docker_context]
|
||||
symbol = "🐋 "
|
||||
```
|
||||
|
||||
## Dotnet
|
||||
|
||||
`dotnet` 模块显示与当前目录下使用的 .NET Core SDK 相关联的版本。 如果当前目录已被绑定了一个版本的 SDK,则显示被帮定的版本。 否则此组件将显示最新安装的 SDK 版本。
|
||||
|
||||
此组件只会在以下文件之一出现在当前目录中时显示:`global.json`,`project.json`,`*.sln`,`*.csproj`,`*.fsproj`,`*.xproj`。 为了正确使用此组件,您还需要安装 .NET Core 命令行工具。
|
||||
|
||||
在内部,此组件使用自己的版本检测机制。 一般来说此组件是直接执行 `dotnet --version` 的两倍快,但当你的 .NET 项目使用了不常见的目录布局时此组件可能显示一个错误的版本。 如果相比于速度您更需要正确的版本号,您可以在组件设置中设置 `heuristic = false` 来禁用该机制。
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ----------- | ------------- | ------------------------------ |
|
||||
| `symbol` | `"•NET "` | 这个字段的内容会显示在当前 .NET 版本之前。 |
|
||||
| `heuristic` | `true` | 使用更快的版本探测机制以保证 starship 的运行速度。 |
|
||||
| `style` | `"bold blue"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | 禁用 `dotnet` 组件。 |
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -410,7 +436,7 @@ heuristic = false
|
||||
|
||||
The `elixir` module shows the currently installed version of Elixir and Erlang/OTP. 此组件只有满足以下条件之一时才会被显示:
|
||||
|
||||
- The current directory contains a `mix.exs` file.
|
||||
- 当前目录包含一个 `mix.exs` 文件.
|
||||
|
||||
### 配置项
|
||||
|
||||
@@ -430,10 +456,11 @@ symbol = "🔮 "
|
||||
|
||||
## Elm
|
||||
|
||||
The `elm` module shows the currently installed version of Elm. 此组件只有满足以下条件之一时才会被显示:
|
||||
The `elm` module shows the currently installed version of Elm. 此组件将在符合以下任意条件时显示:
|
||||
|
||||
- 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
|
||||
|
||||
@@ -457,22 +484,22 @@ symbol = " "
|
||||
|
||||
## 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`
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ---------- | ---------------- | ---------------------------------------------------------------------------- |
|
||||
| `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. |
|
||||
| `prefix` | `""` | Prefix to display immediately before the variable value. |
|
||||
| `suffix` | `""` | Suffix to display immediately after the variable value. |
|
||||
| `style` | `"dimmed black"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | Disables the `env_var` module. |
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ---------- | ---------------- | ------------------- |
|
||||
| `symbol` | | 这个字段的内容会显示在环境变量值之前。 |
|
||||
| `variable` | | 要显示的环境变量。 |
|
||||
| `default` | | 所选变量未定义时显示的默认值。 |
|
||||
| `prefix` | `""` | 直接在显示环境变量值前显示的前缀。 |
|
||||
| `suffix` | `""` | 直接在显示环境变量值后显示的后缀。 |
|
||||
| `style` | `"dimmed black"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | 禁用 `env_var` 组件。 |
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -486,17 +513,17 @@ default = "unknown shell"
|
||||
|
||||
## Git Branch
|
||||
|
||||
The `git_branch` module shows the active branch of the repo in your current directory.
|
||||
`git_branch` 组件显示当前目录的 git 仓库的活动分支。
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ------------------- | --------------- | ------------------------------------------------------------------------------------- |
|
||||
| `symbol` | `" "` | The symbol used before the branch name of the repo in your current directory. |
|
||||
| `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 |
|
||||
| `style` | `"bold purple"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | Disables the `git_branch` module. |
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ------------------- | --------------- | ------------------------------------- |
|
||||
| `symbol` | `" "` | 该字段的内容显示于当前仓库活动分支名之前。 |
|
||||
| `truncation_length` | `2^63 - 1` | 将显示的分支名截断到该数量的字素(graphemes) |
|
||||
| `truncation_symbol` | `"…"` | 此字段的内容用来表示分支名称被截断。 您可以使用 "" 以不显示任何符号。 |
|
||||
| `style` | `"bold purple"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | 禁用 `git_branch` 组件。 |
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -511,18 +538,18 @@ truncation_symbol = ""
|
||||
|
||||
## Git Commit
|
||||
|
||||
The `git_commit` module shows the current commit hash of the repo in your current directory.
|
||||
`git_commit` 组件显示当前目录的 git 仓库的当前提交的哈希值。
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| -------------------- | -------------- | ----------------------------------------------------- |
|
||||
| `commit_hash_length` | `7` | The length of the displayed git commit hash. |
|
||||
| `prefix` | `"("` | Prefix to display immediately before git commit. |
|
||||
| `suffix` | `")"` | Suffix to display immediately after git commit. |
|
||||
| `commit_hash_length` | `7` | 显示的 git 提交哈希值的长度。 |
|
||||
| `prefix` | `"("` | 直接在 git 提交哈希值前显示的前缀。 |
|
||||
| `suffix` | `")"` | 直接在 git 提交哈希值后显示的后缀。 |
|
||||
| `style` | `"bold green"` | 此组件的样式。 |
|
||||
| `only_detached` | `true` | Only show git commit hash when in detached HEAD state |
|
||||
| `disabled` | `false` | Disables the `git_commit` module. |
|
||||
| `disabled` | `false` | 禁用 `git_commit` 组件。 |
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -535,22 +562,22 @@ commit_hash_length = 4
|
||||
|
||||
## 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)如果存在则也会被显示。
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ------------------ | ------------------ | ---------------------------------------------------------------------------------------------------------------- |
|
||||
| `rebase` | `"REBASING"` | The text displayed when a `rebase` is in progress. |
|
||||
| `merge` | `"MERGING"` | The text displayed when a `merge` is in progress. |
|
||||
| `revert` | `"REVERTING"` | The text displayed when a `revert` is in progress. |
|
||||
| `cherry_pick` | `"CHERRY-PICKING"` | The text displayed when a `cherry-pick` is in progress. |
|
||||
| `bisect` | `"BISECTING"` | The text displayed when a `bisect` is in progress. |
|
||||
| `am` | `"AM"` | The text displayed when an `apply-mailbox` (`git am`) is in progress. |
|
||||
| `am_or_rebase` | `"AM/REBASE"` | The text displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. |
|
||||
| `progress_divider` | `"/"` | The symbol or text which will separate the current and total progress amounts. (e.g., `" of "`, for `"3 of 10"`) |
|
||||
| `style` | `"bold yellow"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | Disables the `git_state` module. |
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ------------------ | ------------------ | ----------------------------------------------------- |
|
||||
| `rebase` | `"REBASING"` | `rebase` 时显示的文本。 |
|
||||
| `merge` | `"MERGING"` | `merge` 时显示的文本。 |
|
||||
| `revert` | `"REVERTING"` | `revert` 时显示的文本。 |
|
||||
| `cherry_pick` | `"CHERRY-PICKING"` | `cherry-pick` 时显示的文本。 |
|
||||
| `bisect` | `"BISECTING"` | `bisect` 时显示的文本。 |
|
||||
| `am` | `"AM"` | 正在执行 `apply-mailbox`(`git am`)时显示的文本。 |
|
||||
| `am_or_rebase` | `"AM/REBASE"` | 当无法分辨正在执行的是 `apply-mailbox` 还是 `rebase` 时显示的文本。 |
|
||||
| `progress_divider` | `"/"` | 将当前进度与总进度分开的符号或文本。 (例如,设置为 `" of "` 时效果是 `"3 of 10"`) |
|
||||
| `style` | `"bold yellow"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | 禁用 `git_state` 模块 |
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -564,41 +591,41 @@ cherry_pick = "🍒 PICKING"
|
||||
|
||||
## Git Status
|
||||
|
||||
The `git_status` module shows symbols representing the state of the repo in your current directory.
|
||||
`git_status`组件通过相应的符号显示您当前目录中 git 仓库的状态。
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ------------------ | ------------------------- | ------------------------------------------------------- |
|
||||
| `conflicted` | `"="` | This branch has merge conflicts. |
|
||||
| `conflicted_count` | [见下文](#git-status-counts) | Show and style the number of conflicts. |
|
||||
| `ahead` | `"⇡"` | This branch is ahead of the branch being tracked. |
|
||||
| `behind` | `"⇣"` | This branch is behind of the branch being tracked. |
|
||||
| `diverged` | `"⇕"` | This branch has diverged from the branch being tracked. |
|
||||
| `untracked` | `"?"` | There are untracked files in the working directory. |
|
||||
| `untracked_count` | [见下文](#git-status-counts) | Show and style the number of untracked files. |
|
||||
| `stashed` | `"$"` | A stash exists for the local repository. |
|
||||
| `stashed_count` | [见下文](#git-status-counts) | Show and style the number of stashes. |
|
||||
| `modified` | `"!"` | There are file modifications in the working directory. |
|
||||
| `modified_count` | [见下文](#git-status-counts) | Show and style the number of modified files. |
|
||||
| `staged` | `"+"` | A new file has been added to the staging area. |
|
||||
| `staged_count` | [见下文](#git-status-counts) | Show and style the number of files staged files. |
|
||||
| `renamed` | `"»"` | A renamed file has been added to the staging area. |
|
||||
| `renamed_count` | [见下文](#git-status-counts) | Show and style the number of renamed files. |
|
||||
| `deleted` | `"✘"` | A file's deletion has been added to the staging area. |
|
||||
| `deleted_count` | [见下文](#git-status-counts) | Show and style the number of deleted files. |
|
||||
| `show_sync_count` | `false` | Show ahead/behind count of the branch being tracked. |
|
||||
| `prefix` | `[` | Prefix to display immediately before git status. |
|
||||
| `suffix` | `]` | Suffix to display immediately after git status. |
|
||||
| `style` | `"bold red"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | Disables the `git_status` module. |
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ------------------ | ------------------------- | ---------------------------- |
|
||||
| `conflicted` | `"="` | 这个分支有合并冲突。 |
|
||||
| `conflicted_count` | [见下文](#git-status-counts) | 显示冲突数量,设置冲突数量的显示样式。 |
|
||||
| `ahead` | `"⇡"` | 这个分支领先于正在跟踪的分支。 |
|
||||
| `behind` | `"⇣"` | 这个分支落后于正在跟踪的分支。 |
|
||||
| `diverged` | `"⇕"` | 这个分支与正在跟踪的分支有分歧。 |
|
||||
| `untracked` | `"?"` | 工作目录中有未跟踪的文件。 |
|
||||
| `untracked_count` | [见下文](#git-status-counts) | 显示未跟踪文件的数量,设置该数量的显示样式。 |
|
||||
| `stashed` | `"$"` | 本地 git 仓库中存在一个 stash 快照。 |
|
||||
| `stashed_count` | [见下文](#git-status-counts) | 显示 stash 快照数量,设置快照数量的显示样式。 |
|
||||
| `modified` | `"!"` | 工作目录中有文件修改。 |
|
||||
| `modified_count` | [见下文](#git-status-counts) | 显示修改文件的数量,设置该数量的显示样式。 |
|
||||
| `staged` | `"+"` | 一个新文件被添加到了暂存区(staging area)。 |
|
||||
| `staged_count` | [见下文](#git-status-counts) | 显示暂存区中文件数量,设置该数量的显示样式。 |
|
||||
| `renamed` | `"»"` | 一个重命名的文件被添加到了暂存区。 |
|
||||
| `renamed_count` | [见下文](#git-status-counts) | 显示重命名文件的数量,设置该数量的显示样式。 |
|
||||
| `deleted` | `"✘"` | 一个文件的删除记录被添加到了暂存区。 |
|
||||
| `deleted_count` | [见下文](#git-status-counts) | 显示文件删除记录的数量,设置该数量的显示样式。 |
|
||||
| `show_sync_count` | `false` | 显示领先/落后正在跟踪的分支的提交数。 |
|
||||
| `prefix` | `[` | 直接在 git 状态前显示的前缀。 |
|
||||
| `suffix` | `]` | 直接在 git 状态后显示的后缀。 |
|
||||
| `style` | `"bold red"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | 禁用 `git_status` 组件。 |
|
||||
|
||||
#### Git Status 中的计数值
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| --------- | ------- | ------------------------------------------------------ |
|
||||
| `enabled` | `false` | Show the number of files |
|
||||
| `style` | | Optionally style the count differently than the module |
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| --------- | ------- | ------------------------------- |
|
||||
| `enabled` | `false` | 显示相应的文件数量 |
|
||||
| `style` | | 可选字段,使计数值的显示风格不同于 git_status 组件 |
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -623,23 +650,24 @@ deleted = "🗑"
|
||||
|
||||
## Golang
|
||||
|
||||
The `golang` module shows the currently installed version of Golang. 此组件只有满足以下条件之一时才会被显示:
|
||||
`golang` 组件显示当前安装的 Golang 版本。 此组件将在符合以下任意条件时显示:
|
||||
|
||||
- The current directory contains a `go.mod` file
|
||||
- The current directory contains a `go.sum` file
|
||||
- The current directory contains a `glide.yaml` file
|
||||
- The current directory contains a `Gopkg.yml` file
|
||||
- The current directory contains a `Gopkg.lock` file
|
||||
- The current directory contains a `Godeps` directory
|
||||
- The current directory contains a file with the `.go` extension
|
||||
- 当前目录包含 `go.mod` 文件
|
||||
- 当前目录包含 `go.sum` 文件
|
||||
- 当前目录包含 `glide.yaml` 文件
|
||||
- 当前目录包含 `Gopkg.yml` 文件
|
||||
- 当前目录包含 `Gopkg.lock` 文件
|
||||
- The current directory contains a `.go-version` file
|
||||
- 当前目录包含 `Godeps` 目录
|
||||
- 当前目录包含一个使用 `.go` 扩展名的文件
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ---------- | ------------- | -------------------------------------------------------- |
|
||||
| `symbol` | `"🐹 "` | The symbol used before displaying the version of Golang. |
|
||||
| `style` | `"bold cyan"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | Disables the `golang` module. |
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ---------- | ------------- | -------------------------- |
|
||||
| `symbol` | `"🐹 "` | 这个字段的内容会显示在当前 Golang 版本之前。 |
|
||||
| `style` | `"bold cyan"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | 禁用 `golang` 组件。 |
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -651,17 +679,17 @@ symbol = "🏎💨 "
|
||||
```
|
||||
## Haskell
|
||||
|
||||
The `haskell` module shows the currently installed version of Haskell Stack version. 此组件只有满足以下条件之一时才会被显示:
|
||||
`haskell` 组件显示当前安装的 Haskell Stack 版本。 此组件将在符合以下任意条件之一时显示:
|
||||
|
||||
- The current directory contains a `stack.yaml` file
|
||||
- 当前目录包含 `stack.yaml` 文件
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ---------- | ------------ | --------------------------------------------------------- |
|
||||
| `symbol` | `"λ "` | The symbol used before displaying the version of Haskell. |
|
||||
| `style` | `"bold red"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | Disables the `haskell` module. |
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ---------- | ------------ | --------------------------- |
|
||||
| `symbol` | `"λ "` | 这个字段的内容会显示在当前 Haskell 版本之前。 |
|
||||
| `style` | `"bold red"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | 禁用 `haskell` 组件。 |
|
||||
|
||||
|
||||
### 示例
|
||||
@@ -703,18 +731,18 @@ 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` or `build.sbt` file
|
||||
- The current directory contains a file with the `.java`, `.class`, `.gradle` or `.jar` extension
|
||||
- The current directory contains a `pom.xml`, `build.gradle.kts`, `build.sbt` or `.java-version` file
|
||||
- 当前目录包含一个扩展名为 `.java`,`.class`,`.gradle` 或 `.jar` 的文件
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ---------- | -------------- | ------------------------------------------------------ |
|
||||
| `symbol` | `"☕ "` | The symbol used before displaying the version of Java. |
|
||||
| `style` | `"dimmed red"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | Disables the `java` module. |
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ---------- | -------------- | ------------------------ |
|
||||
| `symbol` | `"☕ "` | 这个字段的内容会显示在当前 Java 版本之前。 |
|
||||
| `style` | `"dimmed red"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | 禁用 `java` 组件。 |
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -727,16 +755,16 @@ 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` 字段,则使用它作为显示作业数量的下限。
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ----------- | ------------- | ----------------------------------------------------- |
|
||||
| `symbol` | `"✦"` | The symbol used before displaying the number of jobs. |
|
||||
| `threshold` | `1` | Show number of jobs if exceeded. |
|
||||
| `style` | `"bold blue"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | Disables the `jobs` module. |
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ----------- | ------------- | -------------------- |
|
||||
| `symbol` | `"✦"` | 这个字段的内容会显示在当前作业数量之前。 |
|
||||
| `threshold` | `1` | 如果超过此字段的值,显示任务数量。 |
|
||||
| `style` | `"bold blue"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | 禁用 `jobs` 组件。 |
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -748,9 +776,33 @@ symbol = "+ "
|
||||
threshold = 4
|
||||
```
|
||||
|
||||
## Julia
|
||||
|
||||
The `julia` module shows the currently installed version of Julia. 此组件将在符合以下任意条件时显示:
|
||||
|
||||
- The current directory contains a `Project.toml` file
|
||||
- The current directory contains a `Manifest.toml` file
|
||||
- The current directory contains a file with the `.jl` extension
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ---------- | --------------- | ------------------------------------------------------- |
|
||||
| `symbol` | `"∴ "` | The symbol used before displaying the version of Julia. |
|
||||
| `style` | `"bold purple"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | Disables the `julia` module. |
|
||||
|
||||
### 示例
|
||||
|
||||
```toml
|
||||
# ~/.config/starship.toml
|
||||
|
||||
[julia]
|
||||
symbol = "👸 "
|
||||
```
|
||||
## Kubernetes
|
||||
|
||||
Displays the current Kubernetes context name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`.
|
||||
显示当前的 Kubernetes 上下文名以及,如果有相关设置,则显示来自 kubeconig 文件的命名空间。 命名空间需要在 kubeconfig 文件中设置,这可以通过 `kubectl config set-context starship-cluster --namespace astronaut` 完成。 如果设置了环境变量 `$KUBECONFIG`,此组件将使用该值,否则会使用 `~/.kube/config`。
|
||||
|
||||
::: tip
|
||||
|
||||
@@ -760,11 +812,12 @@ Displays the current Kubernetes context name and, if set, the namespace from the
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ---------- | ------------- | --------------------------------------------------- |
|
||||
| `symbol` | `"☸ "` | The symbol used before displaying the Cluster info. |
|
||||
| `style` | `"bold blue"` | 此组件的样式。 |
|
||||
| `disabled` | `true` | Disables the `kubernetes` module |
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ----------------- | ------------- | ----------------------------------- |
|
||||
| `symbol` | `"☸ "` | 这个字段的内容会显示在当前集群信息之前。 |
|
||||
| `context_aliases` | | Table of context aliases to display |
|
||||
| `style` | `"bold blue"` | 此组件的样式。 |
|
||||
| `disabled` | `true` | 禁用 `kubernetes` 组件。 |
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -775,17 +828,19 @@ Displays the current Kubernetes context name and, if set, the namespace from the
|
||||
symbol = "⛵ "
|
||||
style = "dimmed green"
|
||||
disabled = false
|
||||
[kubernetes.context_aliases]
|
||||
"dev.local.cluster.k8s" = "dev"
|
||||
```
|
||||
|
||||
## Line Break
|
||||
|
||||
The `line_break` module separates the prompt into two lines.
|
||||
`line_break` 组件将提示分隔为两行。
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ---------- | ------- | ------------------------------------------------------------------ |
|
||||
| `disabled` | `false` | Disables the `line_break` module, making the prompt a single line. |
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ---------- | ------- | --------------------------- |
|
||||
| `disabled` | `false` | 禁用 `line_break` 组件,使提示成为单行。 |
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -798,9 +853,9 @@ disabled = true
|
||||
|
||||
## 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
|
||||
|
||||
@@ -810,15 +865,15 @@ By default the swap usage is displayed if the total system swap is non-zero.
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ----------------- | --------------------- | ------------------------------------------------------------- |
|
||||
| `show_percentage` | `false` | Display memory usage as a percentage of the available memory. |
|
||||
| `show_swap` | `true` | Display swap usage if total swap is non-zero. |
|
||||
| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. |
|
||||
| `symbol` | `"🐏 "` | The symbol used before displaying the memory usage. |
|
||||
| `separator` | `" | "` | The symbol or text that will seperate the ram and swap usage. |
|
||||
| `style` | `"bold dimmed white"` | 此组件的样式。 |
|
||||
| `disabled` | `true` | Disables the `memory_usage` module. |
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ----------------- | --------------------- | -------------------------- |
|
||||
| `show_percentage` | `false` | 用可用内存的百分比来显示内存使用情况。 |
|
||||
| `show_swap` | `true` | 如果总交换区使用量为非零,则显示交换区使用情况。 |
|
||||
| `threshold` | `75` | 隐藏内存使用情况,除非它超过这个百分比。 |
|
||||
| `symbol` | `"🐏 "` | 这个字段的内容会显示在当前内存使用情况之前。 |
|
||||
| `separator` | `" | "` | 此字段所设置的符号或文本会分隔内存和交换区使用情况。 |
|
||||
| `style` | `"bold dimmed white"` | 此组件的样式。 |
|
||||
| `disabled` | `true` | 禁用 `memory_usage` 模块 |
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -837,17 +892,17 @@ style = "bold dimmed green"
|
||||
|
||||
## Mercurial Branch
|
||||
|
||||
The `hg_branch` module shows the active branch of the repo in your current directory.
|
||||
`hg_branch` 组件显示当前目录的 hg 仓库的活动分支。
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ------------------- | --------------- | -------------------------------------------------------------------------------------------- |
|
||||
| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. |
|
||||
| `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. |
|
||||
| `style` | `"bold purple"` | 此组件的样式。 |
|
||||
| `disabled` | `true` | Disables the `hg_branch` module. |
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ------------------- | --------------- | ------------------------------- |
|
||||
| `symbol` | `" "` | 该字段的内容显示于当前仓库的 hg 书签或活动分支名之前。 |
|
||||
| `truncation_length` | `2^63 - 1` | 将显示的 hg 分支名截断到该数量的字素(graphemes) |
|
||||
| `truncation_symbol` | `"…"` | 此字段的内容用来表示分支名称被截断。 |
|
||||
| `style` | `"bold purple"` | 此组件的样式。 |
|
||||
| `disabled` | `true` | 禁用 `hg_branch` 组件。 |
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -862,17 +917,17 @@ truncation_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 环境中时,此组件会被显示。
|
||||
|
||||
### 配置项
|
||||
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ------------ | ------------ | ---------------------------------- |
|
||||
| `use_name` | `false` | Display the name of the nix-shell. |
|
||||
| `impure_msg` | `"impure"` | Customize the "impure" msg. |
|
||||
| `pure_msg` | `"pure"` | Customize the "pure" msg. |
|
||||
| `style` | `"bold red"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | Disables the `nix_shell` module. |
|
||||
| 字段 | 默认值 | 描述 |
|
||||
| ------------ | ------------ | ------------------ |
|
||||
| `use_name` | `false` | 显示 nix-shell 的名称。 |
|
||||
| `impure_msg` | `"impure"` | 自定义“impure”消息。 |
|
||||
| `pure_msg` | `"pure"` | 自定义“pure”消息。 |
|
||||
| `style` | `"bold red"` | 此组件的样式。 |
|
||||
| `disabled` | `false` | 禁用 `nix_shell` 组件。 |
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -888,9 +943,10 @@ pure_msg = "pure shell"
|
||||
|
||||
## NodeJS
|
||||
|
||||
`nodejs` 组件显示当前安装的 NodeJS 版本。 此组件只有满足以下条件之一时才会被显示:
|
||||
`nodejs` 组件显示当前安装的 NodeJS 版本。 此组件将在符合以下任意条件时显示:
|
||||
|
||||
- 当前目录包含 `package.json` 文件
|
||||
- The current directory contains a `.node-version` file
|
||||
- 当前目录包含 `node_modules` 目录
|
||||
- 当前目录包含一个使用 `.js` 扩展名的文件
|
||||
|
||||
@@ -920,6 +976,7 @@ symbol = "🤖 "
|
||||
- **poetry** —— `poetry` 软件包版本从当前目录下的 `pyproject.toml` 中得到
|
||||
- **composer** —— `composer` 软件包版本从当前目录下的 `composer.json` 中得到
|
||||
- **gradle** – The `gradle` package version is extracted from the `build.gradle` present
|
||||
- **julia** - The package version is extracted from the `Project.toml` present
|
||||
|
||||
> ⚠ 此组件显示的是源代码在当前目录中的软件包的版本,而不是包管理器的版本。
|
||||
|
||||
@@ -942,9 +999,10 @@ symbol = "🎁 "
|
||||
|
||||
## PHP
|
||||
|
||||
`php` 组件显示当前安装的 PHP 版本。 此组件只有满足以下条件之一时才会被显示:
|
||||
`php` 组件显示当前安装的 PHP 版本。 此组件将在符合以下任意条件时显示:
|
||||
|
||||
- 当前目录包含一个 `composer.json` 文件
|
||||
- The current directory contains a `.php-version` file
|
||||
- 当前目录包含一个 `.php` 文件
|
||||
|
||||
### 配置项
|
||||
@@ -972,7 +1030,7 @@ symbol = "🔹 "
|
||||
|
||||
否则,它将显示来自 `python --version` 的版本号,并显示当前的 Python 虚拟环境,如果激活了的话。
|
||||
|
||||
此组件只有满足以下条件之一时才会被显示:
|
||||
此组件将在符合以下任意条件之一时显示:
|
||||
|
||||
- 当前目录包含 `.python-version` 文件
|
||||
- 当前目录包含 `requirements.txt` 文件
|
||||
@@ -1005,9 +1063,10 @@ pyenv_prefix = "foo "
|
||||
|
||||
## Ruby
|
||||
|
||||
`ruby` 组件显示当前安装的 Ruby 版本。 此组件只有满足以下条件之一时才会被显示:
|
||||
`ruby` 组件显示当前安装的 Ruby 版本。 此组件将在符合以下任意条件时显示:
|
||||
|
||||
- 当前目录包含 `Gemfile` 文件
|
||||
- The current directory contains a `.ruby-version` file
|
||||
- 当前目录包含 `.rb` 文件
|
||||
|
||||
### 配置项
|
||||
@@ -1029,7 +1088,7 @@ symbol = "🔺 "
|
||||
|
||||
## Rust
|
||||
|
||||
`rust` 组件显示当前安装的 Rust 版本。 此组件将在符合以下任意条件时显示:
|
||||
`rust` 组件显示当前安装的 Rust 版本。 此组件将在符合以下任意条件之一时显示:
|
||||
|
||||
- 当前目录包含 `Cargo.toml` 文件
|
||||
- 当前目录包含一个使用 `.rs` 扩展名的文件
|
||||
@@ -1079,7 +1138,7 @@ symbol = "📦 "
|
||||
|
||||
## Terraform
|
||||
|
||||
`terraform` 组件显示当前选定的 terraform 工作区和版本。 默认情况下不会显示 terraform 版本,因为当使用大量插件时,当前版本 terraform 查询版本号很慢。 此组件只有满足以下条件之一时才会被显示:
|
||||
`terraform` 组件显示当前选定的 terraform 工作区和版本。 默认情况下不会显示 terraform 版本,因为当使用大量插件时,当前版本 terraform 查询版本号很慢。 此组件将在符合以下任意条件时显示:
|
||||
|
||||
- 当前目录包含 `.terraform` 目录
|
||||
- 当前目录包含一个使用 `.tf` 扩展名的文件
|
||||
@@ -1137,7 +1196,7 @@ utc_time_offset = "-5"
|
||||
|
||||
## Username
|
||||
|
||||
`username` 组件显示当前活跃的用户名。 此组件只有满足以下条件之一时才会被显示:
|
||||
`username` 组件显示当前活跃的用户名。 此组件将在符合以下任意条件之一时显示:
|
||||
|
||||
- 当前用户是 root
|
||||
- 当前用户与登录用户不相同
|
||||
|
||||
@@ -220,9 +220,37 @@
|
||||
|
||||
如果您有兴趣贡献于 Starship,请查看我们的[贡献指南](https://github.com/starship/starship/blob/master/CONTRIBUTING.md)。 另外,你可以自由加入我们的 [Discord 服务器](https://discord.gg/8Jzqu3T) 。 👋
|
||||
|
||||
### Code Contributors
|
||||
|
||||
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
|
||||
<a href="https://github.com/starship/starship/graphs/contributors"><img src="https://opencollective.com/starship/contributors.svg?width=890&button=false" /></a>
|
||||
|
||||
### Financial Contributors
|
||||
|
||||
Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/starship/contribute)]
|
||||
|
||||
#### Individuals
|
||||
|
||||
<a href="https://opencollective.com/starship"><img src="https://opencollective.com/starship/individuals.svg?width=890"></a>
|
||||
|
||||
#### Organizations
|
||||
|
||||
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/starship/contribute)]
|
||||
|
||||
<a href="https://opencollective.com/starship/organization/0/website"><img src="https://opencollective.com/starship/organization/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/starship/organization/1/website"><img src="https://opencollective.com/starship/organization/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/starship/organization/2/website"><img src="https://opencollective.com/starship/organization/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/starship/organization/3/website"><img src="https://opencollective.com/starship/organization/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/starship/organization/4/website"><img src="https://opencollective.com/starship/organization/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/starship/organization/5/website"><img src="https://opencollective.com/starship/organization/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/starship/organization/6/website"><img src="https://opencollective.com/starship/organization/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/starship/organization/7/website"><img src="https://opencollective.com/starship/organization/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/starship/organization/8/website"><img src="https://opencollective.com/starship/organization/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/starship/organization/9/website"><img src="https://opencollective.com/starship/organization/9/avatar.svg"></a>
|
||||
|
||||
## 💭该项目受以下项目启发
|
||||
|
||||
请参考这些曾经为 Starship 提供启发的工程。 🙏
|
||||
Please check out these previous works that helped inspire the creation of starship. 🙏
|
||||
|
||||
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - A ZSH prompt for astronauts.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user