1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-06-01 08:00:51 +00:00

docs(i18n): new Crowdin updates (#3586)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Italian)

* New translations README.md (Italian)

* New translations README.md (French)

* New translations README.md (Russian)

* New translations README.md (Indonesian)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Vietnamese)

* New translations README.md (Chinese Traditional)

* New translations README.md (Chinese Simplified)

* New translations README.md (Turkish)

* New translations README.md (Portuguese)

* New translations README.md (Spanish)

* New translations README.md (Polish)

* New translations README.md (Dutch)

* New translations README.md (Korean)

* New translations README.md (Japanese)

* New translations README.md (Italian)

* New translations README.md (German)

* New translations README.md (Arabic)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (French)

* New translations README.md (Russian)

* New translations README.md (Indonesian)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Vietnamese)

* New translations README.md (Chinese Traditional)

* New translations README.md (Chinese Simplified)

* New translations README.md (Turkish)

* New translations README.md (Portuguese)

* New translations README.md (Spanish)

* New translations README.md (Polish)

* New translations README.md (Dutch)

* New translations README.md (Korean)

* New translations README.md (Japanese)

* New translations README.md (Italian)

* New translations README.md (German)

* New translations README.md (Arabic)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (French)

* New translations README.md (Russian)

* New translations README.md (Indonesian)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Vietnamese)

* New translations README.md (Chinese Traditional)

* New translations README.md (Chinese Simplified)

* New translations README.md (Turkish)

* New translations README.md (Portuguese)

* New translations README.md (Spanish)

* New translations README.md (Polish)

* New translations README.md (Dutch)

* New translations README.md (Korean)

* New translations README.md (Japanese)

* New translations README.md (Italian)

* New translations README.md (German)

* New translations README.md (Arabic)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (French)

* New translations README.md (Spanish)

* New translations README.md (Chinese Simplified)

* New translations README.md (Arabic)

* New translations README.md (German)

* New translations README.md (Italian)

* New translations README.md (Japanese)

* New translations README.md (Korean)

* New translations README.md (Dutch)

* New translations README.md (Polish)

* New translations README.md (Portuguese)

* New translations README.md (Russian)

* New translations README.md (Turkish)

* New translations README.md (Chinese Traditional)

* New translations README.md (Vietnamese)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Indonesian)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (French)

* New translations README.md (Spanish)

* New translations README.md (Turkish)

* New translations README.md (Arabic)

* New translations README.md (German)

* New translations README.md (Italian)

* New translations README.md (Japanese)

* New translations README.md (Korean)

* New translations README.md (Dutch)

* New translations README.md (Polish)

* New translations README.md (Portuguese)

* New translations README.md (Russian)

* New translations README.md (Chinese Simplified)

* New translations README.md (Vietnamese)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Indonesian)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Chinese Traditional)

* New translations README.md (Chinese Simplified)

* New translations README.md (French)

* New translations README.md (Spanish)

* New translations README.md (Chinese Simplified)

* New translations README.md (Arabic)

* New translations README.md (German)

* New translations README.md (Italian)

* New translations README.md (Japanese)

* New translations README.md (Korean)

* New translations README.md (Dutch)

* New translations README.md (Polish)

* New translations README.md (Portuguese)

* New translations README.md (Russian)

* New translations README.md (Turkish)

* New translations README.md (Chinese Traditional)

* New translations README.md (Vietnamese)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Indonesian)

* New translations README.md (Sorani (Kurdish))

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (Spanish)

* New translations README.md (French)

* New translations README.md (Russian)

* New translations README.md (Indonesian)

* New translations README.md (Portuguese, Brazilian)

* New translations README.md (Vietnamese)

* New translations README.md (Chinese Traditional)

* New translations README.md (Chinese Simplified)

* New translations README.md (Turkish)

* New translations README.md (Portuguese)

* New translations README.md (Spanish)

* New translations README.md (Polish)

* New translations README.md (Dutch)

* New translations README.md (Korean)

* New translations README.md (Japanese)

* New translations README.md (Italian)

* New translations README.md (German)

* New translations README.md (Arabic)

* New translations README.md (Sorani (Kurdish))
This commit is contained in:
Matan Kushner 2022-03-01 17:05:57 -05:00 committed by GitHub
parent 0f3c8ca194
commit aabc786dab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 5196 additions and 4639 deletions

View File

@ -261,7 +261,9 @@ format = "$all$directory$character"
## AWS
The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials.
The `aws` module shows the current AWS region and profile when credentials or a `credential_process` have been setup. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials.
The module will display a profile only if its credentials are present in `~/.aws/credentials` or a `credential_process` is defined in `~/.aws/config`. Alternatively, having any of the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, or `AWS_SESSION_TOKEN` env vars defined will also suffice.
When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var.
@ -795,19 +797,20 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
### Options
| 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) "` | The format for the module. |
| `style` | `"bold cyan"` | The style for the module. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
| 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) "` | The format for the module. |
| `style` | `"bold cyan"` | The style for the module. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo. The default value is equivalent to `style`. |
| `repo_root_format` | `"[$before_root_path]($style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) "` | The format of a git repo when `repo_root_style` is defined. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path separator instead of always using `/` (e.g. `\` on Windows) |
<details>
<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
@ -839,6 +842,21 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
*: This variable can only be used as a part of a style string
<details>
<summary>The git repos have additional variables.</summary>
Let us consider the path `/path/to/home/git_repo/src/lib`
| Variable | مثال | الوصف |
| ------------------ | --------------------- | --------------------------------------- |
| before_root_path | `"/path/to/home/"` | The path before git root directory path |
| repo_root | `"git_repo"` | The git root directory name |
| path | `"/src/lib"` | The remaining path |
| style | `"black bold dimmed"` | Mirrors the value of option `style` |
| repo_root_style | `"underline white"` | Style for git root directory name |
</details>
### مثال
```toml
@ -1045,13 +1063,13 @@ default = "unknown user"
### Options
| Option | الافتراضي | الوصف |
| ----------- | ------------------------------ | ---------------------------------------------------------------------------- |
| `symbol` | `""` | The symbol used before displaying the variable value. |
| `variable` | | The environment variable to be displayed. |
| `الافتراضي` | | The default value to be displayed when the selected variable is not defined. |
| `format` | `"with [$env_value]($style) "` | The format for the module. |
| `disabled` | `false` | Disables the `env_var` module. |
| 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) "` | The format for the module. |
| `disabled` | `false` | Disables the `env_var` module. |
### Variables
@ -1159,13 +1177,14 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### Options
| Option | الافتراضي | الوصف |
| ---------------- | ---------------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `gcloud` module. |
| Option | الافتراضي | الوصف |
| ----------------- | ---------------------------------------------------------- | ---------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `project_aliases` | | Table of project aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `gcloud` module. |
### Variables
@ -1175,7 +1194,7 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
| account | `foo` | The current GCP profile |
| domain | `example.com` | The current GCP profile domain |
| project | | The current GCP project |
| active | `الافتراضي` | The active config name written in `~/.config/gcloud/active_config` |
| active | `default` | The active config name written in `~/.config/gcloud/active_config` |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
@ -1214,6 +1233,17 @@ us-central1 = "uc1"
asia-northeast1 = "an1"
```
#### Display account and aliased project
```toml
# ~/.config/starship.toml
[gcloud]
format = 'on [$symbol$account(@$domain)(\($project\))]($style) '
[gcloud.project_aliases]
very-long-project-name = "vlpn"
```
## Git Branch
The `git_branch` module shows the active branch of the repo in your current directory.
@ -1711,39 +1741,6 @@ The `julia` module shows the currently installed version of [Julia](https://juli
symbol = "∴ "
```
## localip
The `localip` module shows the IPv4 address of the primary network interface.
### Options
| Option | الافتراضي | الوصف |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| Variable | مثال | الوصف |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### مثال
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Kotlin
The `kotlin` module shows the currently installed version of [Kotlin](https://kotlinlang.org/). By default the module will be shown if any of the following conditions are met:
@ -1793,7 +1790,7 @@ kotlin_binary = "kotlinc"
## Kubernetes
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#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`.
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace, user and cluster from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-context --namespace astronaut`. Similarly the user and cluster can be set with `kubectl config set-context starship-context --user starship-user` and `kubectl config set-context starship-context --cluster starship-cluster`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`.
::: tip
@ -1815,8 +1812,10 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
| Variable | مثال | الوصف |
| --------- | -------------------- | ---------------------------------------- |
| context | `starship-cluster` | The current kubernetes context |
| context | `starship-context` | The current kubernetes context name |
| namespace | `starship-namespace` | If set, the current kubernetes namespace |
| user | `starship-user` | If set, the current kubernetes user |
| cluster | `starship-cluster` | If set, the current kubernetes cluster |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
@ -1828,12 +1827,12 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
# ~/.config/starship.toml
[kubernetes]
format = 'on [$context \($namespace\)](dimmed green) '
format = 'on [($user on )($cluster in )$context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
".*/openshift-cluster/.*" = "openshift"
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
#### Regex Matching
@ -1849,12 +1848,12 @@ Long and automatically generated cluster names can be identified and shortened u
# OpenShift contexts carry the namespace and user in the kube context: `namespace/name/user`:
".*/openshift-cluster/.*" = "openshift"
# Or better, to rename every OpenShift cluster at once:
".*/(?P<cluster>[\\w-]+)/.*" = "$cluster"
".*/(?P<var_cluster>[\\w-]+)/.*" = "$var_cluster"
# Contexts from GKE, AWS and other cloud providers usually carry additional information, like the region/zone.
# The following entry matches on the GKE format (`gke_projectname_zone_cluster-name`)
# and renames every matching kube context into a more readable format (`gke-cluster-name`):
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
## Line Break
@ -1876,6 +1875,39 @@ The `line_break` module separates the prompt into two lines.
disabled = true
```
## Local IP
The `localip` module shows the IPv4 address of the primary network interface.
### Options
| Option | الافتراضي | الوصف |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| Variable | مثال | الوصف |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### مثال
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Lua
The `lua` module shows the currently installed version of [Lua](http://www.lua.org/). By default the module will be shown if any of the following conditions are met:
@ -3025,12 +3057,12 @@ By default the module will be shown if any of the following conditions are met:
### Variables
| Variable | مثال | الوصف |
| --------- | ----------- | ------------------------------------ |
| version | `v0.12.24` | The version of `terraform` |
| workspace | `الافتراضي` | The current Terraform workspace |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
| Variable | مثال | الوصف |
| --------- | ---------- | ------------------------------------ |
| version | `v0.12.24` | The version of `terraform` |
| workspace | `default` | The current Terraform workspace |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
@ -3334,7 +3366,7 @@ Format strings can also contain shell specific prompt sequences, e.g. [Bash](htt
| `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`. |
| `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. |

View File

@ -63,7 +63,6 @@ Enable the `programs.starship` module in your `home.nix` file, and add your sett
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;

View File

@ -261,7 +261,9 @@ format = "$all$directory$character"
## AWS
The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials.
The `aws` module shows the current AWS region and profile when credentials or a `credential_process` have been setup. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials.
The module will display a profile only if its credentials are present in `~/.aws/credentials` or a `credential_process` is defined in `~/.aws/config`. Alternatively, having any of the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, or `AWS_SESSION_TOKEN` env vars defined will also suffice.
When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var.
@ -795,19 +797,20 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
### Options
| Option | Default | Description |
| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `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) "` | The format for the module. |
| `style` | `"bold cyan"` | The style for the module. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
| Option | Default | Description |
| ------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `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) "` | The format for the module. |
| `style` | `"bold cyan"` | The style for the module. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo. The default value is equivalent to `style`. |
| `repo_root_format` | `"[$before_root_path]($style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) "` | The format of a git repo when `repo_root_style` is defined. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path separator instead of always using `/` (e.g. `\` on Windows) |
<details>
<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
@ -839,6 +842,21 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
*: This variable can only be used as a part of a style string
<details>
<summary>The git repos have additional variables.</summary>
Let us consider the path `/path/to/home/git_repo/src/lib`
| گۆڕاو | نموونە | Description |
| ------------------ | --------------------- | --------------------------------------- |
| before_root_path | `"/path/to/home/"` | The path before git root directory path |
| repo_root | `"git_repo"` | The git root directory name |
| path | `"/src/lib"` | The remaining path |
| style | `"black bold dimmed"` | Mirrors the value of option `style` |
| repo_root_style | `"underline white"` | Style for git root directory name |
</details>
### نموونە
```toml
@ -1048,7 +1066,7 @@ default = "unknown user"
| Option | Default | Description |
| ---------- | ------------------------------ | ---------------------------------------------------------------------------- |
| `symbol` | `""` | The symbol used before displaying the variable value. |
| `گۆڕاو` | | The environment variable to be displayed. |
| `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) "` | The format for the module. |
| `disabled` | `false` | Disables the `env_var` module. |
@ -1159,13 +1177,14 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### Options
| Option | Default | Description |
| ---------------- | ---------------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `gcloud` module. |
| Option | Default | Description |
| ----------------- | ---------------------------------------------------------- | ---------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `project_aliases` | | Table of project aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `gcloud` module. |
### Variables
@ -1214,6 +1233,17 @@ us-central1 = "uc1"
asia-northeast1 = "an1"
```
#### Display account and aliased project
```toml
# ~/.config/starship.toml
[gcloud]
format = 'on [$symbol$account(@$domain)(\($project\))]($style) '
[gcloud.project_aliases]
very-long-project-name = "vlpn"
```
## Git Branch
The `git_branch` module shows the active branch of the repo in your current directory.
@ -1711,39 +1741,6 @@ The `julia` module shows the currently installed version of [Julia](https://juli
symbol = "∴ "
```
## localip
The `localip` module shows the IPv4 address of the primary network interface.
### Options
| Option | Default | Description |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| گۆڕاو | نموونە | Description |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### نموونە
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Kotlin
The `kotlin` module shows the currently installed version of [Kotlin](https://kotlinlang.org/). By default the module will be shown if any of the following conditions are met:
@ -1793,7 +1790,7 @@ kotlin_binary = "kotlinc"
## Kubernetes
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#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`.
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace, user and cluster from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-context --namespace astronaut`. Similarly the user and cluster can be set with `kubectl config set-context starship-context --user starship-user` and `kubectl config set-context starship-context --cluster starship-cluster`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`.
::: tip
@ -1815,8 +1812,10 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
| گۆڕاو | نموونە | Description |
| --------- | -------------------- | ---------------------------------------- |
| context | `starship-cluster` | The current kubernetes context |
| context | `starship-context` | The current kubernetes context name |
| namespace | `starship-namespace` | If set, the current kubernetes namespace |
| user | `starship-user` | If set, the current kubernetes user |
| cluster | `starship-cluster` | If set, the current kubernetes cluster |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
@ -1828,12 +1827,12 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
# ~/.config/starship.toml
[kubernetes]
format = 'on [$context \($namespace\)](dimmed green) '
format = 'on [($user on )($cluster in )$context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
".*/openshift-cluster/.*" = "openshift"
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
#### Regex Matching
@ -1849,12 +1848,12 @@ Long and automatically generated cluster names can be identified and shortened u
# OpenShift contexts carry the namespace and user in the kube context: `namespace/name/user`:
".*/openshift-cluster/.*" = "openshift"
# Or better, to rename every OpenShift cluster at once:
".*/(?P<cluster>[\\w-]+)/.*" = "$cluster"
".*/(?P<var_cluster>[\\w-]+)/.*" = "$var_cluster"
# Contexts from GKE, AWS and other cloud providers usually carry additional information, like the region/zone.
# The following entry matches on the GKE format (`gke_projectname_zone_cluster-name`)
# and renames every matching kube context into a more readable format (`gke-cluster-name`):
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
## Line Break
@ -1876,6 +1875,39 @@ The `line_break` module separates the prompt into two lines.
disabled = true
```
## Local IP
The `localip` module shows the IPv4 address of the primary network interface.
### Options
| Option | Default | Description |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| گۆڕاو | نموونە | Description |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### نموونە
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Lua
The `lua` module shows the currently installed version of [Lua](http://www.lua.org/). By default the module will be shown if any of the following conditions are met:
@ -2059,12 +2091,12 @@ The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/
### Variables
| گۆڕاو | نموونە | Description |
| --------- | -------- | ------------------------------------ |
| state | `بێخەوش` | The state of the nix-shell |
| name | `lorri` | The name of the nix-shell |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
| گۆڕاو | نموونە | Description |
| --------- | ------- | ------------------------------------ |
| state | `pure` | The state of the nix-shell |
| name | `lorri` | The name of the nix-shell |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string

View File

@ -63,7 +63,6 @@ Enable the `programs.starship` module in your `home.nix` file, and add your sett
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;

View File

@ -261,7 +261,9 @@ format = "$all$directory$character"
## AWS
Das `aws`-Modul zeigt das aktuelle AWS-Profil an. Dies basiert auf den Umgebungsvariablen: `AWS_REGION`, `AWS_DEFAULT_REGION`, `AWS_PROFILE` und der `~/.aws/config` Datei. This module also shows an expiration timer when using temporary credentials.
The `aws` module shows the current AWS region and profile when credentials or a `credential_process` have been setup. Dies basiert auf den Umgebungsvariablen: `AWS_REGION`, `AWS_DEFAULT_REGION`, `AWS_PROFILE` und der `~/.aws/config` Datei. This module also shows an expiration timer when using temporary credentials.
The module will display a profile only if its credentials are present in `~/.aws/credentials` or a `credential_process` is defined in `~/.aws/config`. Alternatively, having any of the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, or `AWS_SESSION_TOKEN` env vars defined will also suffice.
When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var.
@ -360,7 +362,7 @@ style = "blue bold"
## Akkustand
Das `battery` Modul zeigt, wie hoch der Akku des Geräts geladen ist und den aktuellen Ladestatus. Das Modul ist nur sichtbar, wenn der Akku des Geräts unter 10% geladen ist.
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%.
### Optionen
@ -388,7 +390,7 @@ discharging_symbol = "💀 "
### Anzeige des Akkustandes
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). Wenn `display` nicht angegeben ist. Die Standardwerte sind folgende:
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. Die Standardwerte sind folgende:
```toml
[[battery.display]]
@ -400,7 +402,7 @@ The default value for the `charging_symbol` and `discharging_symbol` option is r
#### Optionen
Die `display`-Option beinhaltet ein Array mit den folgenden Werten.
The `display` option is an array of the following table.
| Option | Standardwert | Beschreibung |
| -------------------- | ------------ | --------------------------------------------------------------------------------------------------------- |
@ -426,9 +428,9 @@ discharging_symbol = "💦"
## Zeichen
Das `character` Modul zeigt ein Zeichen ( meistens einen Pfeil "") vor der Texteingabe an.
The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal.
Das Zeichen zeigt an ob der letzte Befehl erfolgreich war, oder einen Fehler erzeugt hat. It can do this in two ways:
The character will tell you whether the last command was successful or not. It can do this in two ways:
- changing color (`red`/`green`)
- changing shape (``/`✖`)
@ -556,15 +558,15 @@ The `cobol` module shows the currently installed version of COBOL. By default, t
## Befehlsdauer
Das `cmd_duration` Modul zeigt an wie lange der letzte Befehl ausgeführt wurde. Das Modul wird nur angezeigt wenn der letzte Befehl länger als zwei Sekunden ausgeführt wurde. Mit der `min_time` Option kann die Zeit eingestellt werden ab der <0>cmd_duration</0> angezeigt wird.
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.
::: warning Nicht die DEBUG-trap in der Bash hooken
::: warning Do not hook the DEBUG trap in Bash
Ist `bash` die Konsole der Wahl, dann nicht die `DEBUG`-trap nach der Ausführung von `eval $(starship init $0)` hooken, andernfalls **wird** dieses Modul unweigerlich untergehen.
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 Nutzer, die eine "preexec" ähnliche Funktion benötigen, können [rcaloras bash_preexec Framework](https://github.com/rcaloras/bash-preexec) verwenden. Definieren Sie einfach die Arrays `preexec_functions` und `precmd_functions` bevor sie `eval $(starship init $0)` ausführen, und fahren Sie dann wie gewohnt fort.
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.
### Optionen
@ -602,9 +604,9 @@ format = "underwent [$duration](bold yellow)"
The `conda` module shows the current [Conda](https://docs.conda.io/en/latest/) environment, if `$CONDA_DEFAULT_ENV` is set.
::: Tipp
::: tip
Hinweis: Dies unterdrückt nicht conda's eigenen Prompt-Modifikator, sie können jedoch conda mit `conda config --set changeps1 False` konfigurieren, um die Ausgabe von conda selbst auszuschalten.
This does not suppress conda's own prompt modifier, you may want to run `conda config --set changeps1 False`.
:::
@ -787,7 +789,7 @@ format = "via [🦕 $version](green bold) "
## Verzeichnis
Das `directory` -Modul zeigt den Pfad zu Ihrem aktuellen Verzeichnis an, abgeschnitten auf drei übergeordnete Ordner. Your directory will also be truncated to the root of the git repo that you're currently in.
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.
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.
@ -795,22 +797,23 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
### Optionen
| Option | Standardwert | Beschreibung |
| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `truncation_length` | `3` | Die Anzahl der übergeordneten Ordner, die angezeigt werden. |
| `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) "` | Das Format für das Modul. |
| `style` | `"bold cyan"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `directory`-Modul. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
| Option | Standardwert | Beschreibung |
| ------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `truncation_length` | `3` | Die Anzahl der übergeordneten Ordner, die angezeigt werden. |
| `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) "` | Das Format für das Modul. |
| `style` | `"bold cyan"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `directory`-Modul. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo. The default value is equivalent to `style`. |
| `repo_root_format` | `"[$before_root_path]($style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) "` | The format of a git repo when `repo_root_style` is defined. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path separator instead of always using `/` (e.g. `\` on Windows) |
<details>
<summary>Dieses Modul hat einige erweiterte Konfigurationsoptionen, welche die Darstellung von Verzeichnissen steuern.</summary>
<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
| Advanced Option | Standardwert | Beschreibung |
| --------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@ -839,6 +842,21 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
*: This variable can only be used as a part of a style string
<details>
<summary>The git repos have additional variables.</summary>
Let us consider the path `/path/to/home/git_repo/src/lib`
| Variable | Beispiel | Beschreibung |
| ------------------ | --------------------- | --------------------------------------- |
| before_root_path | `"/path/to/home/"` | The path before git root directory path |
| repo_root | `"git_repo"` | The git root directory name |
| path | `"/src/lib"` | The remaining path |
| style | `"black bold dimmed"` | Spiegelt den Wert der Option `style` |
| repo_root_style | `"underline white"` | Style for git root directory name |
</details>
### Beispiel
```toml
@ -912,13 +930,13 @@ The module will also show the Target Framework Moniker (<https://docs.microsoft.
| ------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )(🎯 $tfm )]($style)"` | Das Format für das Modul. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `".NET "` | Symbol das vor der dotnet-Version angezeigt wird. |
| `heuristic` | `true` | Schnelle Versionserkennung nutzen um Starship bedienbar zu halten. |
| `symbol` | `".NET "` | The symbol used before displaying the version of dotnet. |
| `heuristic` | `true` | Use faster version detection to keep starship snappy. |
| `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"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `dotnet`-Modul. |
| `disabled` | `false` | Disables the `dotnet` module. |
### Variables
@ -1045,13 +1063,13 @@ default = "unknown user"
### Optionen
| Option | Standardwert | Beschreibung |
| ---------- | ------------------------------ | ---------------------------------------------------------------------------------------- |
| `symbol` | `""` | Das Symbol, das vor der Anzeige der Variable verwendet wird. |
| `variable` | | Die anzuzeigende Umgebungsvariable. |
| `default` | | Der Standardwert, der angezeigt wird, wenn die ausgewählte Variable nicht definiert ist. |
| `format` | `"with [$env_value]($style) "` | Das Format für das Modul. |
| `disabled` | `false` | Deaktiviert das `env_var`-Modul. |
| Option | Standardwert | Beschreibung |
| ---------- | ------------------------------ | ---------------------------------------------------------------------------- |
| `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) "` | Das Format für das Modul. |
| `disabled` | `false` | Disables the `env_var` module. |
### Variables
@ -1159,13 +1177,14 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### Optionen
| Option | Standardwert | Beschreibung |
| ---------------- | ---------------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | Das Format für das Modul. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | Stil für dieses Modul. |
| `disabled` | `false` | Disables the `gcloud` module. |
| Option | Standardwert | Beschreibung |
| ----------------- | ---------------------------------------------------------- | ---------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | Das Format für das Modul. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `project_aliases` | | Table of project aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | Stil für dieses Modul. |
| `disabled` | `false` | Disables the `gcloud` module. |
### Variables
@ -1214,9 +1233,20 @@ us-central1 = "uc1"
asia-northeast1 = "an1"
```
#### Display account and aliased project
```toml
# ~/.config/starship.toml
[gcloud]
format = 'on [$symbol$account(@$domain)(\($project\))]($style) '
[gcloud.project_aliases]
very-long-project-name = "vlpn"
```
## Git-Branch
Das `git_branch`-Modul zeigt den aktiven Git-Branch des Repositories im aktuellen Verzeichnis an.
The `git_branch` module shows the active branch of the repo in your current directory.
### Optionen
@ -1229,7 +1259,7 @@ Das `git_branch`-Modul zeigt den aktiven Git-Branch des Repositories im aktuelle
| `truncation_length` | `2^63 - 1` | Truncates a git branch to `N` 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` | Deaktiviert das `git_branch`-Modul. |
| `disabled` | `false` | Disables the `git_branch` module. |
### Variables
@ -1306,7 +1336,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"` | Stil für dieses Modul. |
| `format` | `'\([$state( $progress_current/$progress_total)]($style)\) '` | Das Format für das Modul. |
| `disabled` | `false` | Deaktiviert das `git_state`-Modul. |
| `disabled` | `false` | Disables the `git_state` module. |
### Variables
@ -1335,7 +1365,7 @@ The `git_metrics` module will show the number of added and deleted lines in the
::: tip
Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren.
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -1392,7 +1422,7 @@ The `git_status` module shows symbols representing the state of the repo in your
| `deleted` | `"✘"` | The format of `deleted` |
| `style` | `"bold red"` | Stil für dieses Modul. |
| `ignore_submodules` | `false` | Ignore changes to submodules. |
| `disabled` | `false` | Deaktiviert das `git_status`-Modul. |
| `disabled` | `false` | Disables the `git_status` module. |
### Variables
@ -1480,7 +1510,7 @@ The `golang` module shows the currently installed version of [Go](https://golang
| `detect_files` | `["go.mod", "go.sum", "glide.yaml", "Gopkg.yml", "Gopkg.lock", ".go-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `["Godeps"]` | Which folders should trigger this module. |
| `style` | `"bold cyan"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `golang`-Modul. |
| `disabled` | `false` | Disables the `golang` module. |
### Variables
@ -1542,17 +1572,17 @@ format = "via [⎈ $version](bold white) "
## Hostname
Das `hostname`-Modul zeigt den Hostnamen des Systems an.
The `hostname` module shows the system hostname.
### Optionen
| Option | Standardwert | Beschreibung |
| ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `ssh_only` | `true` | Zeigt den Hostnamen nur, wenn via SSH-Sitzung verbunden. |
| `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 "` | Das Format für das Modul. |
| `style` | `"bold dimmed green"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `hostname`-Modul. |
| `disabled` | `false` | Disables the `hostname` module. |
### Variables
@ -1593,7 +1623,7 @@ The `java` module shows the currently installed version of [Java](https://www.or
| `detect_folders` | `[]` | Which folders should trigger this modules. |
| `symbol` | `"☕ "` | A format string representing the symbol of Java |
| `style` | `"red dimmed"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `Java`-Modul. |
| `disabled` | `false` | Disables the `java` module. |
### Variables
@ -1638,15 +1668,15 @@ The `threshold` option is deprecated, but if you want to use it, the module will
### Optionen
| Option | Standardwert | Beschreibung |
| ------------------ | ----------------------------- | -------------------------------------------------------------------------------- |
| `threshold`* | `1` | Zeigt die Anzahl der Jobs wenn der angegebene Schwellenwert überschritten wurde. |
| `symbol_threshold` | `1` | Show `symbol` if the job count is at least `symbol_threshold`. |
| `number_threshold` | `2` | Show the number of jobs if the job count is at least `number_threshold`. |
| `format` | `"[$symbol$number]($style) "` | Das Format für das Modul. |
| `symbol` | `"✦"` | The string used to represent the `symbol` variable. |
| `style` | `"bold blue"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `jobs`-Modul. |
| Option | Standardwert | Beschreibung |
| ------------------ | ----------------------------- | ------------------------------------------------------------------------ |
| `threshold`* | `1` | Show number of jobs if exceeded. |
| `symbol_threshold` | `1` | Show `symbol` if the job count is at least `symbol_threshold`. |
| `number_threshold` | `2` | Show the number of jobs if the job count is at least `number_threshold`. |
| `format` | `"[$symbol$number]($style) "` | Das Format für das Modul. |
| `symbol` | `"✦"` | The string used to represent the `symbol` variable. |
| `style` | `"bold blue"` | Stil für dieses Modul. |
| `disabled` | `false` | Disables the `jobs` module. |
*: This option is deprecated, please use the `number_threshold` and `symbol_threshold` options instead.
@ -1711,39 +1741,6 @@ The `julia` module shows the currently installed version of [Julia](https://juli
symbol = "∴ "
```
## localip
The `localip` module shows the IPv4 address of the primary network interface.
### Optionen
| Option | Standardwert | Beschreibung |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | Das Format für das Modul. |
| `style` | `"bold yellow"` | Stil für dieses Modul. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| Variable | Beispiel | Beschreibung |
| --------- | ------------ | ------------------------------------ |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Spiegelt den Wert der Option `style` |
*: This variable can only be used as a part of a style string
### Beispiel
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Kotlin
The `kotlin` module shows the currently installed version of [Kotlin](https://kotlinlang.org/). By default the module will be shown if any of the following conditions are met:
@ -1793,11 +1790,11 @@ kotlin_binary = "kotlinc"
## Kubernetes
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#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`.
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace, user and cluster from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-context --namespace astronaut`. Similarly the user and cluster can be set with `kubectl config set-context starship-context --user starship-user` and `kubectl config set-context starship-context --cluster starship-cluster`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`.
::: Tipp
::: tip
Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren.
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -1809,14 +1806,16 @@ Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `dis
| `format` | `'[$symbol$context( \($namespace\))]($style) in '` | Das Format für das Modul. |
| `style` | `"cyan bold"` | Stil für dieses Modul. |
| `context_aliases` | | Table of context aliases to display. |
| `disabled` | `true` | Deaktiviert das `kubernetes`-Modul. |
| `disabled` | `true` | Disables the `kubernetes` module. |
### Variables
| Variable | Beispiel | Beschreibung |
| --------- | -------------------- | ---------------------------------------- |
| context | `starship-cluster` | The current kubernetes context |
| context | `starship-context` | The current kubernetes context name |
| namespace | `starship-namespace` | If set, the current kubernetes namespace |
| user | `starship-user` | If set, the current kubernetes user |
| cluster | `starship-cluster` | If set, the current kubernetes cluster |
| symbol | | Spiegelt den Wert der Option `symbol` |
| style\* | | Spiegelt den Wert der Option `style` |
@ -1828,12 +1827,12 @@ Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `dis
# ~/.config/starship.toml
[kubernetes]
format = 'on [$context \($namespace\)](dimmed green) '
format = 'on [($user on )($cluster in )$context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
".*/openshift-cluster/.*" = "openshift"
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
#### Regex Matching
@ -1849,23 +1848,23 @@ Long and automatically generated cluster names can be identified and shortened u
# OpenShift contexts carry the namespace and user in the kube context: `namespace/name/user`:
".*/openshift-cluster/.*" = "openshift"
# Or better, to rename every OpenShift cluster at once:
".*/(?P<cluster>[\\w-]+)/.*" = "$cluster"
".*/(?P<var_cluster>[\\w-]+)/.*" = "$var_cluster"
# Contexts from GKE, AWS and other cloud providers usually carry additional information, like the region/zone.
# The following entry matches on the GKE format (`gke_projectname_zone_cluster-name`)
# and renames every matching kube context into a more readable format (`gke-cluster-name`):
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
## Zeilenumbruch
## Line Break
Das `line_break`-Modul unterteilt den Prompt in zwei Zeilen.
The `line_break` module separates the prompt into two lines.
### Optionen
| Option | Standardwert | Beschreibung |
| ---------- | ------------ | ---------------------------------------------------------------------- |
| `disabled` | `false` | Deaktiviert das `line_break`-Modul, wodurch der Prompt einzeilig wird. |
| Option | Standardwert | Beschreibung |
| ---------- | ------------ | ------------------------------------------------------------------ |
| `disabled` | `false` | Disables the `line_break` module, making the prompt a single line. |
### Beispiel
@ -1876,6 +1875,39 @@ Das `line_break`-Modul unterteilt den Prompt in zwei Zeilen.
disabled = true
```
## Local IP
The `localip` module shows the IPv4 address of the primary network interface.
### Optionen
| Option | Standardwert | Beschreibung |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | Das Format für das Modul. |
| `style` | `"bold yellow"` | Stil für dieses Modul. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| Variable | Beispiel | Beschreibung |
| --------- | ------------ | ------------------------------------ |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Spiegelt den Wert der Option `style` |
*: This variable can only be used as a part of a style string
### Beispiel
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Lua
The `lua` module shows the currently installed version of [Lua](http://www.lua.org/). By default the module will be shown if any of the following conditions are met:
@ -1919,25 +1951,25 @@ format = "via [🌕 $version](bold blue) "
## Speicherauslastung
Das `memory_usage` Modul zeigt den aktuellen Systemspeicher und die swap-Nutzung an.
The `memory_usage` module shows current system memory and swap usage.
Standardmäßig wird die swap-Nutzung angezeigt, wenn der gesamte System-swap nicht Null ist.
By default the swap usage is displayed if the total system swap is non-zero.
::: Tipp
::: tip
Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren.
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### Optionen
| Option | Standardwert | Beschreibung |
| ----------- | ----------------------------------------------- | --------------------------------------------------------------------- |
| `threshold` | `75` | Speicherauslastung ausblenden, wenn sie unter diesem Prozentsatz ist. |
| `format` | `"via $symbol [${ram}( \| ${swap})]($style) "` | Das Format für das Modul. |
| `symbol` | `"🐏"` | Symbol das vor der Speicherauslastung angezeigt wird. |
| `style` | `"bold dimmed white"` | Stil für dieses Modul. |
| `disabled` | `true` | Deaktiviert das `memory_usage`-Modul. |
| Option | Standardwert | Beschreibung |
| ----------- | ----------------------------------------------- | -------------------------------------------------------- |
| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. |
| `format` | `"via $symbol [${ram}( \| ${swap})]($style) "` | Das Format für das Modul. |
| `symbol` | `"🐏"` | The symbol used before displaying the memory usage. |
| `style` | `"bold dimmed white"` | Stil für dieses Modul. |
| `disabled` | `true` | Disables the `memory_usage` module. |
### Variables
@ -2013,7 +2045,7 @@ The `nim` module shows the currently installed version of [Nim](https://nim-lang
| Option | Standardwert | Beschreibung |
| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | Das Format für das Modul |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. |
| `detect_extensions` | `["nim", "nims", "nimble"]` | Which extensions should trigger this module. |
@ -2044,7 +2076,7 @@ symbol = "🎣 "
## Nix-Shell
The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/developing-with-nix-shell.html) environment. Das Modul wird angezeigt, wenn es sich in einer nix-Shell-Umgebung befindet.
The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/developing-with-nix-shell.html) environment. The module will be shown when inside a nix-shell environment.
### Optionen
@ -2055,7 +2087,7 @@ The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/
| `style` | `"bold blue"` | Stil für dieses Modul. |
| `impure_msg` | `"impure"` | A format string shown when the shell is impure. |
| `pure_msg` | `"pure"` | A format string shown when the shell is pure. |
| `disabled` | `false` | Deaktiviert das `nix_shell`-Modul. |
| `disabled` | `false` | Disables the `nix_shell` module. |
### Variables
@ -2102,7 +2134,7 @@ The `nodejs` module shows the currently installed version of [Node.js](https://n
| `detect_files` | `["package.json", ".node-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `["node_modules"]` | Which folders should trigger this module. |
| `style` | `"bold green"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `nodejs`-Modul. |
| `disabled` | `false` | Disables the `nodejs` module. |
| `not_capable_style` | `bold red` | The style for the module when an engines property in package.json does not match the Node.js version. |
### Variables
@ -2208,7 +2240,7 @@ symbol = "☁️ "
## Paketversion
Das `Package` Modul wird angezeigt, wenn das aktuelle Verzeichnis das Repository für ein Paket ist, und zeigt dessen aktuelle Version an. The module currently supports `npm`, `nimble`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix`, `helm`, `shards` and `dart` packages.
The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `nimble`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix`, `helm`, `shards` and `dart` packages.
- [**npm**](https://docs.npmjs.com/cli/commands/npm) The `npm` package version is extracted from the `package.json` present in the current directory
- [**Cargo**](https://doc.rust-lang.org/cargo/) The `cargo` package version is extracted from the `Cargo.toml` present in the current directory
@ -2234,11 +2266,11 @@ Das `Package` Modul wird angezeigt, wenn das aktuelle Verzeichnis das Repository
| Option | Standardwert | Beschreibung |
| ----------------- | --------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"is [$symbol$version]($style) "` | Das Format für das Modul. |
| `symbol` | `"📦 "` | Symbol das vor der Paketversion angezeigt wird. |
| `symbol` | `"📦 "` | The symbol used before displaying the version the package. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `style` | `"bold 208"` | Stil für dieses Modul. |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | Deaktiviert das `package`-Modul. |
| `disabled` | `false` | Disables the `package` module. |
### Variables
@ -2313,12 +2345,12 @@ The `php` module shows the currently installed version of [PHP](https://www.php.
| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | Das Format für das Modul. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `"🐘 "` | Symbol das vor der PHP-Version angezeigt wird. |
| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. |
| `detect_extensions` | `["php"]` | Which extensions should trigger this module. |
| `detect_files` | `["composer.json", ".php-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this module. |
| `style` | `"147 bold"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `php`-Modul. |
| `disabled` | `false` | Disables the `php` module. |
### Variables
@ -2343,7 +2375,7 @@ format = "via [🔹 $version](147 bold) "
The `pulumi` module shows the current username, selected [Pulumi Stack](https://www.pulumi.com/docs/intro/concepts/stack/), and version.
::: Tipp
::: tip
By default the Pulumi version is not shown, since it takes an order of magnitude longer to load then most plugins (~70ms). If you still want to enable it, [follow the example shown below](#with-pulumi-version).
@ -2366,13 +2398,13 @@ By default the module will be shown if any of the following conditions are met:
### Variables
| Variable | Beispiel | Beschreibung |
| ------------ | ---------- | ------------------------------------- |
| version | `v0.12.24` | The version of `pulumi` |
| stack | `dev` | The current Pulumi stack |
| benutzername | `alice` | The current Pulumi username |
| symbol | | Spiegelt den Wert der Option `symbol` |
| style\* | | Spiegelt den Wert der Option `style` |
| Variable | Beispiel | Beschreibung |
| --------- | ---------- | ------------------------------------- |
| version | `v0.12.24` | The version of `pulumi` |
| stack | `dev` | The current Pulumi stack |
| username | `alice` | The current Pulumi username |
| symbol | | Spiegelt den Wert der Option `symbol` |
| style\* | | Spiegelt den Wert der Option `style` |
*: This variable can only be used as a part of a style string
@ -2461,15 +2493,15 @@ By default the module will be shown if any of the following conditions are met:
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `"🐍 "` | A format string representing the symbol of Python |
| `style` | `"yellow bold"` | Stil für dieses Modul. |
| `pyenv_version_name` | `false` | Verwende `pyenv` um die Python-Versionzu beziehen. |
| `pyenv_version_name` | `false` | Use pyenv to get Python version |
| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used |
| `python_binary` | `["python", "python3", "python2"]` | Configures the python binaries that Starship should executes when getting the version. |
| `detect_extensions` | `["py"]` | Which extensions should trigger this module |
| `detect_files` | `[".python-version", "Pipfile", "__init__.py", "pyproject.toml", "requirements.txt", "setup.py", "tox.ini"]` | Which filenames should trigger this module |
| `detect_folders` | `[]` | Which folders should trigger this module |
| `disabled` | `false` | Deaktiviert das `python`-Modul. |
| `disabled` | `false` | Disables the `python` module. |
::: Tipp
::: tip
The `python_binary` variable accepts either a string or a list of strings. Starship will try executing each binary until it gets a result. Note you can only change the binary that Starship executes to get the version of Python not the arguments that are used.
@ -2568,7 +2600,7 @@ format = "with [📐 $version](blue bold) "
## Red
By default the `red` module shows the currently installed version of [Red](https://www.red-lang.org/). Das Modul wird nur dann angezeigt, wenn eine der folgenden Bedingungen zutrifft:
By default the `red` module shows the currently installed version of [Red](https://www.red-lang.org/). The module will be shown if any of the following conditions are met:
- The current directory contains a file with `.red` or `.reds` extension
@ -2606,7 +2638,7 @@ symbol = "🔴 "
## Ruby
By default the `ruby` module shows the currently installed version of [Ruby](https://www.ruby-lang.org/). Das Modul wird nur dann angezeigt, wenn eine der folgenden Bedingungen zutrifft:
By default the `ruby` module shows the currently installed version of [Ruby](https://www.ruby-lang.org/). The module will be shown if any of the following conditions are met:
- Das aktuelle Verzeichnis enthält eine `Gemfile`-Datei
- The current directory contains a `.ruby-version` file
@ -2627,7 +2659,7 @@ Starship gets the current Ruby version by running `ruby -v`.
| `detect_folders` | `[]` | Which folders should trigger this module. |
| `detect_variables` | `["RUBY_VERSION", "RBENV_VERSION"]` | Which environment variables should trigger this module. |
| `style` | `"bold red"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `ruby`-Modul. |
| `disabled` | `false` | Disables the `ruby` module. |
### Variables
@ -2650,7 +2682,7 @@ symbol = "🔺 "
## Rust
By default the `rust` module shows the currently installed version of [Rust](https://www.rust-lang.org/). Das Modul wird nur dann angezeigt, wenn eine der folgenden Bedingungen zutrifft:
By default the `rust` module shows the currently installed version of [Rust](https://www.rust-lang.org/). The module will be shown if any of the following conditions are met:
- Das aktuelle Verzeichnis enthält eine `Cargo.toml`-Datei
- Das aktuelle Verzeichnis enthält eine Datei mit der `.rs`-Erweiterung
@ -2666,7 +2698,7 @@ By default the `rust` module shows the currently installed version of [Rust](htt
| `detect_files` | `["Cargo.toml"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this module. |
| `style` | `"bold red"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `rust`-Modul. |
| `disabled` | `false` | Disables the `rust` module. |
### Variables
@ -2731,9 +2763,9 @@ symbol = "🌟 "
The `shell` module shows an indicator for currently used shell.
::: Tipp
::: tip
Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren.
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -2761,7 +2793,7 @@ Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `dis
| Variable | Standardwert | Beschreibung |
| --------- | ------------ | ---------------------------------------------------------- |
| indicator | | Mirrors the value of `indicator` for currently used shell. |
| style\* | | Spiegelt den Wert der Option `style`. |
| style\* | | Mirrors the value of option `style`. |
*: This variable can only be used as a part of a style string
@ -2850,9 +2882,9 @@ format = '[📦 \[$env\]]($style) '
The `status` module displays the exit code of the previous command. The module will be shown only if the exit code is not `0`. The status code will cast to a signed 32-bit integer.
::: Tipp
::: tip
Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren.
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -2911,9 +2943,9 @@ disabled = false
The `sudo` module displays if sudo credentials are currently cached. The module will only be shown if credentials are cached.
::: Tipp
::: tip
Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren.
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -2958,7 +2990,7 @@ disabled = false
## Swift
By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). Das Modul wird nur dann angezeigt, wenn eine der folgenden Bedingungen zutrifft:
By default the `swift` module shows the currently installed version of [Swift](https://swift.org/). The module will be shown if any of the following conditions are met:
- The current directory contains a `Package.swift` file
- The current directory contains a file with the `.swift` extension
@ -2999,7 +3031,7 @@ format = "via [🏎 $version](red bold)"
The `terraform` module shows the currently selected [Terraform workspace](https://www.terraform.io/docs/language/state/workspaces.html) and version.
::: Tipp
::: tip
By default the Terraform version is not shown, since this is slow for current versions of Terraform when a lot of plugins are in use. If you still want to enable it, [follow the example shown below](#with-terraform-version).
@ -3021,7 +3053,7 @@ By default the module will be shown if any of the following conditions are met:
| `detect_files` | `[]` | Which filenames should trigger this module. |
| `detect_folders` | `[".terraform"]` | Which folders should trigger this module. |
| `style` | `"bold 105"` | Stil für dieses Modul. |
| `disabled` | `false` | Deaktiviert das `terraform` Modul. |
| `disabled` | `false` | Disables the `terraform` module. |
### Variables
@ -3056,33 +3088,33 @@ format = "[🏎💨 $workspace]($style) "
## Zeit
Das `time` Modul zeigt die aktuelle **lokale** Zeit an. Der `format` Wert wird von der crate [`chrono`](https://crates.io/crates/chrono) benutzt um die Zeit zu formatieren. Schau dir [die chrono strftime Dokumentation](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) an, um die möglichen Optionen zu sehen.
The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available.
::: Tipp
::: tip
Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren.
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### Optionen
| Option | Standardwert | Beschreibung |
| ----------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `format` | `"at [$time]($style) "` | The format string for the module. |
| `use_12hr` | `false` | Aktiviert die Formatierung der Uhrzeit im 12-Stunden-Format. |
| `time_format` | Siehe unten | Das Format zum Anzeigen der Uhrzeit in [chrono-Formatierung](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html). |
| `style` | `"bold yellow"` | Stil für dieses Modul. |
| `utc_time_offset` | `"local"` | Legt das UTC-Offset fest, das verwendet werden soll. Range from -24 &lt; x &lt; 24. Allows floats to accommodate 30/45 minute timezone offsets. |
| `disabled` | `true` | Deaktiviert das `time`-Modul. |
| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format |
| Option | Standardwert | Beschreibung |
| ----------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `format` | `"at [$time]($style) "` | The format string for the module. |
| `use_12hr` | `false` | Enables 12 hour formatting |
| `time_format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `"bold yellow"` | The style for the module time |
| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 &lt; x &lt; 24. Allows floats to accommodate 30/45 minute timezone offsets. |
| `disabled` | `true` | Disables the `time` module. |
| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format |
If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Ansonsten ist der Standardwert hierfür `"%T"`. Manually setting `time_format` will override the `use_12hr` setting.
If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting.
### Variables
| Variable | Beispiel | Beschreibung |
| --------- | ---------- | ------------------------------------ |
| uhrzeit | `13:08:10` | The current time. |
| time | `13:08:10` | The current time. |
| style\* | | Spiegelt den Wert der Option `style` |
*: This variable can only be used as a part of a style string
@ -3102,14 +3134,14 @@ time_range = "10:00:00-14:00:00"
## Benutzername
Das Modul `username` zeigt den Benutzernamen des aktiven Benutzers. Das Modul wird nur dann angezeigt, wenn eine der folgenden Bedingungen zutrifft:
The `username` module shows active user's username. The module will be shown if any of the following conditions are met:
- Der aktuelle Benutzer ist root
- Der aktuelle Benutzer ist nicht derjenige, der derzeit angemeldet ist
- Der Benutzer ist über eine SSH-Sitzung verbunden
- Die Variale `show_always` ist auf `true` gesetzt
::: Tipp
::: tip
SSH connection is detected by checking environment variables `SSH_CONNECTION`, `SSH_CLIENT`, and `SSH_TTY`. If your SSH host does not set up these variables, one workaround is to set one of them with a dummy value.
@ -3117,13 +3149,13 @@ SSH connection is detected by checking environment variables `SSH_CONNECTION`, `
### Optionen
| Option | Standardwert | Beschreibung |
| ------------- | ----------------------- | --------------------------------- |
| `style_root` | `"bold red"` | Stil beim root-Benutzer. |
| `style_user` | `"bold yellow"` | Stil bei allen anderen Benutzern. |
| `format` | `"[$user]($style) in "` | Das Format für das Modul. |
| `show_always` | `false` | `username`-Modul immer anzeigen. |
| `disabled` | `false` | Deaktiviert das `username`-Modul. |
| Option | Standardwert | Beschreibung |
| ------------- | ----------------------- | ------------------------------------- |
| `style_root` | `"bold red"` | The style used when the user is root. |
| `style_user` | `"bold yellow"` | The style used for non-root users. |
| `format` | `"[$user]($style) in "` | Das Format für das Modul. |
| `show_always` | `false` | Always shows the `username` module. |
| `disabled` | `false` | Disables the `username` module. |
### Variables
@ -3253,7 +3285,7 @@ format = "[🆅 $repo](bold blue) "
## Zig
By default the the `zig` module shows the currently installed version of [Zig](https://ziglang.org/). Das Modul wird nur dann angezeigt, wenn eine der folgenden Bedingungen zutrifft:
By default the the `zig` module shows the currently installed version of [Zig](https://ziglang.org/). The module will be shown if any of the following conditions are met:
- The current directory contains a `.zig` file
@ -3301,19 +3333,19 @@ These modules will be shown if any of the following conditions are met:
- The `when` command returns 0
- The current Operating System (std::env::consts::OS) matchs with `os` field if defined.
::: Tipp
::: tip
Multiple custom modules can be defined by using a `.`.
:::
::: Tipp
::: tip
The order in which custom modules are shown can be individually set by including `${custom.foo}` in the top level `format` (as it includes a dot, you need to use `${...}`). By default, the `custom` module will simply show all custom modules in the order they were defined.
:::
::: Tipp
::: tip
[Issue #1252](https://github.com/starship/starship/discussions/1252) contains examples of custom modules. If you have an interesting example not covered there, feel free to share it there!
@ -3329,20 +3361,20 @@ Format strings can also contain shell specific prompt sequences, e.g. [Bash](htt
### Optionen
| Option | Standardwert | Beschreibung |
| -------------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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) |
| `beschreibung` | `"<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"` | Stil für dieses Modul. |
| `format` | `"[$symbol($output )]($style)"` | Das Format für das Modul. |
| `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). |
| Option | Standardwert | Beschreibung |
| ------------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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"` | Stil für dieses Modul. |
| `format` | `"[$symbol($output )]($style)"` | Das Format für das Modul. |
| `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

View File

@ -63,7 +63,6 @@ Aktivieren Sie das Modul `programs.starship` in Ihrer `home.nix`-Datei und füge
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;

View File

@ -18,7 +18,7 @@ features:
footer: Bajo una licencia ISC | Derechos de autor © 2019-presente Colaboradores de Starship
#Used for the description meta tag, for SEO
metaTitle: "Starship: el prompt multi-intérprete"
description: '¡Starship es el prompt minimalista, ultrarápido e infinitamente personalizable para cualquier intérprete de comandos! Muestra la información que necesitas, a la par que es elegante y minimalista. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and PowerShell.'
description: '¡Starship es el prompt minimalista, ultrarápido e infinitamente personalizable para cualquier intérprete de comandos! Muestra la información que necesitas, a la par que es elegante y minimalista. Instalación rápida disponible para Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, y PowerShell.'
---
<div class="center">
@ -168,7 +168,7 @@ description: '¡Starship es el prompt minimalista, ultrarápido e infinitamente
#### Cmd
You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory:
Necesitas usar [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) con Cmd. Añade lo siguiente a un archivo `starship.lua` y coloca este archivo en el directorio de scripts de Clink:
```lua
-- starship.lua

View File

@ -8,11 +8,11 @@ Las configuraciones de esta sección están sujetos a cambios en futuras version
:::
## Custom pre-prompt and pre-execution Commands in Cmd
## Comandos pre-prompt y pre-ejecución personalizados en Cmd
Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements:
Clink proporciona una API extremadamente flexible para ejecutar comandos pre-prompt y pre-ejecución en la shell de Cmd. Es bastante sencillo de usar con Starship. Haz los siguientes cambios a tu archivo `starship.lua` según tus requisitos:
- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do
- Para ejecutar una función personalizada justo antes de dibujar la shell, defina una nueva función llamada `starship_preprompt_user_func`. Esta función recibe el prompt actual como una cadena que puedes utilizar. Por ejemplo, para dibujar un cohete antes del prompt, podrías hacer lo siguiente
```lua
function starship_preprompt_user_func(prompt)
@ -22,7 +22,7 @@ end
load(io.popen('starship init cmd'):read("*a"))()
```
- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do
- Para ejecutar una función personalizada justo antes de ejecutar un comando, define una nueva función llamada `starship_precmd_user_func`. Esta función recibe la línea de comandos actual como una cadena que se puede utilizar. Por ejemplo, para imprimir el comando que va a ser ejecutado, escribirías
```lua
function starship_precmd_user_func(line)
@ -71,7 +71,7 @@ function Invoke-Starship-PreCommand {
## Cambiar título de la ventana
Algunos intérpretes de comandos van a cambiar automáticamente el título de la ventana por ti (p. ej., para mostrar tu directorio actual). Fish incluso lo hace por defecto. Starship does not do this, but it's fairly straightforward to add this functionality to `bash`, `zsh`, `cmd` or `powershell`.
Algunos intérpretes de comandos van a cambiar automáticamente el título de la ventana por ti (p. ej., para mostrar tu directorio actual). Fish incluso lo hace por defecto. Starship no hace esto, pero es bastante sencillo añadir esta funcionalidad a `bash`, `zsh`, `cmd` o `powershell`.
Primero, define una función para el cambio de título de la ventana (idéntico en Bash y zsh):
@ -106,7 +106,7 @@ function set_win_title(){
starship_precmd_user_func="set_win_title"
```
For Cmd, you can change the window title using the `starship_preprompt_user_func` function.
Para Cmd, puedes cambiar el título de la ventana usando la función `starship_preprompt_user_func`.
```lua
function starship_preprompt_user_func(prompt)
@ -133,7 +133,7 @@ Algunos intérpretes de órdenes soportan un prompt derecho que se renderiza en
Nota: El prompt derecho es una sola línea siguiendo la ubicación de entrada. Para alinear módulos arriba de la línea de entrada en un prompt multi-línea, vea el [módulo fill](/config/#fill).
`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd.
`right_format` está actualmente soportado para los siguientes intérpretes de comandos: elvish, fish, zsh, xonsh, cmd.
### Ejemplo
@ -153,15 +153,15 @@ Produce un prompt como el siguiente:
▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s
```
## Continuation Prompt
## Prompt de continuación
Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote).
Algunos intérpretes de comandos admiten un prompt de continuacion junto con el prompt normal. Este prompt es renderizado en lugar del prompt normal cuando el usuario ha introducido una orden incompleta (como solamente un paréntesis izquierdo o comilla).
Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`.
Starship puede establecer el prompt de continuación usando la opción `continuation_prompt`. El prompt por defecto es `"[∙](bright-black) "`.
Note: `continuation_prompt` should be set to a literal string without any variables.
Nota: `continuation_prompt` debe establecerse en una cadena literal sin ninguna variable.
Note: Continuation prompts are only available in the following shells:
Nota: Los prompts de continuación solo están disponibles en los siguientes intérpretes de comandos:
- `bash`
- `zsh`
@ -172,7 +172,7 @@ Note: Continuation prompts are only available in the following shells:
```toml
# ~/.config/starship.toml
# A continuation prompt that displays two filled in arrows
# Un prompt de continuación que muestra dos flechas rellenas
continuation_prompt = "▶▶"
```
@ -196,7 +196,7 @@ El token `none` anula todos los demás tokens en una cadena si no es parte de un
Un especificador de color puede ser uno de los siguientes:
- One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`).
- Uno de los colores estándar del terminal: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. Opcionalmente puede prefijar estos con `bright-` para obtener la versión brillante (por ejemplo, `bright-white`).
- Un `#` seguido de un número hexadecimal de seis dígitos. Esto especifica un [código hexadecimal de color RGB](https://www.w3schools.com/colors/colors_hexadecimal.asp).
- Un número entre 0-255. Esto especifica un [Código de color ANSI de 8-bits](https://i.stack.imgur.com/KTSQa.png).

File diff suppressed because it is too large Load Diff

View File

@ -56,34 +56,34 @@ Si obtienes un error como "_version 'GLIBC_2.18' not found (required by starship
sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --platform unknown-linux-musl
```
## Why do I see `Executing command "..." timed out.` warnings?
## ¿Por qué veo advertencias `Executing command"..." timed out.`?
Starship executes different commands to get information to display in the prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected behaviour. This time limit is configurable using the [`command_timeout`key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings.
Starship ejecuta diferentes comandos para obtener la información que se muestra en el prompt, por ejemplo la versión de un programa o el estado actual de git. Para asegurarse que starship no se quede congelado mientras trata de ejecutar estos comandos, establecimos un límite de tiempo, si un comando tarda más tiempo que este límite starship detendrá la ejecución del comando y mostrara la advertencia anterior, este es el comportamiento esperado. Este límite de tiempo es configurable usando la [llave `command_timeout`](/config/#prompt) así que si lo desea puede aumentar el límite de tiempo. También puedes seguir los pasos de depuración a continuación para ver qué comando está siendo lento y ver si puedes optimizarlo. Finalmente, puedes establecer la variable de entorno `STARSHIP_LOG` a `error` para ocultar estas advertencias.
## Veo símbolos que no entiendo ni espero, ¿qué significan?
Si ves símbolos que no reconoces, puedes usar `starship explain` para explicar los módulos que se muestran actualmente.
## Starship is doing something unexpected, how can I debug it?
## Starship está haciendo algo inesperado, ¿cómo puedo depurarlo?
You can enable the debug logs by using the `STARSHIP_LOG` env var. These logs can be very verbose so it is often useful to use the `module` command if you are trying to debug a particular module, for example, if you are trying to debug the `rust` module you could run the following command to get the trace logs and output from the module.
Puede habilitar los registros de depuración usando la variable de entorno `STARSHIP_LOG`. Estos registros pueden ser muy detallados así que a menudo es útil utilizar el comando `module` si estás intentando depurar un módulo en particular, por ejemplo, si está intentando depurar el módulo `rust` podrías ejecutar el siguiente comando para obtener los registros de seguimiento y salida del módulo.
```sh
env STARSHIP_LOG=trace starship module rust
```
If starship is being slow you can try using the `timings` command to see if there is a particular module or command that to blame.
Si starship está siendo lento, puedes intentar usar el comando `timings` para ver si hay un módulo en particular o un comando a culpar.
```sh
env STARSHIP_LOG=trace starship timings
```
This will output the trace log and a breakdown of all modules that either took more than 1ms to execute or produced some output.
Esto producirá el registro de rastreo y un desglose de todos los módulos que tomaron más de 1 ms para ejecutarse o producir alguna salida.
Finally if you find a bug you can use the `bug-report` command to create a Github issue.
Finalmente, si encuentras un error puedes usar el comando `bug-report` para crear un issue en Github.
```sh
reporte de error starship
starship bug-report
```
## ¿Por qué no veo un símbolo de glifo en mi prompt?
@ -117,6 +117,6 @@ Si Starship fue instalado usando un gestor de paquetes, por favor refiérete a s
Si Starship fue instalado usando el guión de instalación, el siguiente comando eliminará el binario:
```sh
# Locate and delete the starship binary
sh -c 'rm "$(command -v 'starship')"'
# Localiza y elimina el binario de starship
sh -c 'rm "$(comando -v 'starship')"'
```

View File

@ -169,16 +169,16 @@
- Una [Nerd Font](https://www.nerdfonts.com/) instalada y habilitada en tu terminal (por ejemplo, prueba [Fira Code Nerd Font](https://www.nerdfonts.com/font-downloads)).
### Step 1. Install Starship
### Paso 1. Instalar Starship
Select your operating system from the list below to view installation instructions:
Seleccione su sistema operativo de la lista de abajo para ver las instrucciones de instalación:
<details>
<summary>Android</summary>
Install Starship using any of the following package managers:
Instalar Starship usando cualquiera de los siguientes gestores de paquetes:
| Repository | Instructions |
| Repositorio | Instrucciones |
| --------------------------------------------------------------------------------- | ---------------------- |
| [Termux](https://github.com/termux/termux-packages/tree/master/packages/starship) | `pkg install starship` |
@ -187,33 +187,33 @@ Install Starship using any of the following package managers:
<details>
<summary>BSD</summary>
Install Starship using any of the following package managers:
Instalar Starship usando cualquiera de los siguientes gestores de paquetes:
| Distribution | Repository | Instructions |
| ------------ | -------------------------------------------------------- | --------------------------------- |
| **_Any_** | **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
| FreeBSD | [FreshPorts](https://www.freshports.org/shells/starship) | `pkg install starship` |
| NetBSD | [pkgsrc](https://pkgsrc.se/shells/starship) | `pkgin install starship` |
| Distribución | Repositorio | Instrucciones |
| ---------------- | -------------------------------------------------------- | --------------------------------- |
| **_Cualquiera_** | **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
| FreeBSD | [FreshPorts](https://www.freshports.org/shells/starship) | `pkg install starship` |
| NetBSD | [pkgsrc](https://pkgsrc.se/shells/starship) | `pkgin install starship` |
</details>
<details>
<summary>Linux</summary>
Install the latest version for your system:
Instale la última versión para su sistema:
```sh
sh -c "$(curl -fsSL https://starship.rs/install.sh)"
```
Alternatively, install Starship using any of the following package managers:
Alternativamente, instale Starship usando cualquiera de los siguientes gestores de paquetes:
| Distribution | Repository | Instructions |
| Distribución | Repositorio | Instrucciones |
| ------------------ | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| **_Any_** | **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
| _Any_ | [conda-forge](https://anaconda.org/conda-forge/starship) | `conda install -c conda-forge starship` |
| _Any_ | [Linuxbrew](https://formulae.brew.sh/formula/starship) | `brew install starship` |
| _Any_ | [Snapcraft](https://snapcraft.io/starship) | `snap install starship` |
| **_Cualquiera_** | **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
| _Cualquiera_ | [conda-forge](https://anaconda.org/conda-forge/starship) | `conda install -c conda-forge starship` |
| _Cualquiera_ | [Linuxbrew](https://formulae.brew.sh/formula/starship) | `brew install starship` |
| _Cualquiera_ | [Snapcraft](https://snapcraft.io/starship) | `snap install starship` |
| Alpine Linux 3.13+ | [Alpine Linux Packages](https://pkgs.alpinelinux.org/packages?name=starship) | `apk add starship` |
| Arch Linux | [Arch Linux Community](https://archlinux.org/packages/community/x86_64/starship) | `pacman -S starship` |
| CentOS 7+ | [Copr](https://copr.fedorainfracloud.org/coprs/atim/starship) | `dnf copr enable atim/starship` <br /> `dnf install starship` |
@ -229,15 +229,15 @@ Alternatively, install Starship using any of the following package managers:
<details>
<summary>macOS</summary>
Install the latest version for your system:
Instale la última versión para su sistema:
```sh
sh -c "$(curl -fsSL https://starship.rs/install.sh)"
```
Alternatively, install Starship using any of the following package managers:
Alternativamente, instale Starship usando cualquiera de los siguientes gestores de paquetes:
| Repository | Instructions |
| Repositorio | Instrucciones |
| -------------------------------------------------------- | --------------------------------------- |
| **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
| [conda-forge](https://anaconda.org/conda-forge/starship) | `conda install -c conda-forge starship` |
@ -249,9 +249,9 @@ Alternatively, install Starship using any of the following package managers:
<details>
<summary>Windows</summary>
Install Starship using any of the following package managers:
Instalar Starship usando cualquiera de los siguientes gestores de paquetes:
| Repository | Instructions |
| Repositorio | Instrucciones |
| -------------------------------------------------------------------------------- | --------------------------------------- |
| **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
| [Chocolatey](https://community.chocolatey.org/packages/starship) | `choco install starship` |
@ -260,9 +260,9 @@ Install Starship using any of the following package managers:
</details>
### Step 2. Setup your shell to use Starship
### Paso 2. Configura tu shell para usar Starship
Configure your shell to initialize starship. Select yours from the list below:
Configure su shell para inicializar starship. Selecciona el tuyo de la lista de abajo:
<details>
<summary>Bash</summary>
@ -278,7 +278,7 @@ eval "$(starship init bash)"
<details>
<summary>Cmd</summary>
You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Create a file at this path `%LocalAppData%\clink\starship.lua` with the following contents:
Necesitas usar [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) con Cmd. Crea un archivo en esta ruta `%LocalAppData%\clink\starship.lua` con el siguiente contenido:
```lua
load(io.popen('starship init cmd'):read("*a"))()
@ -295,7 +295,7 @@ Añade el siguiente código al final de `~/.elvish/rc.elv`:
eval (starship init elvish)
```
Note: Only Elvish v0.17+ is supported
Nota: Solo se admite Elvish v0.17+
</details>
@ -324,7 +324,7 @@ eval $(starship init ion)
<details>
<summary>Nushell</summary>
Add the following to the end of your Nushell configuration (find it by running `config path`):
Añade lo siguiente al final de tu configuración de Nushell (encuéntrala ejecutando `config path`):
```toml
startup = [
@ -340,7 +340,7 @@ prompt = "starship_prompt"
<details>
<summary>PowerShell</summary>
Add the following to the end of your PowerShell configuration (find it by running `$PROFILE`):
Añade lo siguiente al final de tu configuración de PowerShell (encuéntrala ejecutando `$PROFILE`):
```powershell
Invoke-Expression (&starship init powershell)
@ -381,15 +381,15 @@ eval "$(starship init zsh)"
</details>
### Step 3. Configure Starship
### Paso 3. Configurar Starship
Start a new shell instance, and you should see your beautiful new shell prompt. If you're happy with the defaults, enjoy!
Inicia una nueva instancia de shell, y deberías ver tu nuevo y hermoso prompt para shell. Si estás contento con los valores por defecto, ¡disfruta!
If you're looking to further customize Starship:
Si estás buscando personalizar Starship:
- **[Configuration](https://starship.rs/config/)** learn how to configure Starship to tweak your prompt to your liking
- **[Configuración](https://starship.rs/config/)** aprende a configurar Starship para ajustar el prompt a tu gusto
- **[Presets](https://starship.rs/presets/)** get inspired by the pre-built configuration of others
- **[Ajustes preestablecidos](https://starship.rs/presets/)** - inspírate en la configuración construida por otros
## 🤝 Colaborando
@ -403,11 +403,11 @@ Si estás interesado en ayudar contribuyendo a starship, por favor échale un vi
Por favor, revisa estos proyectos que inspiraron la creación de Starship. 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** A ZSH prompt for astronauts.
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** Un prompt de ZSH para astronautas.
- **[denysdovhan/robbyrussell-node](https://github.com/denysdovhan/robbyrussell-node)** Cross-shell robbyrussell theme written in JavaScript.
- **[denysdovhan/robbyrussell-node](https://github.com/denysdovhan/robbyrussell-node)** Tema multi shell robbyrussell escrito en JavaScript.
- **[reujab/silver](https://github.com/reujab/silver)** A cross-shell customizable powerline-like prompt with icons.
- **[reujab/silver](https://github.com/reujab/silver)** - Un prompt multi-intérprete de comandos personalizable basada en Powerline con iconos.
<p align="center">
<br>

View File

@ -63,8 +63,7 @@ Habilita el módulo `programs.starship` en tu archivo `home.nix` y añade tus co
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Configuración escrita en ~/.config/starship.toml
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;

View File

@ -4,9 +4,9 @@ Starship v0.45.0 es un lanzamiento que contiene cambios de ruptura, en preparaci
Esta guía pretende guiarle a través de los cambios de ruptura.
## `prompt_order` ha sido reemplazado por un "nivel raíz" `format`
## `prompt_order` ha sido reemplazado por un `format` en el nivel raiz
Anterioramente a v0.45.0, `prompt_order` aceptaría un arreglo de nombres de módulos en el orden que deberían ser renderizados por Starship.
Previo a v0.45.0, `prompt_order` aceptaría un arreglo de nombres de módulos en el orden en que deberían ser renderizados por Starship.
En su lugar, Starship v0.45.0 acepta un valor de `format`, permitiendo la personalización del indicador fuera de los propios módulos.
@ -109,9 +109,9 @@ Para configurar el prompt para usar la configuración anterior `use_symbol_for_s
error_symbol = "[✖](bold red)"
```
_Note:_ The `character` element automatically adds a space after, so unlike the other `format` strings, we specifically do not add one in the above examples.
_Nota:_ El elemento `character` añade automáticamente un espacio después, así que a diferencia de las otras cadenas de `format`, no añadimos uno en los ejemplos anteriores.
#### Tiempo de Ejecución
#### Tiempo de ejecución
| Propiedad eliminada | Reemplazo |
| ------------------- | --------- |

File diff suppressed because it is too large Load Diff

View File

@ -63,8 +63,7 @@ Activez le module `programs.starship` dans votre fichier `home.nix`, et ajoutez
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Configuration écrite dans ~/.config/starship.toml
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;

File diff suppressed because it is too large Load Diff

View File

@ -63,7 +63,6 @@ Enable the `programs.starship` module in your `home.nix` file, and add your sett
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;

View File

@ -261,7 +261,9 @@ format = "$all$directory$character"
## AWS
The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials.
The `aws` module shows the current AWS region and profile when credentials or a `credential_process` have been setup. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials.
The module will display a profile only if its credentials are present in `~/.aws/credentials` or a `credential_process` is defined in `~/.aws/config`. Alternatively, having any of the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, or `AWS_SESSION_TOKEN` env vars defined will also suffice.
When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var.
@ -795,19 +797,20 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
### Opzioni
| Opzione | Default | Descrizione |
| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `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) "` | The format for the module. |
| `style` | `"bold cyan"` | Lo stile per il modulo. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
| Opzione | Default | Descrizione |
| ------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `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) "` | The format for the module. |
| `style` | `"bold cyan"` | Lo stile per il modulo. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo. The default value is equivalent to `style`. |
| `repo_root_format` | `"[$before_root_path]($style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) "` | The format of a git repo when `repo_root_style` is defined. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path separator instead of always using `/` (e.g. `\` on Windows) |
<details>
<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
@ -839,6 +842,21 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
*: This variable can only be used as a part of a style string
<details>
<summary>The git repos have additional variables.</summary>
Let us consider the path `/path/to/home/git_repo/src/lib`
| Variable | Esempio | Descrizione |
| ------------------ | --------------------- | --------------------------------------- |
| before_root_path | `"/path/to/home/"` | The path before git root directory path |
| repo_root | `"git_repo"` | The git root directory name |
| path | `"/src/lib"` | The remaining path |
| style | `"black bold dimmed"` | Mirrors the value of option `style` |
| repo_root_style | `"underline white"` | Style for git root directory name |
</details>
### Esempio
```toml
@ -1159,13 +1177,14 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### Opzioni
| Opzione | Default | Descrizione |
| ---------------- | ---------------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | Lo stile per il modulo. |
| `disabled` | `false` | Disables the `gcloud` module. |
| Opzione | Default | Descrizione |
| ----------------- | ---------------------------------------------------------- | ---------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `project_aliases` | | Table of project aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | Lo stile per il modulo. |
| `disabled` | `false` | Disables the `gcloud` module. |
### Variables
@ -1214,6 +1233,17 @@ us-central1 = "uc1"
asia-northeast1 = "an1"
```
#### Display account and aliased project
```toml
# ~/.config/starship.toml
[gcloud]
format = 'on [$symbol$account(@$domain)(\($project\))]($style) '
[gcloud.project_aliases]
very-long-project-name = "vlpn"
```
## Git Branch
The `git_branch` module shows the active branch of the repo in your current directory.
@ -1711,39 +1741,6 @@ The `julia` module shows the currently installed version of [Julia](https://juli
symbol = "∴ "
```
## localip
The `localip` module shows the IPv4 address of the primary network interface.
### Opzioni
| Opzione | Default | Descrizione |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | Lo stile per il modulo. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| Variable | Esempio | Descrizione |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### Esempio
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Kotlin
The `kotlin` module shows the currently installed version of [Kotlin](https://kotlinlang.org/). By default the module will be shown if any of the following conditions are met:
@ -1793,7 +1790,7 @@ kotlin_binary = "kotlinc"
## Kubernetes
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#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`.
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace, user and cluster from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-context --namespace astronaut`. Similarly the user and cluster can be set with `kubectl config set-context starship-context --user starship-user` and `kubectl config set-context starship-context --cluster starship-cluster`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`.
::: tip
@ -1815,8 +1812,10 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
| Variable | Esempio | Descrizione |
| --------- | -------------------- | ---------------------------------------- |
| context | `starship-cluster` | The current kubernetes context |
| context | `starship-context` | The current kubernetes context name |
| namespace | `starship-namespace` | If set, the current kubernetes namespace |
| user | `starship-user` | If set, the current kubernetes user |
| cluster | `starship-cluster` | If set, the current kubernetes cluster |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
@ -1828,12 +1827,12 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
# ~/.config/starship.toml
[kubernetes]
format = 'on [$context \($namespace\)](dimmed green) '
format = 'on [($user on )($cluster in )$context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
".*/openshift-cluster/.*" = "openshift"
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
#### Regex Matching
@ -1849,12 +1848,12 @@ Long and automatically generated cluster names can be identified and shortened u
# OpenShift contexts carry the namespace and user in the kube context: `namespace/name/user`:
".*/openshift-cluster/.*" = "openshift"
# Or better, to rename every OpenShift cluster at once:
".*/(?P<cluster>[\\w-]+)/.*" = "$cluster"
".*/(?P<var_cluster>[\\w-]+)/.*" = "$var_cluster"
# Contexts from GKE, AWS and other cloud providers usually carry additional information, like the region/zone.
# The following entry matches on the GKE format (`gke_projectname_zone_cluster-name`)
# and renames every matching kube context into a more readable format (`gke-cluster-name`):
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
## Line Break
@ -1876,6 +1875,39 @@ The `line_break` module separates the prompt into two lines.
disabled = true
```
## Local IP
The `localip` module shows the IPv4 address of the primary network interface.
### Opzioni
| Opzione | Default | Descrizione |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | Lo stile per il modulo. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| Variable | Esempio | Descrizione |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### Esempio
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Lua
The `lua` module shows the currently installed version of [Lua](http://www.lua.org/). By default the module will be shown if any of the following conditions are met:
@ -2237,8 +2269,8 @@ The `package` module is shown when the current directory is the repository for a
| `symbol` | `"📦 "` | The symbol used before displaying the version the package. |
| `version_format` | `"v${raw}"` | Il formato della versione. Le variabili disponibili sono `raw`, `major`, `minore`, & `patch` |
| `style` | `"bold 208"` | Lo stile per il modulo. |
| `display_private` | `false` | Abilita la visualizzazione della versione per i pacchetti contrassegnati come privati. |
| `disabled` | `false` | Disabilita il modulo `package`. |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | Disables the `package` module. |
### Variables
@ -3082,7 +3114,7 @@ If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it de
| Variable | Esempio | Descrizione |
| --------- | ---------- | ----------------------------------- |
| ora | `13:08:10` | The current time. |
| time | `13:08:10` | The current time. |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
@ -3196,12 +3228,12 @@ The `vlang` module shows you your currently installed version of [V](https://vla
| ------------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. |
| `version_format` | `"v${raw}"` | Il formato della versione. Le variabili disponibili sono `raw`, `major`, `minore`, & `patch` |
| `symbol` | `"V "` | Una stringa di formato che rappresenta il simbolo di V |
| `symbol` | `"V "` | A format string representing the symbol of V |
| `detect_extensions` | `["v"]` | Quali estensioni dovrebbero attivare questo modulo. |
| `detect_files` | `["v.mod", "vpkg.json", ".vpkg-lock.json" ]` | Quali nomi di file dovrebbero attivare questo modulo. |
| `detect_folders` | `[]` | Quali cartelle dovrebbero attivare questo modulo. |
| `style` | `"blu grassetto"` | Lo stile per il modulo. |
| `disabled` | `false` | Disabilita il modulo `vlang`. |
| `disabled` | `false` | Disables the `vlang` module. |
### Variables
@ -3334,7 +3366,7 @@ Format strings can also contain shell specific prompt sequences, e.g. [Bash](htt
| `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) |
| `descrizione` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `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. |

View File

@ -79,7 +79,7 @@
><img
height="20"
src="https://raw.githubusercontent.com/starship/starship/master/media/flag-id.png"
alt="Bahasa Indonesia"
alt="Indonesiano"
/></a>
&nbsp;
<a
@ -169,9 +169,9 @@
- Un [Nerd Font](https://www.nerdfonts.com/) installato e abilitato nel tuo terminale (per esempio, prova [Fira Code Nerd Font](https://www.nerdfonts.com/font-downloads)).
### Step 1. Install Starship
### Fase 1. Installa Starship
Select your operating system from the list below to view installation instructions:
Selezionare il sistema operativo dall'elenco qui sotto per visualizzare le istruzioni per l'installazione:
<details>
<summary>Android</summary>
@ -260,9 +260,9 @@ Install Starship using any of the following package managers:
</details>
### Step 2. Setup your shell to use Starship
### Fase 2. Imposta la tua shell a utilizzare Starship
Configure your shell to initialize starship. Select yours from the list below:
Configura la shell a inizializzare Starship. Seleziona la tua dalla lista qui sotto:
<details>
<summary>Bash</summary>
@ -381,15 +381,15 @@ eval "$(starship init zsh)"
</details>
### Step 3. Configure Starship
### Fase 3. Configura Starship
Start a new shell instance, and you should see your beautiful new shell prompt. If you're happy with the defaults, enjoy!
Inizia una nuova istanza del shell, e dovresti vedere il tuo bellissimo nuovo shell prompt. Se sei soddisfatto dei valori predefiniti, ottimo!
If you're looking to further customize Starship:
Se stai cercando di personalizzare ulteriormente Starship:
- **[Configuration](https://starship.rs/config/)** learn how to configure Starship to tweak your prompt to your liking
- **[Configurazione](https://starship.rs/config/)** impara come configurare Starship per modificare il tuo prompt a tuo piacimento
- **[Presets](https://starship.rs/presets/)** get inspired by the pre-built configuration of others
- **[Preset](https://starship.rs/presets/)** ispirati dalla configurazione precostituita da altri
## 🤝 Contribuire
@ -403,11 +403,11 @@ Se sei interessato ad aiutare a contribuire a Starship, dai un'occhiata alla nos
Ti invito di controllare questi lavori precedenti che hanno contribuito a ispirare la creazione di Starship. 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** A ZSH prompt for astronauts.
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** Un prompt ZSH per astronauti.
- **[denysdovhan/robbyrussell-node](https://github.com/denysdovhan/robbyrussell-node)** Cross-shell robbyrussell theme written in JavaScript.
- **[denysdovhan/robbyrussell-node](https://github.com/denysdovhan/robbyrussell-node)** Multi-shell a tema robbyrussell scritto in JavaScript.
- **[reujab/silver](https://github.com/reujab/silver)** A cross-shell customizable powerline-like prompt with icons.
- **[reujab/silver](https://github.com/reujab/silver)** Un prompt multi-shell personalizzabile come powerline con icone.
<p align="center">
<br>

View File

@ -63,7 +63,6 @@ Abilita il modulo `programs.starship` nel tuo file `home.nix` e aggiungi le tue
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;

File diff suppressed because it is too large Load Diff

View File

@ -63,8 +63,7 @@ nix-env -iA nixos.starship
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# ~/.config/starship.toml に書き込まれる設定
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;

View File

@ -261,7 +261,9 @@ format = "$all$directory$character"
## AWS
The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials.
The `aws` module shows the current AWS region and profile when credentials or a `credential_process` have been setup. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials.
The module will display a profile only if its credentials are present in `~/.aws/credentials` or a `credential_process` is defined in `~/.aws/config`. Alternatively, having any of the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, or `AWS_SESSION_TOKEN` env vars defined will also suffice.
When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var.
@ -795,19 +797,20 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
### Options
| Option | Default | Description |
| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `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) "` | The format for the module. |
| `style` | `"bold cyan"` | The style for the module. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
| Option | Default | Description |
| ------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `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) "` | The format for the module. |
| `style` | `"bold cyan"` | The style for the module. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo. The default value is equivalent to `style`. |
| `repo_root_format` | `"[$before_root_path]($style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) "` | The format of a git repo when `repo_root_style` is defined. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path separator instead of always using `/` (e.g. `\` on Windows) |
<details>
<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
@ -839,6 +842,21 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
*: This variable can only be used as a part of a style string
<details>
<summary>The git repos have additional variables.</summary>
Let us consider the path `/path/to/home/git_repo/src/lib`
| Variable | Example | Description |
| ------------------ | --------------------- | --------------------------------------- |
| before_root_path | `"/path/to/home/"` | The path before git root directory path |
| repo_root | `"git_repo"` | The git root directory name |
| path | `"/src/lib"` | The remaining path |
| style | `"black bold dimmed"` | Mirrors the value of option `style` |
| repo_root_style | `"underline white"` | Style for git root directory name |
</details>
### Example
```toml
@ -1159,13 +1177,14 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### Options
| Option | Default | Description |
| ---------------- | ---------------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `gcloud` module. |
| Option | Default | Description |
| ----------------- | ---------------------------------------------------------- | ---------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `project_aliases` | | Table of project aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `gcloud` module. |
### Variables
@ -1214,6 +1233,17 @@ us-central1 = "uc1"
asia-northeast1 = "an1"
```
#### Display account and aliased project
```toml
# ~/.config/starship.toml
[gcloud]
format = 'on [$symbol$account(@$domain)(\($project\))]($style) '
[gcloud.project_aliases]
very-long-project-name = "vlpn"
```
## Git Branch
The `git_branch` module shows the active branch of the repo in your current directory.
@ -1711,39 +1741,6 @@ The `julia` module shows the currently installed version of [Julia](https://juli
symbol = "∴ "
```
## localip
The `localip` module shows the IPv4 address of the primary network interface.
### Options
| Option | Default | Description |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| Variable | Example | Description |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Kotlin
The `kotlin` module shows the currently installed version of [Kotlin](https://kotlinlang.org/). By default the module will be shown if any of the following conditions are met:
@ -1793,7 +1790,7 @@ kotlin_binary = "kotlinc"
## Kubernetes
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#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`.
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace, user and cluster from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-context --namespace astronaut`. Similarly the user and cluster can be set with `kubectl config set-context starship-context --user starship-user` and `kubectl config set-context starship-context --cluster starship-cluster`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`.
::: tip
@ -1815,8 +1812,10 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
| Variable | Example | Description |
| --------- | -------------------- | ---------------------------------------- |
| context | `starship-cluster` | The current kubernetes context |
| context | `starship-context` | The current kubernetes context name |
| namespace | `starship-namespace` | If set, the current kubernetes namespace |
| user | `starship-user` | If set, the current kubernetes user |
| cluster | `starship-cluster` | If set, the current kubernetes cluster |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
@ -1828,12 +1827,12 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
# ~/.config/starship.toml
[kubernetes]
format = 'on [$context \($namespace\)](dimmed green) '
format = 'on [($user on )($cluster in )$context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
".*/openshift-cluster/.*" = "openshift"
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
#### Regex Matching
@ -1849,12 +1848,12 @@ Long and automatically generated cluster names can be identified and shortened u
# OpenShift contexts carry the namespace and user in the kube context: `namespace/name/user`:
".*/openshift-cluster/.*" = "openshift"
# Or better, to rename every OpenShift cluster at once:
".*/(?P<cluster>[\\w-]+)/.*" = "$cluster"
".*/(?P<var_cluster>[\\w-]+)/.*" = "$var_cluster"
# Contexts from GKE, AWS and other cloud providers usually carry additional information, like the region/zone.
# The following entry matches on the GKE format (`gke_projectname_zone_cluster-name`)
# and renames every matching kube context into a more readable format (`gke-cluster-name`):
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
## Line Break
@ -1876,6 +1875,39 @@ The `line_break` module separates the prompt into two lines.
disabled = true
```
## Local IP
The `localip` module shows the IPv4 address of the primary network interface.
### Options
| Option | Default | Description |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| Variable | Example | Description |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Lua
The `lua` module shows the currently installed version of [Lua](http://www.lua.org/). By default the module will be shown if any of the following conditions are met:

View File

@ -63,7 +63,6 @@ Enable the `programs.starship` module in your `home.nix` file, and add your sett
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;

View File

@ -261,7 +261,9 @@ format = "$all$directory$character"
## AWS
The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials.
The `aws` module shows the current AWS region and profile when credentials or a `credential_process` have been setup. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials.
The module will display a profile only if its credentials are present in `~/.aws/credentials` or a `credential_process` is defined in `~/.aws/config`. Alternatively, having any of the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, or `AWS_SESSION_TOKEN` env vars defined will also suffice.
When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var.
@ -795,19 +797,20 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
### Options
| Option | Default | Description |
| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `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) "` | The format for the module. |
| `style` | `"bold cyan"` | The style for the module. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
| Option | Default | Description |
| ------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `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) "` | The format for the module. |
| `style` | `"bold cyan"` | The style for the module. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo. The default value is equivalent to `style`. |
| `repo_root_format` | `"[$before_root_path]($style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) "` | The format of a git repo when `repo_root_style` is defined. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path separator instead of always using `/` (e.g. `\` on Windows) |
<details>
<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
@ -839,6 +842,21 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
*: This variable can only be used as a part of a style string
<details>
<summary>The git repos have additional variables.</summary>
Let us consider the path `/path/to/home/git_repo/src/lib`
| Variable | Example | Description |
| ------------------ | --------------------- | --------------------------------------- |
| before_root_path | `"/path/to/home/"` | The path before git root directory path |
| repo_root | `"git_repo"` | The git root directory name |
| path | `"/src/lib"` | The remaining path |
| style | `"black bold dimmed"` | Mirrors the value of option `style` |
| repo_root_style | `"underline white"` | Style for git root directory name |
</details>
### Example
```toml
@ -1159,13 +1177,14 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### Options
| Option | Default | Description |
| ---------------- | ---------------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `gcloud` module. |
| Option | Default | Description |
| ----------------- | ---------------------------------------------------------- | ---------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `project_aliases` | | Table of project aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `gcloud` module. |
### Variables
@ -1214,6 +1233,17 @@ us-central1 = "uc1"
asia-northeast1 = "an1"
```
#### Display account and aliased project
```toml
# ~/.config/starship.toml
[gcloud]
format = 'on [$symbol$account(@$domain)(\($project\))]($style) '
[gcloud.project_aliases]
very-long-project-name = "vlpn"
```
## Git Branch
The `git_branch` module shows the active branch of the repo in your current directory.
@ -1711,39 +1741,6 @@ The `julia` module shows the currently installed version of [Julia](https://juli
symbol = "∴ "
```
## localip
The `localip` module shows the IPv4 address of the primary network interface.
### Options
| Option | Default | Description |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| Variable | Example | Description |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Kotlin
The `kotlin` module shows the currently installed version of [Kotlin](https://kotlinlang.org/). By default the module will be shown if any of the following conditions are met:
@ -1793,7 +1790,7 @@ kotlin_binary = "kotlinc"
## Kubernetes
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#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`.
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace, user and cluster from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-context --namespace astronaut`. Similarly the user and cluster can be set with `kubectl config set-context starship-context --user starship-user` and `kubectl config set-context starship-context --cluster starship-cluster`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`.
::: tip
@ -1815,8 +1812,10 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
| Variable | Example | Description |
| --------- | -------------------- | ---------------------------------------- |
| context | `starship-cluster` | The current kubernetes context |
| context | `starship-context` | The current kubernetes context name |
| namespace | `starship-namespace` | If set, the current kubernetes namespace |
| user | `starship-user` | If set, the current kubernetes user |
| cluster | `starship-cluster` | If set, the current kubernetes cluster |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
@ -1828,12 +1827,12 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
# ~/.config/starship.toml
[kubernetes]
format = 'on [$context \($namespace\)](dimmed green) '
format = 'on [($user on )($cluster in )$context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
".*/openshift-cluster/.*" = "openshift"
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
#### Regex Matching
@ -1849,12 +1848,12 @@ Long and automatically generated cluster names can be identified and shortened u
# OpenShift contexts carry the namespace and user in the kube context: `namespace/name/user`:
".*/openshift-cluster/.*" = "openshift"
# Or better, to rename every OpenShift cluster at once:
".*/(?P<cluster>[\\w-]+)/.*" = "$cluster"
".*/(?P<var_cluster>[\\w-]+)/.*" = "$var_cluster"
# Contexts from GKE, AWS and other cloud providers usually carry additional information, like the region/zone.
# The following entry matches on the GKE format (`gke_projectname_zone_cluster-name`)
# and renames every matching kube context into a more readable format (`gke-cluster-name`):
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
## Line Break
@ -1876,6 +1875,39 @@ The `line_break` module separates the prompt into two lines.
disabled = true
```
## Local IP
The `localip` module shows the IPv4 address of the primary network interface.
### Options
| Option | Default | Description |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| Variable | Example | Description |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Lua
The `lua` module shows the currently installed version of [Lua](http://www.lua.org/). By default the module will be shown if any of the following conditions are met:

View File

@ -63,7 +63,6 @@ Enable the `programs.starship` module in your `home.nix` file, and add your sett
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;

View File

@ -261,7 +261,9 @@ format = "$all$directory$character"
## AWS
The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials.
The `aws` module shows the current AWS region and profile when credentials or a `credential_process` have been setup. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials.
The module will display a profile only if its credentials are present in `~/.aws/credentials` or a `credential_process` is defined in `~/.aws/config`. Alternatively, having any of the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, or `AWS_SESSION_TOKEN` env vars defined will also suffice.
When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var.
@ -795,19 +797,20 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
### Options
| Option | Default | Description |
| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `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) "` | The format for the module. |
| `style` | `"bold cyan"` | The style for the module. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
| Option | Default | Description |
| ------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `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) "` | The format for the module. |
| `style` | `"bold cyan"` | The style for the module. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo. The default value is equivalent to `style`. |
| `repo_root_format` | `"[$before_root_path]($style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) "` | The format of a git repo when `repo_root_style` is defined. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path separator instead of always using `/` (e.g. `\` on Windows) |
<details>
<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
@ -839,6 +842,21 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
*: This variable can only be used as a part of a style string
<details>
<summary>The git repos have additional variables.</summary>
Let us consider the path `/path/to/home/git_repo/src/lib`
| Zmienne | Example | Description |
| ------------------ | --------------------- | --------------------------------------- |
| before_root_path | `"/path/to/home/"` | The path before git root directory path |
| repo_root | `"git_repo"` | The git root directory name |
| path | `"/src/lib"` | The remaining path |
| style | `"black bold dimmed"` | Mirrors the value of option `style` |
| repo_root_style | `"underline white"` | Style for git root directory name |
</details>
### Example
```toml
@ -1048,7 +1066,7 @@ default = "unknown user"
| Option | Default | Description |
| ---------- | ------------------------------ | ---------------------------------------------------------------------------- |
| `symbol` | `""` | The symbol used before displaying the variable value. |
| `zmienne` | | The environment variable to be displayed. |
| `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) "` | The format for the module. |
| `disabled` | `false` | Disables the `env_var` module. |
@ -1159,13 +1177,14 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### Options
| Option | Default | Description |
| ---------------- | ---------------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `gcloud` module. |
| Option | Default | Description |
| ----------------- | ---------------------------------------------------------- | ---------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `project_aliases` | | Table of project aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `gcloud` module. |
### Variables
@ -1214,6 +1233,17 @@ us-central1 = "uc1"
asia-northeast1 = "an1"
```
#### Display account and aliased project
```toml
# ~/.config/starship.toml
[gcloud]
format = 'on [$symbol$account(@$domain)(\($project\))]($style) '
[gcloud.project_aliases]
very-long-project-name = "vlpn"
```
## Git Branch
The `git_branch` module shows the active branch of the repo in your current directory.
@ -1711,39 +1741,6 @@ The `julia` module shows the currently installed version of [Julia](https://juli
symbol = "∴ "
```
## localip
The `localip` module shows the IPv4 address of the primary network interface.
### Options
| Option | Default | Description |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| Zmienne | Example | Description |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Kotlin
The `kotlin` module shows the currently installed version of [Kotlin](https://kotlinlang.org/). By default the module will be shown if any of the following conditions are met:
@ -1793,7 +1790,7 @@ kotlin_binary = "kotlinc"
## Kubernetes
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#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`.
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace, user and cluster from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-context --namespace astronaut`. Similarly the user and cluster can be set with `kubectl config set-context starship-context --user starship-user` and `kubectl config set-context starship-context --cluster starship-cluster`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`.
::: tip
@ -1815,8 +1812,10 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
| Zmienne | Example | Description |
| --------- | -------------------- | ---------------------------------------- |
| context | `starship-cluster` | The current kubernetes context |
| context | `starship-context` | The current kubernetes context name |
| namespace | `starship-namespace` | If set, the current kubernetes namespace |
| user | `starship-user` | If set, the current kubernetes user |
| cluster | `starship-cluster` | If set, the current kubernetes cluster |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
@ -1828,12 +1827,12 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
# ~/.config/starship.toml
[kubernetes]
format = 'on [$context \($namespace\)](dimmed green) '
format = 'on [($user on )($cluster in )$context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
".*/openshift-cluster/.*" = "openshift"
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
#### Regex Matching
@ -1849,12 +1848,12 @@ Long and automatically generated cluster names can be identified and shortened u
# OpenShift contexts carry the namespace and user in the kube context: `namespace/name/user`:
".*/openshift-cluster/.*" = "openshift"
# Or better, to rename every OpenShift cluster at once:
".*/(?P<cluster>[\\w-]+)/.*" = "$cluster"
".*/(?P<var_cluster>[\\w-]+)/.*" = "$var_cluster"
# Contexts from GKE, AWS and other cloud providers usually carry additional information, like the region/zone.
# The following entry matches on the GKE format (`gke_projectname_zone_cluster-name`)
# and renames every matching kube context into a more readable format (`gke-cluster-name`):
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
## Line Break
@ -1876,6 +1875,39 @@ The `line_break` module separates the prompt into two lines.
disabled = true
```
## Local IP
The `localip` module shows the IPv4 address of the primary network interface.
### Options
| Option | Default | Description |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| Zmienne | Example | Description |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Lua
The `lua` module shows the currently installed version of [Lua](http://www.lua.org/). By default the module will be shown if any of the following conditions are met:

View File

@ -63,7 +63,6 @@ Enable the `programs.starship` module in your `home.nix` file, and add your sett
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;

File diff suppressed because it is too large Load Diff

View File

@ -63,7 +63,6 @@ Ative o modulo `programs.starship` em seu arquivo `home.nix`, e adicione suas co
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;

View File

@ -261,7 +261,9 @@ format = "$all$directory$character"
## AWS
The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials.
The `aws` module shows the current AWS region and profile when credentials or a `credential_process` have been setup. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials.
The module will display a profile only if its credentials are present in `~/.aws/credentials` or a `credential_process` is defined in `~/.aws/config`. Alternatively, having any of the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, or `AWS_SESSION_TOKEN` env vars defined will also suffice.
When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var.
@ -795,19 +797,20 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
### Options
| Option | Default | Description |
| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `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) "` | The format for the module. |
| `style` | `"bold cyan"` | The style for the module. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
| Option | Default | Description |
| ------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `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) "` | The format for the module. |
| `style` | `"bold cyan"` | The style for the module. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo. The default value is equivalent to `style`. |
| `repo_root_format` | `"[$before_root_path]($style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) "` | The format of a git repo when `repo_root_style` is defined. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path separator instead of always using `/` (e.g. `\` on Windows) |
<details>
<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
@ -839,6 +842,21 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
*: This variable can only be used as a part of a style string
<details>
<summary>The git repos have additional variables.</summary>
Let us consider the path `/path/to/home/git_repo/src/lib`
| Variable | Example | Description |
| ------------------ | --------------------- | --------------------------------------- |
| before_root_path | `"/path/to/home/"` | The path before git root directory path |
| repo_root | `"git_repo"` | The git root directory name |
| path | `"/src/lib"` | The remaining path |
| style | `"black bold dimmed"` | Mirrors the value of option `style` |
| repo_root_style | `"underline white"` | Style for git root directory name |
</details>
### Example
```toml
@ -1159,13 +1177,14 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### Options
| Option | Default | Description |
| ---------------- | ---------------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `gcloud` module. |
| Option | Default | Description |
| ----------------- | ---------------------------------------------------------- | ---------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `project_aliases` | | Table of project aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `gcloud` module. |
### Variables
@ -1214,6 +1233,17 @@ us-central1 = "uc1"
asia-northeast1 = "an1"
```
#### Display account and aliased project
```toml
# ~/.config/starship.toml
[gcloud]
format = 'on [$symbol$account(@$domain)(\($project\))]($style) '
[gcloud.project_aliases]
very-long-project-name = "vlpn"
```
## Git Branch
The `git_branch` module shows the active branch of the repo in your current directory.
@ -1711,39 +1741,6 @@ The `julia` module shows the currently installed version of [Julia](https://juli
symbol = "∴ "
```
## localip
The `localip` module shows the IPv4 address of the primary network interface.
### Options
| Option | Default | Description |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| Variable | Example | Description |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Kotlin
The `kotlin` module shows the currently installed version of [Kotlin](https://kotlinlang.org/). By default the module will be shown if any of the following conditions are met:
@ -1793,7 +1790,7 @@ kotlin_binary = "kotlinc"
## Kubernetes
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#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`.
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace, user and cluster from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-context --namespace astronaut`. Similarly the user and cluster can be set with `kubectl config set-context starship-context --user starship-user` and `kubectl config set-context starship-context --cluster starship-cluster`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`.
::: tip
@ -1815,8 +1812,10 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
| Variable | Example | Description |
| --------- | -------------------- | ---------------------------------------- |
| context | `starship-cluster` | The current kubernetes context |
| context | `starship-context` | The current kubernetes context name |
| namespace | `starship-namespace` | If set, the current kubernetes namespace |
| user | `starship-user` | If set, the current kubernetes user |
| cluster | `starship-cluster` | If set, the current kubernetes cluster |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
@ -1828,12 +1827,12 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
# ~/.config/starship.toml
[kubernetes]
format = 'on [$context \($namespace\)](dimmed green) '
format = 'on [($user on )($cluster in )$context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
".*/openshift-cluster/.*" = "openshift"
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
#### Regex Matching
@ -1849,12 +1848,12 @@ Long and automatically generated cluster names can be identified and shortened u
# OpenShift contexts carry the namespace and user in the kube context: `namespace/name/user`:
".*/openshift-cluster/.*" = "openshift"
# Or better, to rename every OpenShift cluster at once:
".*/(?P<cluster>[\\w-]+)/.*" = "$cluster"
".*/(?P<var_cluster>[\\w-]+)/.*" = "$var_cluster"
# Contexts from GKE, AWS and other cloud providers usually carry additional information, like the region/zone.
# The following entry matches on the GKE format (`gke_projectname_zone_cluster-name`)
# and renames every matching kube context into a more readable format (`gke-cluster-name`):
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
## Line Break
@ -1876,6 +1875,39 @@ The `line_break` module separates the prompt into two lines.
disabled = true
```
## Local IP
The `localip` module shows the IPv4 address of the primary network interface.
### Options
| Option | Default | Description |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| Variable | Example | Description |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Lua
The `lua` module shows the currently installed version of [Lua](http://www.lua.org/). By default the module will be shown if any of the following conditions are met:

View File

@ -63,7 +63,6 @@ Enable the `programs.starship` module in your `home.nix` file, and add your sett
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;

File diff suppressed because it is too large Load Diff

View File

@ -63,7 +63,6 @@ Enable the `programs.starship` module in your `home.nix` file, and add your sett
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;

View File

@ -261,7 +261,9 @@ format = "$all$directory$character"
## AWS
The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials.
The `aws` module shows the current AWS region and profile when credentials or a `credential_process` have been setup. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. This module also shows an expiration timer when using temporary credentials.
The module will display a profile only if its credentials are present in `~/.aws/credentials` or a `credential_process` is defined in `~/.aws/config`. Alternatively, having any of the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, or `AWS_SESSION_TOKEN` env vars defined will also suffice.
When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var.
@ -795,19 +797,20 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
### Options
| Option | Default | Description |
| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `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) "` | The format for the module. |
| `style` | `"bold cyan"` | The style for the module. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
| Option | Default | Description |
| ------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `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) "` | The format for the module. |
| `style` | `"bold cyan"` | The style for the module. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo. The default value is equivalent to `style`. |
| `repo_root_format` | `"[$before_root_path]($style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) "` | The format of a git repo when `repo_root_style` is defined. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path separator instead of always using `/` (e.g. `\` on Windows) |
<details>
<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
@ -839,6 +842,21 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
*: This variable can only be used as a part of a style string
<details>
<summary>The git repos have additional variables.</summary>
Let us consider the path `/path/to/home/git_repo/src/lib`
| Variable | Example | Description |
| ------------------ | --------------------- | --------------------------------------- |
| before_root_path | `"/path/to/home/"` | The path before git root directory path |
| repo_root | `"git_repo"` | The git root directory name |
| path | `"/src/lib"` | The remaining path |
| style | `"black bold dimmed"` | Mirrors the value of option `style` |
| repo_root_style | `"underline white"` | Style for git root directory name |
</details>
### Example
```toml
@ -1159,13 +1177,14 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### Options
| Option | Default | Description |
| ---------------- | ---------------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `gcloud` module. |
| Option | Default | Description |
| ----------------- | ---------------------------------------------------------- | ---------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `project_aliases` | | Table of project aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `gcloud` module. |
### Variables
@ -1214,6 +1233,17 @@ us-central1 = "uc1"
asia-northeast1 = "an1"
```
#### Display account and aliased project
```toml
# ~/.config/starship.toml
[gcloud]
format = 'on [$symbol$account(@$domain)(\($project\))]($style) '
[gcloud.project_aliases]
very-long-project-name = "vlpn"
```
## Git Branch
The `git_branch` module shows the active branch of the repo in your current directory.
@ -1711,39 +1741,6 @@ The `julia` module shows the currently installed version of [Julia](https://juli
symbol = "∴ "
```
## localip
The `localip` module shows the IPv4 address of the primary network interface.
### Options
| Option | Default | Description |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| Variable | Example | Description |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Kotlin
The `kotlin` module shows the currently installed version of [Kotlin](https://kotlinlang.org/). By default the module will be shown if any of the following conditions are met:
@ -1793,7 +1790,7 @@ kotlin_binary = "kotlinc"
## Kubernetes
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#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`.
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace, user and cluster from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-context --namespace astronaut`. Similarly the user and cluster can be set with `kubectl config set-context starship-context --user starship-user` and `kubectl config set-context starship-context --cluster starship-cluster`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`.
::: tip
@ -1815,8 +1812,10 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
| Variable | Example | Description |
| --------- | -------------------- | ---------------------------------------- |
| context | `starship-cluster` | The current kubernetes context |
| context | `starship-context` | The current kubernetes context name |
| namespace | `starship-namespace` | If set, the current kubernetes namespace |
| user | `starship-user` | If set, the current kubernetes user |
| cluster | `starship-cluster` | If set, the current kubernetes cluster |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
@ -1828,12 +1827,12 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
# ~/.config/starship.toml
[kubernetes]
format = 'on [$context \($namespace\)](dimmed green) '
format = 'on [($user on )($cluster in )$context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
".*/openshift-cluster/.*" = "openshift"
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
#### Regex Matching
@ -1849,12 +1848,12 @@ Long and automatically generated cluster names can be identified and shortened u
# OpenShift contexts carry the namespace and user in the kube context: `namespace/name/user`:
".*/openshift-cluster/.*" = "openshift"
# Or better, to rename every OpenShift cluster at once:
".*/(?P<cluster>[\\w-]+)/.*" = "$cluster"
".*/(?P<var_cluster>[\\w-]+)/.*" = "$var_cluster"
# Contexts from GKE, AWS and other cloud providers usually carry additional information, like the region/zone.
# The following entry matches on the GKE format (`gke_projectname_zone_cluster-name`)
# and renames every matching kube context into a more readable format (`gke-cluster-name`):
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
## Line Break
@ -1876,6 +1875,39 @@ The `line_break` module separates the prompt into two lines.
disabled = true
```
## Local IP
The `localip` module shows the IPv4 address of the primary network interface.
### Options
| Option | Default | Description |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| Variable | Example | Description |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Lua
The `lua` module shows the currently installed version of [Lua](http://www.lua.org/). By default the module will be shown if any of the following conditions are met:

View File

@ -63,7 +63,6 @@ nix-env -iA nixos.starship
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;

File diff suppressed because it is too large Load Diff

View File

@ -63,8 +63,7 @@ Kích hoạt mô đun `programs.starship` trong tệp `home.nix` của bạn, v
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Cấu hình viết vào ~/.config/starship.toml
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;

View File

@ -261,7 +261,9 @@ format = "$all$directory$character"
## AWS
`aws` 组件显示当前 AWS 主机所在区域与配置信息。 各组件基于 `AWS_REGION``AWS_DEFAULT_REGION` 和 `AWS_PROFILE` 环境变量与 `~/.aws/config` 文件。 This module also shows an expiration timer when using temporary credentials.
The `aws` module shows the current AWS region and profile when credentials or a `credential_process` have been setup. 各组件基于 `AWS_REGION``AWS_DEFAULT_REGION` 和 `AWS_PROFILE` 环境变量与 `~/.aws/config` 文件。 This module also shows an expiration timer when using temporary credentials.
The module will display a profile only if its credentials are present in `~/.aws/credentials` or a `credential_process` is defined in `~/.aws/config`. Alternatively, having any of the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, or `AWS_SESSION_TOKEN` env vars defined will also suffice.
When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var.
@ -360,7 +362,7 @@ style = "blue bold"
## Battery
`battery` 组件显示电池充电情况和当前充电状态。 这个组件只会在当前电量低于 10% 时显示。
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%.
### 配置项
@ -388,7 +390,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). 如果 `display` 没有设置, 默认设置如下:
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. 默认设置如下:
```toml
[[battery.display]]
@ -400,7 +402,7 @@ The default value for the `charging_symbol` and `discharging_symbol` option is r
#### 配置项
`display` 字段的子字段如下:
The `display` option is an array of the following table.
| Option | 默认值 | 描述 |
| -------------------- | ---------- | --------------------------------------------------------------------------------------------------------- |
@ -426,9 +428,9 @@ discharging_symbol = "💦"
## Character
`character` 组件用于在您输入终端的文本旁显示一个字符(通常是一个箭头)。
The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal.
这个字符可以告诉您最后一个命令是否执行成功。 It can do this in two ways:
The character will tell you whether the last command was successful or not. It can do this in two ways:
- changing color (`red`/`green`)
- changing shape (``/`✖`)
@ -556,15 +558,15 @@ The `cobol` module shows the currently installed version of COBOL. By default, t
## Command Duration
`cmd_duration` 组件显示上一个命令执行的时间。 此组件只在命令执行时间长于两秒时显示,或者当其 `min_time` 字段被设置时,按此值为执行时间的显示下限。
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.
::: warning 不要在 Bash 里捕获 DEBUG 信号
::: warning Do not hook the DEBUG trap in Bash
如果您正在 `bash` 上使用 Starship在运行 `eval $(starship)` 后,不要捕获 `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 用户可以使用 [rcaloras 的 bash_preexec 框架](https://github.com/rcaloras/bash-preexec)。 只需要在执行 `eval $(starship init $0)` 前简单地定义 `preexec_functions``precmd_functions` 两个列表,就可以照常运行了。
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.
### 配置项
@ -604,7 +606,7 @@ The `conda` module shows the current [Conda](https://docs.conda.io/en/latest/) e
::: tip
此组件没有禁用 conda 自带的提示符修改,您可能需要执行 `conda config --set changeps1 False`
This does not suppress conda's own prompt modifier, you may want to run `conda config --set changeps1 False`.
:::
@ -787,30 +789,31 @@ format = "via [🦕 $version](green bold) "
## Directory
`directory` 组件显示当前目录的路径,显示的路径会截断到三个父目录以内。 如果您处于一个 git 仓库中,显示的路径则最多会截断到该仓库的根目录。
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.
当使用 fish 风格的当前目录显示样式时,您会看到基于您的设置的每个上级目录的短名称,而不是隐藏被截断的上级目录。
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.
例如,对于 `~/Dev/Nix/nixpkgs/pkgs`,其中 `nixpkgs` 是 git 仓库根目录fish 风格相关选项设置为 `1`。 您将会看到 `~/D/N/nixpkgs/pkgs`,而在设置 fish 风格之前,当前路径将显示成 `nixpkgs/pkgs`
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`.
### 配置项
| 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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
| 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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo. The default value is equivalent to `style`. |
| `repo_root_format` | `"[$before_root_path]($style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) "` | The format of a git repo when `repo_root_style` is defined. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path separator instead of always using `/` (e.g. `\` on Windows) |
<details>
<summary>此组件有几个高级配置选项来控制当前目录路径的显示方式。</summary>
<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
| Advanced Option | 默认值 | 描述 |
| --------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@ -839,6 +842,21 @@ format = "via [🦕 $version](green bold) "
*: This variable can only be used as a part of a style string
<details>
<summary>The git repos have additional variables.</summary>
Let us consider the path `/path/to/home/git_repo/src/lib`
| 字段 | 示例 | 描述 |
| ------------------ | --------------------- | --------------------------------------- |
| before_root_path | `"/path/to/home/"` | The path before git root directory path |
| repo_root | `"git_repo"` | The git root directory name |
| path | `"/src/lib"` | The remaining path |
| style | `"black bold dimmed"` | `style`对应值 |
| repo_root_style | `"underline white"` | Style for git root directory name |
</details>
### 示例
```toml
@ -887,7 +905,7 @@ format = "via [🐋 $context](blue bold)"
## Dotnet
The `dotnet` module shows the relevant version of the [.NET Core SDK](https://dotnet.microsoft.com/) for the current directory. 如果当前目录已被绑定了一个版本的 SDK则显示被帮定的版本。 否则此组件将显示最新安装的 SDK 版本。
The `dotnet` module shows the relevant version of the [.NET Core SDK](https://dotnet.microsoft.com/) 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.
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:
@ -902,7 +920,7 @@ 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.
在内部,此组件使用自己的版本检测机制。 一般来说此组件是直接执行 `dotnet --version` 的两倍快,但当你的 .NET 项目使用了不常见的目录布局时此组件可能显示一个错误的版本。 如果相比于速度您更需要正确的版本号,您可以在组件设置中设置 `heuristic = false` 来禁用该机制。
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 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.
@ -912,13 +930,13 @@ The module will also show the Target Framework Moniker (<https://docs.microsoft.
| ------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )(🎯 $tfm )]($style)"` | 组件格式化模板。 |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `".NET "` | 这个字段的内容会显示在当前 .NET 版本之前。 |
| `heuristic` | `true` | 使用更快的版本探测机制以保证 starship 的运行速度。 |
| `symbol` | `".NET "` | The symbol used before displaying the version of dotnet. |
| `heuristic` | `true` | Use faster version detection to keep starship snappy. |
| `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"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `dotnet` 组件。 |
| `disabled` | `false` | Disables the `dotnet` module. |
### Variables
@ -1025,7 +1043,7 @@ format = "via [ $version](cyan bold) "
## Environment Variable
The `env_var` module displays the current value of a selected environment variables. 此组件只有满足以下条件之一时才会被显示:
The `env_var` module displays the current value of a selected environment variables. The module will be shown only if any of the following conditions are met:
- 设置的 `variable` 是一个已存在的环境变量
- 未定义 `variable`,但定义了 `default`
@ -1045,13 +1063,13 @@ default = "unknown user"
### 配置项
| Option | 默认值 | 描述 |
| ---------- | ------------------------------ | ------------------- |
| `symbol` | `""` | 这个字段的内容会显示在环境变量值之前。 |
| `variable` | | 要显示的环境变量。 |
| `default` | | 所选变量未定义时显示的默认值。 |
| `format` | `"with [$env_value]($style) "` | 组件格式化模板。 |
| `disabled` | `false` | 禁用 `env_var` 组件。 |
| 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. |
### Variables
@ -1159,13 +1177,14 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### 配置项
| Option | 默认值 | 描述 |
| ---------------- | ---------------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | 组件格式化模板。 |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `gcloud` module. |
| Option | 默认值 | 描述 |
| ----------------- | ---------------------------------------------------------- | ---------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | 组件格式化模板。 |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `project_aliases` | | Table of project aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `gcloud` module. |
### Variables
@ -1214,22 +1233,33 @@ us-central1 = "uc1"
asia-northeast1 = "an1"
```
#### Display account and aliased project
```toml
# ~/.config/starship.toml
[gcloud]
format = 'on [$symbol$account(@$domain)(\($project\))]($style) '
[gcloud.project_aliases]
very-long-project-name = "vlpn"
```
## Git Branch
`git_branch` 组件显示当前目录的 git 仓库的活动分支。
The `git_branch` module shows the active branch of the repo in your current directory.
### 配置项
| 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 `N` 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` 组件。 |
| 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 `N` 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. |
### Variables
@ -1262,13 +1292,13 @@ The `git_commit` module shows the current commit hash and also the tag (if any)
| Option | 默认值 | 描述 |
| -------------------- | ---------------------------------- | ------------------------------------------------------- |
| `commit_hash_length` | `7` | 显示的 git 提交哈希值的长度。 |
| `commit_hash_length` | `7` | The length of the displayed git commit hash. |
| `format` | `"[\\($hash$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` | 禁用 `git_commit` 组件。 |
| `disabled` | `false` | Disables the `git_commit` module. |
### Variables
@ -1291,7 +1321,7 @@ tag_symbol = "🔖 "
## Git State
`git_state` 组件会显示当前目录在哪个 git 仓库中以及正在进行的操作例如_REBASING__BISECTING_ 等。 进度信息(例如 REBASING 3/10如果存在则也会被显示。
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.
### 配置项
@ -1306,7 +1336,7 @@ tag_symbol = "🔖 "
| `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` | 禁用 `git_state` 模块 |
| `disabled` | `false` | Disables the `git_state` module. |
### Variables
@ -1335,7 +1365,7 @@ The `git_metrics` module will show the number of added and deleted lines in the
::: tip
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -1372,14 +1402,14 @@ format = '[+$added]($added_style)/[-$deleted]($deleted_style) '
## Git Status
`git_status`组件通过相应的符号显示您当前目录中 git 仓库的状态。
The `git_status` module shows symbols representing the state of the repo in your current directory.
### 配置项
| Option | 默认值 | 描述 |
| ------------------- | ----------------------------------------------- | ----------------------------------- |
| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` |
| `conflicted` | `"="` | 这个分支有合并冲突。 |
| `conflicted` | `"="` | This branch has merge conflicts. |
| `ahead` | `"⇡"` | The format of `ahead` |
| `behind` | `"⇣"` | The format of `behind` |
| `diverged` | `"⇕"` | The format of `diverged` |
@ -1392,7 +1422,7 @@ format = '[+$added]($added_style)/[-$deleted]($deleted_style) '
| `deleted` | `"✘"` | The format of `deleted` |
| `style` | `"bold red"` | 此组件的样式。 |
| `ignore_submodules` | `false` | Ignore changes to submodules. |
| `disabled` | `false` | 禁用 `git_status` 组件。 |
| `disabled` | `false` | Disables the `git_status` module. |
### Variables
@ -1422,9 +1452,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` | 显示相应的文件数量 |
| 字段 | 描述 |
| ------- | ------------------------ |
| `count` | Show the number of files |
### 示例
@ -1480,7 +1510,7 @@ The `golang` module shows the currently installed version of [Go](https://golang
| `detect_files` | `["go.mod", "go.sum", "glide.yaml", "Gopkg.yml", "Gopkg.lock", ".go-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `["Godeps"]` | Which folders should trigger this module. |
| `style` | `"bold cyan"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `golang` 组件。 |
| `disabled` | `false` | Disables the `golang` module. |
### Variables
@ -1542,17 +1572,17 @@ format = "via [⎈ $version](bold white) "
## Hostname
`hostname` 组件显示系统主机名。
The `hostname` module shows the system hostname.
### 配置项
| Option | 默认值 | 描述 |
| ---------- | --------------------------- | ------------------------------------------------------------------ |
| `ssh_only` | `true` | 仅在连接到 SSH 会话时显示主机名。 |
| `trim_at` | `"."` | 当主机名过长被截断时,会截断成第一次匹配该字符串之前的主机名。 `"."` 会让主机名截断到第一个点处。 `""` 会禁用任何截断。 |
| `format` | `"[$hostname]($style) in "` | 组件格式化模板。 |
| `style` | `"bold dimmed green"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `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. |
### Variables
@ -1593,7 +1623,7 @@ The `java` module shows the currently installed version of [Java](https://www.or
| `detect_folders` | `[]` | Which folders should trigger this modules. |
| `symbol` | `"☕ "` | A format string representing the symbol of Java |
| `style` | `"red dimmed"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `java` 组件。 |
| `disabled` | `false` | Disables the `java` module. |
### Variables
@ -1616,7 +1646,7 @@ symbol = "🌟 "
## Jobs
`jobs` 组件显示当前正在运行的任务数量。 仅当有后台任务运行时,此组件才会显示。 The module will show the number of jobs running if there are at least 2 jobs, or more than the `number_threshold` config value, if it exists. The module will show a symbol if there is at least 1 job, or more than the `symbol_threshold` config value, if it exists. You can set both values to 0 in order to _always_ show the symbol and number of jobs, even if there are 0 jobs running.
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 are at least 2 jobs, or more than the `number_threshold` config value, if it exists. The module will show a symbol if there is at least 1 job, or more than the `symbol_threshold` config value, if it exists. You can set both values to 0 in order to _always_ show the symbol and number of jobs, even if there are 0 jobs running.
The default functionality is:
@ -1640,13 +1670,13 @@ The `threshold` option is deprecated, but if you want to use it, the module will
| Option | 默认值 | 描述 |
| ------------------ | ----------------------------- | ------------------------------------------------------------------------ |
| `threshold`* | `1` | 如果超过此字段的值,显示任务数量。 |
| `threshold`* | `1` | Show number of jobs if exceeded. |
| `symbol_threshold` | `1` | Show `symbol` if the job count is at least `symbol_threshold`. |
| `number_threshold` | `2` | Show the number of jobs if the job count is at least `number_threshold`. |
| `format` | `"[$symbol$number]($style) "` | 组件格式化模板。 |
| `symbol` | `"✦"` | The string used to represent the `symbol` variable. |
| `style` | `"bold blue"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `jobs` 组件。 |
| `disabled` | `false` | Disables the `jobs` module. |
*: This option is deprecated, please use the `number_threshold` and `symbol_threshold` options instead.
@ -1711,39 +1741,6 @@ The `julia` module shows the currently installed version of [Julia](https://juli
symbol = "∴ "
```
## localip
The `localip` module shows the IPv4 address of the primary network interface.
### 配置项
| Option | 默认值 | 描述 |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | 组件格式化模板。 |
| `style` | `"bold yellow"` | 此组件的样式。 |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| 字段 | 示例 | 描述 |
| --------- | ------------ | --------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | `style`对应值 |
*: This variable can only be used as a part of a style string
### 示例
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Kotlin
The `kotlin` module shows the currently installed version of [Kotlin](https://kotlinlang.org/). By default the module will be shown if any of the following conditions are met:
@ -1793,11 +1790,11 @@ kotlin_binary = "kotlinc"
## Kubernetes
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#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`.
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace, user and cluster from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-context --namespace astronaut`. Similarly the user and cluster can be set with `kubectl config set-context starship-context --user starship-user` and `kubectl config set-context starship-context --cluster starship-cluster`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`.
::: tip
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -1815,8 +1812,10 @@ Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/co
| 字段 | 示例 | 描述 |
| --------- | -------------------- | ---------------------------------------- |
| context | `starship-cluster` | The current kubernetes context |
| context | `starship-context` | The current kubernetes context name |
| namespace | `starship-namespace` | If set, the current kubernetes namespace |
| user | `starship-user` | If set, the current kubernetes user |
| cluster | `starship-cluster` | If set, the current kubernetes cluster |
| symbol | | `symbol`对应值 |
| style\* | | `style`对应值 |
@ -1828,12 +1827,12 @@ Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/co
# ~/.config/starship.toml
[kubernetes]
format = 'on [$context \($namespace\)](dimmed green) '
format = 'on [($user on )($cluster in )$context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
".*/openshift-cluster/.*" = "openshift"
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
#### Regex Matching
@ -1849,23 +1848,23 @@ Long and automatically generated cluster names can be identified and shortened u
# OpenShift contexts carry the namespace and user in the kube context: `namespace/name/user`:
".*/openshift-cluster/.*" = "openshift"
# Or better, to rename every OpenShift cluster at once:
".*/(?P<cluster>[\\w-]+)/.*" = "$cluster"
".*/(?P<var_cluster>[\\w-]+)/.*" = "$var_cluster"
# Contexts from GKE, AWS and other cloud providers usually carry additional information, like the region/zone.
# The following entry matches on the GKE format (`gke_projectname_zone_cluster-name`)
# and renames every matching kube context into a more readable format (`gke-cluster-name`):
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
## Line Break
`line_break` 组件将提示分隔为两行。
The `line_break` module separates the prompt into two lines.
### 配置项
| Option | 默认值 | 描述 |
| ---------- | ------- | --------------------------- |
| `disabled` | `false` | 禁用 `line_break` 组件,使提示成为单行。 |
| Option | 默认值 | 描述 |
| ---------- | ------- | ------------------------------------------------------------------ |
| `disabled` | `false` | Disables the `line_break` module, making the prompt a single line. |
### 示例
@ -1876,6 +1875,39 @@ Long and automatically generated cluster names can be identified and shortened u
disabled = true
```
## Local IP
The `localip` module shows the IPv4 address of the primary network interface.
### 配置项
| Option | 默认值 | 描述 |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | 组件格式化模板。 |
| `style` | `"bold yellow"` | 此组件的样式。 |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| 字段 | 示例 | 描述 |
| --------- | ------------ | --------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | `style`对应值 |
*: This variable can only be used as a part of a style string
### 示例
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Lua
The `lua` module shows the currently installed version of [Lua](http://www.lua.org/). By default the module will be shown if any of the following conditions are met:
@ -1919,25 +1951,25 @@ format = "via [🌕 $version](bold blue) "
## Memory Usage
`memory_usage` 组件显示当前系统内存和交换区使用情况。
The `memory_usage` module shows current system memory and swap usage.
默认情况下,如果系统交换区使用不为 0则会显示交换区使用情况。
By default the swap usage is displayed if the total system swap is non-zero.
::: tip
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### 配置项
| Option | 默认值 | 描述 |
| ----------- | ----------------------------------------------- | ---------------------- |
| `threshold` | `75` | 隐藏内存使用情况,除非它超过这个百分比。 |
| `format` | `"via $symbol [${ram}( \| ${swap})]($style) "` | 组件格式化模板。 |
| `symbol` | `"🐏"` | 这个字段的内容会显示在当前内存使用情况之前。 |
| `style` | `"bold dimmed white"` | 此组件的样式。 |
| `disabled` | `true` | 禁用 `memory_usage` 模块 |
| 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. |
### Variables
@ -1966,18 +1998,18 @@ style = "bold dimmed green"
## Mercurial Branch
`hg_branch` 组件显示当前目录的 hg 仓库的活动分支。
The `hg_branch` module shows the active branch of the repo in your current directory.
### 配置项
| Option | 默认值 | 描述 |
| ------------------- | -------------------------------- | --------------------------------------------- |
| `symbol` | `" "` | 该字段的内容显示于当前仓库的 hg 书签或活动分支名之前。 |
| `style` | `"bold purple"` | 此组件的样式。 |
| `format` | `"on [$symbol$branch]($style) "` | 组件格式化模板。 |
| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to `N` graphemes |
| `truncation_symbol` | `"…"` | 此字段的内容用来表示分支名称被截断。 |
| `disabled` | `true` | 禁用 `hg_branch` 组件。 |
| 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 `N` graphemes |
| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. |
| `disabled` | `true` | Disables the `hg_branch` module. |
### Variables
@ -2044,7 +2076,7 @@ symbol = "🎣 "
## Nix-shell
The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/developing-with-nix-shell.html) environment. 当处于一个 nix-shell 环境中时,此组件会被显示。
The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/developing-with-nix-shell.html) environment. The module will be shown when inside a nix-shell environment.
### 配置项
@ -2055,13 +2087,13 @@ The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/
| `style` | `"bold blue"` | 此组件的样式。 |
| `impure_msg` | `"impure"` | A format string shown when the shell is impure. |
| `pure_msg` | `"pure"` | A format string shown when the shell is pure. |
| `disabled` | `false` | 禁用 `nix_shell` 组件。 |
| `disabled` | `false` | Disables the `nix_shell` module. |
### Variables
| 字段 | 示例 | 描述 |
| --------- | ------- | -------------------------- |
| state | `纯色` | The state of the nix-shell |
| state | `pure` | The state of the nix-shell |
| name | `lorri` | The name of the nix-shell |
| symbol | | `symbol`对应值 |
| style\* | | `style`对应值 |
@ -2102,7 +2134,7 @@ The `nodejs` module shows the currently installed version of [Node.js](https://n
| `detect_files` | `["package.json", ".node-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `["node_modules"]` | Which folders should trigger this module. |
| `style` | `"bold green"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `nodejs` 组件。 |
| `disabled` | `false` | Disables the `nodejs` module. |
| `not_capable_style` | `bold red` | The style for the module when an engines property in package.json does not match the Node.js version. |
### Variables
@ -2208,7 +2240,7 @@ symbol = "☁️ "
## Package Version
当前目录是软件包的代码仓库时,将显示 `package` 组件,并显示软件包当前版本。 The module currently supports `npm`, `nimble`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix`, `helm`, `shards` and `dart` packages.
The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `nimble`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix`, `helm`, `shards` and `dart` packages.
- [**npm**](https://docs.npmjs.com/cli/commands/npm) The `npm` package version is extracted from the `package.json` present in the current directory
- [**Cargo**](https://doc.rust-lang.org/cargo/) The `cargo` package version is extracted from the `Cargo.toml` present in the current directory
@ -2234,11 +2266,11 @@ symbol = "☁️ "
| Option | 默认值 | 描述 |
| ----------------- | --------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"is [$symbol$version]($style) "` | 组件格式化模板。 |
| `symbol` | `"📦 "` | 这个字段的内容会显示在当前软件包版本之前。 |
| `symbol` | `"📦 "` | The symbol used before displaying the version the package. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `style` | `"bold 208"` | 此组件的样式。 |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | 禁用 `package` 组件。 |
| `disabled` | `false` | Disables the `package` module. |
### Variables
@ -2313,12 +2345,12 @@ The `php` module shows the currently installed version of [PHP](https://www.php.
| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | 组件格式化模板。 |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `"🐘 "` | 这个字段的内容会显示在当前 PHP 版本之前。 |
| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. |
| `detect_extensions` | `["php"]` | Which extensions should trigger this module. |
| `detect_files` | `["composer.json", ".php-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this module. |
| `style` | `"147 bold"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `php` 组件。 |
| `disabled` | `false` | Disables the `php` module. |
### Variables
@ -2439,7 +2471,7 @@ format = "via [$symbol$version](bold white)"
The `python` module shows the currently installed version of [Python](https://www.python.org/) and the current [Python virtual environment](https://docs.python.org/tutorial/venv.html) if one is activated.
如果`pyenv_version_name`被设置为`true`, 本组件将会展示pyenv版本名。 否则则显示通过`python --version`获得的版本号
If `pyenv_version_name` is set to `true`, it will display the pyenv version name. Otherwise, it will display the version number from `python --version`.
By default the module will be shown if any of the following conditions are met:
@ -2459,15 +2491,15 @@ By default the module will be shown if any of the following conditions are met:
| -------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
| `format` | `'via [${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style)'` | 组件格式化模板。 |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `"🐍 "` | 用于表示Python的格式化字符串。 |
| `symbol` | `"🐍 "` | A format string representing the symbol of Python |
| `style` | `"yellow bold"` | 此组件的样式。 |
| `pyenv_version_name` | `false` | 使用 pyenv 获取 Python 版本 |
| `pyenv_version_name` | `false` | Use pyenv to get Python version |
| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used |
| `python_binary` | `["python", "python3", "python2"]` | Configures the python binaries that Starship should executes when getting the version. |
| `detect_extensions` | `["py"]` | Which extensions should trigger this module |
| `detect_files` | `[".python-version", "Pipfile", "__init__.py", "pyproject.toml", "requirements.txt", "setup.py", "tox.ini"]` | Which filenames should trigger this module |
| `detect_folders` | `[]` | Which folders should trigger this module |
| `disabled` | `false` | 禁用 `python` 组件。 |
| `disabled` | `false` | Disables the `python` module. |
::: tip
@ -2481,11 +2513,11 @@ The default values and order for `python_binary` was chosen to first identify th
| 字段 | 示例 | 描述 |
| ------------ | --------------- | ------------------------------------------ |
| version | `"v3.8.1"` | `python`版本 |
| version | `"v3.8.1"` | The version of `python` |
| symbol | `"🐍 "` | `symbol`对应值 |
| style | `"yellow bold"` | `style`对应值 |
| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` |
| virtualenv | `"venv"` | 当前`virtualenv`名称 |
| virtualenv | `"venv"` | The current `virtualenv` name |
### 示例
@ -2568,7 +2600,7 @@ 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 module will be shown if any of the following conditions are met:
- The current directory contains a file with `.red` or `.reds` extension
@ -2606,7 +2638,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/). The module will be shown if any of the following conditions are met:
- 当前目录包含 `Gemfile` 文件
- The current directory contains a `.ruby-version` file
@ -2627,7 +2659,7 @@ Starship gets the current Ruby version by running `ruby -v`.
| `detect_folders` | `[]` | Which folders should trigger this module. |
| `detect_variables` | `["RUBY_VERSION", "RBENV_VERSION"]` | Which environment variables should trigger this module. |
| `style` | `"bold red"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `ruby` 组件。 |
| `disabled` | `false` | Disables the `ruby` module. |
### Variables
@ -2650,7 +2682,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/). The module will be shown if any of the following conditions are met:
- 当前目录包含 `Cargo.toml` 文件
- 当前目录包含一个使用 `.rs` 扩展名的文件
@ -2666,7 +2698,7 @@ By default the `rust` module shows the currently installed version of [Rust](htt
| `detect_files` | `["Cargo.toml"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this module. |
| `style` | `"bold red"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `rust` 组件。 |
| `disabled` | `false` | Disables the `rust` module. |
### Variables
@ -2733,7 +2765,7 @@ The `shell` module shows an indicator for currently used shell.
::: tip
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -2761,7 +2793,7 @@ The `shell` module shows an indicator for currently used shell.
| 字段 | 默认值 | 描述 |
| --------- | --- | ---------------------------------------------------------- |
| indicator | | Mirrors the value of `indicator` for currently used shell. |
| style\* | | `style`对应值. |
| style\* | | Mirrors the value of option `style`. |
*: This variable can only be used as a part of a style string
@ -2852,7 +2884,7 @@ The `status` module displays the exit code of the previous command. The module w
::: tip
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -2913,7 +2945,7 @@ The `sudo` module displays if sudo credentials are currently cached. The module
::: tip
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -2958,7 +2990,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 module will be shown if any of the following conditions are met:
- The current directory contains a `Package.swift` file
- The current directory contains a file with the `.swift` extension
@ -3021,7 +3053,7 @@ By default the module will be shown if any of the following conditions are met:
| `detect_files` | `[]` | Which filenames should trigger this module. |
| `detect_folders` | `[".terraform"]` | Which folders should trigger this module. |
| `style` | `"bold 105"` | 此组件的样式。 |
| `disabled` | `false` | 禁用 `terraform` 组件。 |
| `disabled` | `false` | Disables the `terraform` module. |
### Variables
@ -3056,27 +3088,27 @@ format = "[🏎💨 $workspace]($style) "
## Time
`time` 组件显示当前的 **本地** 时间。 `format` 字段值会提供给 [`chrono`](https://crates.io/crates/chrono) crate 用来控制时间显示方式。 请参阅 [chrono strftime 文档](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) 以了解可用格式选项。
The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available.
::: tip
此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### 配置项
| Option | 默认值 | 描述 |
| ----------------- | ----------------------- | ----------------------------------------------------------------------------------------------------- |
| `format` | `"at [$time]($style) "` | The format string for the module. |
| `use_12hr` | `false` | 启用 12 小时格式 |
| `time_format` | 见下文解释 | 用来格式化时间显示的 [chrono 格式字符串](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) |
| `style` | `"bold yellow"` | 显示时间的样式。 |
| `utc_time_offset` | `"local"` | 设置所用 UTC 偏移量。 Range from -24 &lt; x &lt; 24. 允许使用浮点数来得到 30/45 分钟的时区偏移。 |
| `disabled` | `true` | 禁用 `time` 组件。 |
| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format |
| Option | 默认值 | 描述 |
| ----------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `format` | `"at [$time]($style) "` | The format string for the module. |
| `use_12hr` | `false` | Enables 12 hour formatting |
| `time_format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `"bold yellow"` | The style for the module time |
| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 &lt; x &lt; 24. Allows floats to accommodate 30/45 minute timezone offsets. |
| `disabled` | `true` | Disables the `time` module. |
| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format |
If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. 否则,其默认值为 `"%T"` Manually setting `time_format` will override the `use_12hr` setting.
If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting.
### Variables
@ -3102,7 +3134,7 @@ time_range = "10:00:00-14:00:00"
## Username
`username` 组件显示当前活跃的用户名。 此组件只有满足以下条件之一时才会被显示:
The `username` module shows active user's username. The module will be shown if any of the following conditions are met:
- 当前用户是 root
- 当前用户与登录用户不相同
@ -3117,13 +3149,13 @@ SSH connection is detected by checking environment variables `SSH_CONNECTION`, `
### 配置项
| Option | 默认值 | 描述 |
| ------------- | ----------------------- | ------------------- |
| `style_root` | `"bold red"` | 当前用户为 root 时使用的样式。 |
| `style_user` | `"bold yellow"` | 非 root 用户使用的样式。 |
| `format` | `"[$user]($style) in "` | 组件格式化模板。 |
| `show_always` | `false` | 总是显示 `username` 组件。 |
| `disabled` | `false` | 禁用 `username` 组件。 |
| Option | 默认值 | 描述 |
| ------------- | ----------------------- | ------------------------------------- |
| `style_root` | `"bold red"` | The style used when the user is root. |
| `style_user` | `"bold yellow"` | The style used for non-root users. |
| `format` | `"[$user]($style) in "` | 组件格式化模板。 |
| `show_always` | `false` | Always shows the `username` module. |
| `disabled` | `false` | Disables the `username` module. |
### Variables
@ -3253,7 +3285,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 module will be shown if any of the following conditions are met:
- The current directory contains a `.zig` file
@ -3334,7 +3366,7 @@ Format strings can also contain shell specific prompt sequences, e.g. [Bash](htt
| `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`. |
| `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. |

View File

@ -103,7 +103,7 @@
><img
height="20"
src="https://raw.githubusercontent.com/starship/starship/master/media/flag-br.png"
alt="Português do Brasil"
alt="Portugus do Brasil"
/></a>
&nbsp;
<a
@ -111,7 +111,7 @@
><img
height="20"
src="https://raw.githubusercontent.com/starship/starship/master/media/flag-ru.png"
alt="Русский"
alt="Pусский"
/></a>
&nbsp;
<a
@ -189,31 +189,31 @@
使用下列软件包管理器安装Starship
| Distribution | 软件包来源 | 指令 |
| ------------ | -------------------------------------------------------- | --------------------------------- |
| **_Any_** | **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
| FreeBSD | [FreshPorts](https://www.freshports.org/shells/starship) | `pkg install starship` |
| NetBSD | [pkgsrc](https://pkgsrc.se/shells/starship) | `pkgin install starship` |
| 发行版 | 软件包来源 | 指令 |
| ----------- | -------------------------------------------------------- | --------------------------------- |
| **_任意发行版_** | **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
| FreeBSD | [FreshPorts](https://www.freshports.org/shells/starship) | `pkg install starship` |
| NetBSD | [pkgsrc](https://pkgsrc.se/shells/starship) | `pkgin install starship` |
</details>
<details>
<summary>Linux</summary>
Install the latest version for your system:
安装最新版本:
```sh
sh -c "$(curl -fsSL https://starship.rs/install.sh)"
```
Alternatively, install Starship using any of the following package managers:
或者使用以下任一软件包管理器安装Starship
| Distribution | 软件包来源 | 指令 |
| 发行版 | 软件包来源 | 指令 |
| ------------------ | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| **_Any_** | **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
| _Any_ | [conda-forge](https://anaconda.org/conda-forge/starship) | `conda install -c conda-forge starship` |
| _Any_ | [Linuxbrew](https://formulae.brew.sh/formula/starship) | `brew install starship` |
| _Any_ | [Snapcraft](https://snapcraft.io/starship) | `snap install starship` |
| **_任意发行版_** | **[crates.io](https://crates.io/crates/starship)** | `cargo install starship --locked` |
| _任意发行版_ | [conda-forge](https://anaconda.org/conda-forge/starship) | `conda install -c conda-forge starship` |
| _任意发行版_ | [Linuxbrew](https://formulae.brew.sh/formula/starship) | `brew install starship` |
| _任意发行版_ | [Snapcraft](https://snapcraft.io/starship) | `snap install starship` |
| Alpine Linux 3.13+ | [Alpine Linux Packages](https://pkgs.alpinelinux.org/packages?name=starship) | `apk add starship` |
| Arch Linux | [Arch Linux Community](https://archlinux.org/packages/community/x86_64/starship) | `pacman -S starship` |
| CentOS 7+ | [Copr](https://copr.fedorainfracloud.org/coprs/atim/starship) | `dnf copr enable atim/starship` <br /> `dnf install starship` |
@ -229,13 +229,13 @@ Alternatively, install Starship using any of the following package managers:
<details>
<summary>macOS</summary>
Install the latest version for your system:
安装最新版本:
```sh
sh -c "$(curl -fsSL https://starship.rs/install.sh)"
```
Alternatively, install Starship using any of the following package managers:
或者使用以下任一软件包管理器安装Starship
| 软件包来源 | 指令 |
| -------------------------------------------------------- | --------------------------------------- |
@ -295,7 +295,7 @@ load(io.popen('starship init cmd'):read("*a"))()
eval (starship init elvish)
```
Note: Only Elvish v0.17+ is supported
注意:仅支持 v0.17 及以上版本的 Elvish
</details>
@ -324,7 +324,7 @@ eval $(starship init ion)
<details>
<summary>Nushell</summary>
Add the following to the end of your Nushell configuration (find it by running `config path`):
将以下内容添加到您 Nushell 配置文件的末尾(通过运行 `config path` 来获取配置文件的路径)
```toml
startup = [
@ -340,7 +340,7 @@ prompt = "starship_prompt"
<details>
<summary>PowerShell</summary>
Add the following to the end of your PowerShell configuration (find it by running `$PROFILE`):
将以下内容添加到您 PowerShell 配置文件的末尾(通过运行 `$PROFILE` 来获取配置文件的路径)
```powershell
Invoke-Expression (&starship init powershell)
@ -401,7 +401,7 @@ eval "$(starship init zsh)"
## 💭该项目受以下项目启发
请看看这些之前的工作,他们启发了 Starship 项目的创造。 🙏
请看看这些之前的项目,他们启发了 Starship 项目。 🙏
- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** A ZSH prompt for astronauts.
@ -411,7 +411,7 @@ eval "$(starship init zsh)"
<p align="center">
<br>
<img width="100" src="https://raw.githubusercontent.com/starship/starship/master/media/icon.png" alt="Starship rocket icon">
<img width="100" src="https://raw.githubusercontent.com/starship/starship/master/media/icon.png" alt="Starship 图标">
</p>
## 📝 License

View File

@ -63,7 +63,6 @@ nix-env -iA nixos.starship
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;

View File

@ -261,7 +261,9 @@ format = "$all$directory$character"
## AWS
`aws` 模組顯示現在 AWS 的區域與概況。 這是根據 `AWS_REGION`、`AWS_DEFAULT_REGION` 與 `AWS_PROFILE` 環境變數及 `~/.aws/config` 檔案。 This module also shows an expiration timer when using temporary credentials.
The `aws` module shows the current AWS region and profile when credentials or a `credential_process` have been setup. 這是根據 `AWS_REGION`、`AWS_DEFAULT_REGION` 與 `AWS_PROFILE` 環境變數及 `~/.aws/config` 檔案。 This module also shows an expiration timer when using temporary credentials.
The module will display a profile only if its credentials are present in `~/.aws/credentials` or a `credential_process` is defined in `~/.aws/config`. Alternatively, having any of the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, or `AWS_SESSION_TOKEN` env vars defined will also suffice.
When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var and the credentials expiration date is read from the `AWS_SESSION_EXPIRATION` env var.
@ -360,7 +362,7 @@ style = "blue bold"
## 電池
`battery` 模組顯示電池的電量以及現在的充電狀態。 這個模組只會在裝置的電量低於 10% 的時候看見。
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%.
### 選項
@ -388,7 +390,7 @@ discharging_symbol = "💀 "
### 電池顯示
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` 預設如下:
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. 預設如下:
```toml
[[battery.display]]
@ -400,7 +402,7 @@ The default value for the `charging_symbol` and `discharging_symbol` option is r
#### 選項
`display` 選項是一個下列表格的陣列。
The `display` option is an array of the following table.
| Option | 預設 | 說明 |
| -------------------- | ---------- | --------------------------------------------------------------------------------------------------------- |
@ -426,9 +428,9 @@ discharging_symbol = "💦"
## 字元
`character` 模組在你的文字輸入處旁顯示一個字元 (通常是箭頭)。
The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal.
這個字元會告訴你最後的指令是成功還是失敗。 It can do this in two ways:
The character will tell you whether the last command was successful or not. It can do this in two ways:
- changing color (`red`/`green`)
- changing shape (``/`✖`)
@ -556,15 +558,15 @@ The `cobol` module shows the currently installed version of COBOL. By default, t
## 指令持續時間
`cmd_duration` 模組顯示最後一個指令執行所花費的時間。 這個模組只會在指令花費超過兩秒或是有設定 `min_time` 時,超過設定值時出現。
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.
::: warning 不要在 Bash 中設置 DEBUG trap
::: warning Do not hook the DEBUG trap in Bash
如果你在 `bash` 中使用 Starship不要在執行 `eval $(starship init $0)` 之後設置 `DEBUG` trap不然這個模組**會**壞掉。
If you are running Starship in `bash`, do not hook the `DEBUG` trap after running `eval $(starship init $0)`, or this module **will** break.
:::
想使用類似 preexec 功能的 Bash 使用者可以 [rcaloras 的 bash_preexec 框架](https://github.com/rcaloras/bash-preexec)。 只要在 `eval $(starship init $0)` 之前簡單地定義 `preexec_functions``precmd_functions` 兩個陣列,然後就可以照常進行。
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.
### 選項
@ -787,30 +789,31 @@ format = "via [🦕 $version](green bold) "
## 資料夾
`directory` 模組顯示到現在資料夾的路徑,並裁減到前三層資料夾。 你的資料夾也會被裁減到你所在的 git 儲存庫的根目錄。
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.
如果正在使用 fish 風格的 pwd 選項,將不會隱藏被裁減的資料夾,而是會根據你在選項中設定的數字看到每一層資料夾的縮寫。
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.
例如,給定一個右列的路徑 `~/Dev/Nix/nixpkgs/pkgs` 其中 `nixpkgs` 是儲存庫的根目錄,而且該選項被設定為 `1`。 你會看到 `~/D/N/nixpkgs/pkgs`,而在這個設定之前則是 `nixpkgs/pkgs`
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`.
### 選項
| Option | 預設 | 說明 |
| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `truncation_length` | `3` | 到達現在資料夾的路徑中,要被裁減掉的資料夾數目。 |
| `truncate_to_repo` | `true` | 是否要裁減到你現在所在的 git 儲存庫的根目錄。 |
| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
| Option | 預設 | 說明 |
| ------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `truncation_length` | `3` | 到達現在資料夾的路徑中,要被裁減掉的資料夾數目。 |
| `truncate_to_repo` | `true` | 是否要裁減到你現在所在的 git 儲存庫的根目錄。 |
| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. |
| `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: "…/" |
| `repo_root_style` | `None` | The style for the root of the git repo. The default value is equivalent to `style`. |
| `repo_root_format` | `"[$before_root_path]($style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) "` | The format of a git repo when `repo_root_style` is defined. |
| `home_symbol` | `"~"` | The symbol indicating home directory. |
| `use_os_path_sep` | `true` | Use the OS specific path separator instead of always using `/` (e.g. `\` on Windows) |
<details>
<summary>這個模組有些進階設定選項可以控制顯示資料夾。</summary>
<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
| Advanced Option | 預設 | 說明 |
| --------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@ -839,6 +842,21 @@ format = "via [🦕 $version](green bold) "
*: This variable can only be used as a part of a style string
<details>
<summary>The git repos have additional variables.</summary>
Let us consider the path `/path/to/home/git_repo/src/lib`
| 變數 | 範例 | 說明 |
| ------------------ | --------------------- | --------------------------------------- |
| before_root_path | `"/path/to/home/"` | The path before git root directory path |
| repo_root | `"git_repo"` | The git root directory name |
| path | `"/src/lib"` | The remaining path |
| style | `"black bold dimmed"` | Mirrors the value of option `style` |
| repo_root_style | `"underline white"` | Style for git root directory name |
</details>
### 範例
```toml
@ -887,7 +905,7 @@ format = "via [🐋 $context](blue bold)"
## Dotnet
The `dotnet` module shows the relevant version of the [.NET Core SDK](https://dotnet.microsoft.com/) for the current directory. 如果這個資料夾已經選定一個 SDK則顯示這個 SDK 的版本。 如果沒有的話,則顯示最新安裝的 SDK 版本。
The `dotnet` module shows the relevant version of the [.NET Core SDK](https://dotnet.microsoft.com/) 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.
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:
@ -902,7 +920,7 @@ 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.
這個模組內部是使用它自己的機制來偵測版本。 一般來說這個模組有 `dotnet --version` 的兩倍快,但是它可能會在你的 .NET 專案有不尋常的資料夾結構時顯示不正確的版本。 如果精確度比速度更重要的話,你可以藉由設定模組中的 `heuristic = false` 選項來停用這個功能。
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 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.
@ -912,13 +930,13 @@ The module will also show the Target Framework Moniker (<https://docs.microsoft.
| ------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )(🎯 $tfm )]($style)"` | The format for the module. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `".NET "` | 在顯示 dotnet 版本之前用的符號。 |
| `heuristic` | `true` | 使用更快速的版本偵測法來保持 starship 的速度。 |
| `symbol` | `".NET "` | The symbol used before displaying the version of dotnet. |
| `heuristic` | `true` | Use faster version detection to keep starship snappy. |
| `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"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `dotnet` 模組。 |
| `disabled` | `false` | Disables the `dotnet` module. |
### Variables
@ -1025,7 +1043,7 @@ format = "via [ $version](cyan bold) "
## 環境變數
The `env_var` module displays the current value of a selected environment variables. 這個模組只在下列條件其中之一達到時顯示:
The `env_var` module displays the current value of a selected environment variables. The module will be shown only if any of the following conditions are met:
- `variable` 設定選項符合一個存在的環境變數。
- 沒有設定 `variable` 選項,但是有設定 `default` 選項。
@ -1045,13 +1063,13 @@ default = "unknown user"
### 選項
| Option | 預設 | 說明 |
| ---------- | ------------------------------ | -------------------------- |
| `symbol` | `""` | 顯示在變數數值之前的符號。 |
| `variable` | | 要顯示的環境變數。 |
| `default` | | 在選擇的變數值沒有定義時,顯示的預設值。 |
| `format` | `"with [$env_value]($style) "` | The format for the module. |
| `disabled` | `false` | 停用 `env_var` 模組。 |
| 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) "` | The format for the module. |
| `disabled` | `false` | Disables the `env_var` module. |
### Variables
@ -1159,13 +1177,14 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### 選項
| Option | 預設 | 說明 |
| ---------------- | ---------------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `gcloud` module. |
| Option | 預設 | 說明 |
| ----------------- | ---------------------------------------------------------- | ---------------------------------------------------------------- |
| `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. |
| `region_aliases` | | Table of region aliases to display in addition to the GCP name. |
| `project_aliases` | | Table of project aliases to display in addition to the GCP name. |
| `style` | `"bold blue"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `gcloud` module. |
### Variables
@ -1214,22 +1233,33 @@ us-central1 = "uc1"
asia-northeast1 = "an1"
```
#### Display account and aliased project
```toml
# ~/.config/starship.toml
[gcloud]
format = 'on [$symbol$account(@$domain)(\($project\))]($style) '
[gcloud.project_aliases]
very-long-project-name = "vlpn"
```
## Git 分支
`git_branch` 模組顯示現在的資料夾中使用中的儲存庫的分支。
The `git_branch` module shows the active branch of the repo in your current directory.
### 選項
| 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) "` | The format for the module. 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 `N` 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` 模組。 |
| 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) "` | The format for the module. 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 `N` 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. |
### Variables
@ -1291,7 +1321,7 @@ tag_symbol = "🔖 "
## Git State
`git_state` 模組會顯示在 git 儲存庫中的資料夾內以及會在有作業正在進行時顯示像是_REBASING_、_BISECTING_ 等等。 如果有進展的資訊 (像是 REBASING 3/10),也會一併顯示出來。
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.
### 選項
@ -1306,7 +1336,7 @@ tag_symbol = "🔖 "
| `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)\) '` | The format for the module. |
| `disabled` | `false` | 停用 `git_state` 模組。 |
| `disabled` | `false` | Disables the `git_state` module. |
### Variables
@ -1335,7 +1365,7 @@ The `git_metrics` module will show the number of added and deleted lines in the
::: tip
這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -1372,14 +1402,14 @@ format = '[+$added]($added_style)/[-$deleted]($deleted_style) '
## Git Status
`git_status` 模組顯示用來表示現在資料夾之中儲存庫狀態的符號。
The `git_status` module shows symbols representing the state of the repo in your current directory.
### 選項
| Option | 預設 | 說明 |
| ------------------- | ----------------------------------------------- | ----------------------------------- |
| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` |
| `conflicted` | `"="` | 這個分支有合併衝突。 |
| `conflicted` | `"="` | This branch has merge conflicts. |
| `ahead` | `"⇡"` | The format of `ahead` |
| `behind` | `"⇣"` | The format of `behind` |
| `diverged` | `"⇕"` | The format of `diverged` |
@ -1392,7 +1422,7 @@ format = '[+$added]($added_style)/[-$deleted]($deleted_style) '
| `deleted` | `"✘"` | The format of `deleted` |
| `style` | `"bold red"` | 這個模組的風格。 |
| `ignore_submodules` | `false` | Ignore changes to submodules. |
| `disabled` | `false` | 停用 `git_status` 模組。 |
| `disabled` | `false` | Disables the `git_status` module. |
### Variables
@ -1480,7 +1510,7 @@ The `golang` module shows the currently installed version of [Go](https://golang
| `detect_files` | `["go.mod", "go.sum", "glide.yaml", "Gopkg.yml", "Gopkg.lock", ".go-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `["Godeps"]` | Which folders should trigger this module. |
| `style` | `"bold cyan"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `golang` 模組。 |
| `disabled` | `false` | Disables the `golang` module. |
### Variables
@ -1542,23 +1572,23 @@ format = "via [⎈ $version](bold white) "
## 主機名稱
`hostname` 模組顯示系統的主機名稱。
The `hostname` module shows the system hostname.
### 選項
| Option | 預設 | 說明 |
| ---------- | --------------------------- | ---------------------------------------------------------- |
| `ssh_only` | `true` | 只在連接到一個 SSH session 時顯示主機名稱。 |
| `trim_at` | `"."` | 擷取出主機名稱的斷點,以第一個符合的為準。 `"."` 會讓它停在第一個點的符號。 `""` 會停用任何的截斷功能。 |
| `format` | `"[$hostname]($style) in "` | The format for the module. |
| `style` | `"bold dimmed green"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `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 "` | The format for the module. |
| `style` | `"bold dimmed green"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `hostname` module. |
### Variables
| 變數 | 範例 | 說明 |
| --------- | ---------- | ----------------------------------- |
| 主機名稱 | `computer` | The hostname of the computer |
| hostname | `computer` | The hostname of the computer |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
@ -1593,7 +1623,7 @@ The `java` module shows the currently installed version of [Java](https://www.or
| `detect_folders` | `[]` | Which folders should trigger this modules. |
| `symbol` | `"☕ "` | A format string representing the symbol of Java |
| `style` | `"red dimmed"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `java` 模組。 |
| `disabled` | `false` | Disables the `java` module. |
### Variables
@ -1616,7 +1646,7 @@ symbol = "🌟 "
## 工作
`jobs` 模組顯示現在正在執行中的工作。 這個模組只會在有背景工作正在執行時顯示。 The module will show the number of jobs running if there are at least 2 jobs, or more than the `number_threshold` config value, if it exists. The module will show a symbol if there is at least 1 job, or more than the `symbol_threshold` config value, if it exists. You can set both values to 0 in order to _always_ show the symbol and number of jobs, even if there are 0 jobs running.
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 are at least 2 jobs, or more than the `number_threshold` config value, if it exists. The module will show a symbol if there is at least 1 job, or more than the `symbol_threshold` config value, if it exists. You can set both values to 0 in order to _always_ show the symbol and number of jobs, even if there are 0 jobs running.
The default functionality is:
@ -1640,13 +1670,13 @@ The `threshold` option is deprecated, but if you want to use it, the module will
| Option | 預設 | 說明 |
| ------------------ | ----------------------------- | ------------------------------------------------------------------------ |
| `threshold`* | `1` | 在超過指定值時顯示工作數量。 |
| `threshold`* | `1` | Show number of jobs if exceeded. |
| `symbol_threshold` | `1` | Show `symbol` if the job count is at least `symbol_threshold`. |
| `number_threshold` | `2` | Show the number of jobs if the job count is at least `number_threshold`. |
| `format` | `"[$symbol$number]($style) "` | The format for the module. |
| `symbol` | `"✦"` | The string used to represent the `symbol` variable. |
| `style` | `"bold blue"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `jobs` 模組。 |
| `disabled` | `false` | Disables the `jobs` module. |
*: This option is deprecated, please use the `number_threshold` and `symbol_threshold` options instead.
@ -1711,39 +1741,6 @@ The `julia` module shows the currently installed version of [Julia](https://juli
symbol = "∴ "
```
## localip
The `localip` module shows the IPv4 address of the primary network interface.
### 選項
| Option | 預設 | 說明 |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | 這個模組的風格。 |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| 變數 | 範例 | 說明 |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### 範例
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Kotlin
The `kotlin` module shows the currently installed version of [Kotlin](https://kotlinlang.org/). By default the module will be shown if any of the following conditions are met:
@ -1793,11 +1790,11 @@ kotlin_binary = "kotlinc"
## Kubernetes
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#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`.
Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) name and, if set, the namespace, user and cluster from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-context --namespace astronaut`. Similarly the user and cluster can be set with `kubectl config set-context starship-context --user starship-user` and `kubectl config set-context starship-context --cluster starship-cluster`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`.
::: tip
這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -1815,8 +1812,10 @@ Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/co
| 變數 | 範例 | 說明 |
| --------- | -------------------- | ---------------------------------------- |
| context | `starship-cluster` | The current kubernetes context |
| context | `starship-context` | The current kubernetes context name |
| namespace | `starship-namespace` | If set, the current kubernetes namespace |
| user | `starship-user` | If set, the current kubernetes user |
| cluster | `starship-cluster` | If set, the current kubernetes cluster |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
@ -1828,12 +1827,12 @@ Displays the current [Kubernetes context](https://kubernetes.io/docs/concepts/co
# ~/.config/starship.toml
[kubernetes]
format = 'on [$context \($namespace\)](dimmed green) '
format = 'on [($user on )($cluster in )$context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
".*/openshift-cluster/.*" = "openshift"
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
#### Regex Matching
@ -1849,23 +1848,23 @@ Long and automatically generated cluster names can be identified and shortened u
# OpenShift contexts carry the namespace and user in the kube context: `namespace/name/user`:
".*/openshift-cluster/.*" = "openshift"
# Or better, to rename every OpenShift cluster at once:
".*/(?P<cluster>[\\w-]+)/.*" = "$cluster"
".*/(?P<var_cluster>[\\w-]+)/.*" = "$var_cluster"
# Contexts from GKE, AWS and other cloud providers usually carry additional information, like the region/zone.
# The following entry matches on the GKE format (`gke_projectname_zone_cluster-name`)
# and renames every matching kube context into a more readable format (`gke-cluster-name`):
"gke_.*_(?P<cluster>[\\w-]+)" = "gke-$cluster"
"gke_.*_(?P<var_cluster>[\\w-]+)" = "gke-$var_cluster"
```
## 換行
## Line Break
`line_break` 模組將提示字元分成兩行。
The `line_break` module separates the prompt into two lines.
### 選項
| Option | 預設 | 說明 |
| ---------- | ------- | ----------------------------- |
| `disabled` | `false` | 停用 `line_break` 模組,讓提示字元變成一行。 |
| Option | 預設 | 說明 |
| ---------- | ------- | ------------------------------------------------------------------ |
| `disabled` | `false` | Disables the `line_break` module, making the prompt a single line. |
### 範例
@ -1876,6 +1875,39 @@ Long and automatically generated cluster names can be identified and shortened u
disabled = true
```
## Local IP
The `localip` module shows the IPv4 address of the primary network interface.
### 選項
| Option | 預設 | 說明 |
| ---------- | ------------------------- | ------------------------------------------------------ |
| `ssh_only` | `true` | Only show IP address when connected to an SSH session. |
| `format` | `"[$localipv4]($style) "` | The format for the module. |
| `style` | `"bold yellow"` | 這個模組的風格。 |
| `disabled` | `true` | Disables the `localip` module. |
### Variables
| 變數 | 範例 | 說明 |
| --------- | ------------ | ----------------------------------- |
| localipv4 | 192.168.1.13 | Contains the primary IPv4 address |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### 範例
```toml
# ~/.config/starship.toml
[localip]
ssh_only = false
format = "@[$localipv4](bold red) "
disabled = false
```
## Lua
The `lua` module shows the currently installed version of [Lua](http://www.lua.org/). By default the module will be shown if any of the following conditions are met:
@ -1919,25 +1951,25 @@ format = "via [🌕 $version](bold blue) "
## 記憶體使用量
`memory_usage` 模組顯示現在系統記憶體與 swap 的使用量。
The `memory_usage` module shows current system memory and swap usage.
預設 swap 使用量會在系統總 swap 使用量不為 0 時顯示出來。
By default the swap usage is displayed if the total system swap is non-zero.
::: tip
這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### 選項
| Option | 預設 | 說明 |
| ----------- | ----------------------------------------------- | -------------------------- |
| `threshold` | `75` | 將記憶體使用量隱藏,除非使用量超過指定值。 |
| `format` | `"via $symbol [${ram}( \| ${swap})]($style) "` | The format for the module. |
| `symbol` | `"🐏"` | 顯示在記憶體使用量之前的符號。 |
| `style` | `"bold dimmed white"` | 這個模組的風格。 |
| `disabled` | `true` | 停用 `memory_usage` 模組。 |
| Option | 預設 | 說明 |
| ----------- | ----------------------------------------------- | -------------------------------------------------------- |
| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. |
| `format` | `"via $symbol [${ram}( \| ${swap})]($style) "` | The format for the module. |
| `symbol` | `"🐏"` | The symbol used before displaying the memory usage. |
| `style` | `"bold dimmed white"` | 這個模組的風格。 |
| `disabled` | `true` | Disables the `memory_usage` module. |
### Variables
@ -1976,7 +2008,7 @@ The `hg_branch` module shows the active branch of the repo in your current direc
| `style` | `"bold purple"` | 這個模組的風格。 |
| `format` | `"on [$symbol$branch]($style) "` | The format for the module. |
| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to `N` graphemes |
| `truncation_symbol` | `"…"` | 用來指示分支名稱被縮減的符號。 |
| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. |
| `disabled` | `true` | Disables the `hg_branch` module. |
### Variables
@ -2044,7 +2076,7 @@ symbol = "🎣 "
## Nix-shell
The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/developing-with-nix-shell.html) environment. 這個模組會在 nix-shell 環境中顯示。
The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/developing-with-nix-shell.html) environment. The module will be shown when inside a nix-shell environment.
### 選項
@ -2055,7 +2087,7 @@ The `nix_shell` module shows the [nix-shell](https://nixos.org/guides/nix-pills/
| `style` | `"bold blue"` | 這個模組的風格。 |
| `impure_msg` | `"impure"` | A format string shown when the shell is impure. |
| `pure_msg` | `"pure"` | A format string shown when the shell is pure. |
| `disabled` | `false` | 停用 `nix_shell` 模組。 |
| `disabled` | `false` | Disables the `nix_shell` module. |
### Variables
@ -2102,7 +2134,7 @@ The `nodejs` module shows the currently installed version of [Node.js](https://n
| `detect_files` | `["package.json", ".node-version"]` | Which filenames should trigger this module. |
| `detect_folders` | `["node_modules"]` | Which folders should trigger this module. |
| `style` | `"bold green"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `nodejs` 模組。 |
| `disabled` | `false` | Disables the `nodejs` module. |
| `not_capable_style` | `bold red` | The style for the module when an engines property in package.json does not match the Node.js version. |
### Variables
@ -2208,7 +2240,7 @@ symbol = "☁️ "
## 套件版本
The `package` 模組在現在資料夾是一個套件的儲藏庫時出現,並顯示他的現在版本。 The module currently supports `npm`, `nimble`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix`, `helm`, `shards` and `dart` packages.
The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `nimble`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix`, `helm`, `shards` and `dart` packages.
- [**npm**](https://docs.npmjs.com/cli/commands/npm) The `npm` package version is extracted from the `package.json` present in the current directory
- [**Cargo**](https://doc.rust-lang.org/cargo/) The `cargo` package version is extracted from the `Cargo.toml` present in the current directory
@ -2234,11 +2266,11 @@ The `package` 模組在現在資料夾是一個套件的儲藏庫時出現,並
| Option | 預設 | 說明 |
| ----------------- | --------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"is [$symbol$version]($style) "` | The format for the module. |
| `symbol` | `"📦 "` | 顯示在套件的版本之前的符號。 |
| `symbol` | `"📦 "` | The symbol used before displaying the version the package. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `style` | `"bold 208"` | 這個模組的風格。 |
| `display_private` | `false` | Enable displaying version for packages marked as private. |
| `disabled` | `false` | 停用 `package` 模組。 |
| `disabled` | `false` | Disables the `package` module. |
### Variables
@ -2370,7 +2402,7 @@ By default the module will be shown if any of the following conditions are met:
| --------- | ---------- | ------------------------------------ |
| version | `v0.12.24` | The version of `pulumi` |
| stack | `dev` | The current Pulumi stack |
| 使用者名稱 | `alice` | The current Pulumi username |
| username | `alice` | The current Pulumi username |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
@ -2461,13 +2493,13 @@ By default the module will be shown if any of the following conditions are met:
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `"🐍 "` | A format string representing the symbol of Python |
| `style` | `"yellow bold"` | 這個模組的風格。 |
| `pyenv_version_name` | `false` | 使用 pyenv 取得 Python 的版本。 |
| `pyenv_version_name` | `false` | Use pyenv to get Python version |
| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used |
| `python_binary` | `["python", "python3", "python2"]` | Configures the python binaries that Starship should executes when getting the version. |
| `detect_extensions` | `["py"]` | Which extensions should trigger this module |
| `detect_files` | `[".python-version", "Pipfile", "__init__.py", "pyproject.toml", "requirements.txt", "setup.py", "tox.ini"]` | Which filenames should trigger this module |
| `detect_folders` | `[]` | Which folders should trigger this module |
| `disabled` | `false` | 停用 `python` 模組。 |
| `disabled` | `false` | Disables the `python` module. |
::: tip
@ -2568,7 +2600,7 @@ 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 module will be shown if any of the following conditions are met:
- The current directory contains a file with `.red` or `.reds` extension
@ -2606,7 +2638,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/). The module will be shown if any of the following conditions are met:
- 目前資料夾中有一個 `Gemfile` 檔案
- The current directory contains a `.ruby-version` file
@ -2627,7 +2659,7 @@ Starship gets the current Ruby version by running `ruby -v`.
| `detect_folders` | `[]` | Which folders should trigger this module. |
| `detect_variables` | `["RUBY_VERSION", "RBENV_VERSION"]` | Which environment variables should trigger this module. |
| `style` | `"bold red"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `ruby` 模組。 |
| `disabled` | `false` | Disables the `ruby` module. |
### Variables
@ -2650,7 +2682,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/). The module will be shown if any of the following conditions are met:
- 目前資料夾中有一個 `Cargo.toml` 檔案
- 現在資料夾中包含一個檔案具有 `.rs` 副檔名
@ -2666,7 +2698,7 @@ By default the `rust` module shows the currently installed version of [Rust](htt
| `detect_files` | `["Cargo.toml"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this module. |
| `style` | `"bold red"` | 這個模組的風格。 |
| `disabled` | `false` | 停用 `rust` 模組。 |
| `disabled` | `false` | Disables the `rust` module. |
### Variables
@ -2733,7 +2765,7 @@ The `shell` module shows an indicator for currently used shell.
::: tip
這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -2852,7 +2884,7 @@ The `status` module displays the exit code of the previous command. The module w
::: tip
這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -2913,7 +2945,7 @@ The `sudo` module displays if sudo credentials are currently cached. The module
::: tip
這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
@ -2958,7 +2990,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 module will be shown if any of the following conditions are met:
- The current directory contains a `Package.swift` file
- The current directory contains a file with the `.swift` extension
@ -3056,33 +3088,33 @@ format = "[🏎💨 $workspace]($style) "
## 時間
`time` 模組顯示目前的**當地**時間. `format` 設定值被 [`chrono`](https://crates.io/crates/chrono) crate 用來控制時間如何顯示。 請看 [chrono 的 strftime 文件](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html)來了解有那些選項可以使用。
The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available.
::: tip
這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`
This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file.
:::
### 選項
| Option | 預設 | 說明 |
| ----------------- | ----------------------- | ----------------------------------------------------------------------------------------------------- |
| `format` | `"at [$time]($style) "` | The format string for the module. |
| `use_12hr` | `false` | 啟用 12 小時格式。 |
| `time_format` | 請看下列 | 用來顯示時間的 [chrono 格式字串](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html)。 |
| `style` | `"bold yellow"` | 這個模組的時間的風格。 |
| `utc_time_offset` | `"local"` | 設定相對於 UTC 的時差。 Range from -24 &lt; x &lt; 24. 允許使用浮點數來表示 30/45 分鐘時差的時區。 |
| `disabled` | `true` | 停用 `time` 模組。 |
| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format |
| Option | 預設 | 說明 |
| ----------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `format` | `"at [$time]($style) "` | The format string for the module. |
| `use_12hr` | `false` | Enables 12 hour formatting |
| `time_format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. |
| `style` | `"bold yellow"` | The style for the module time |
| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 &lt; x &lt; 24. Allows floats to accommodate 30/45 minute timezone offsets. |
| `disabled` | `true` | Disables the `time` module. |
| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format |
If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. 不然的話,它會被預設為 `"%T"` Manually setting `time_format` will override the `use_12hr` setting.
If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting.
### Variables
| 變數 | 範例 | 說明 |
| --------- | ---------- | ----------------------------------- |
| 時間 | `13:08:10` | The current time. |
| time | `13:08:10` | The current time. |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
@ -3102,7 +3134,7 @@ time_range = "10:00:00-14:00:00"
## 使用者名稱
`username` 模組顯示現在使用中的使用者名稱。 這個模組在下列其中一個條件達成時顯示:
The `username` module shows active user's username. The module will be shown if any of the following conditions are met:
- 目前使用者為 root
- 目前使用者並非登入時的使用者
@ -3117,13 +3149,13 @@ SSH connection is detected by checking environment variables `SSH_CONNECTION`, `
### 選項
| Option | 預設 | 說明 |
| ------------- | ----------------------- | -------------------------- |
| `style_root` | `"bold red"` | 使用者為 root 時使用的風格。 |
| `style_user` | `"bold yellow"` | 非 root 使用者時使用的風格。 |
| `format` | `"[$user]($style) in "` | The format for the module. |
| `show_always` | `false` | 總是顯示 `username` 模組。 |
| `disabled` | `false` | 停用 `username` 模組。 |
| Option | 預設 | 說明 |
| ------------- | ----------------------- | ------------------------------------- |
| `style_root` | `"bold red"` | The style used when the user is root. |
| `style_user` | `"bold yellow"` | The style used for non-root users. |
| `format` | `"[$user]($style) in "` | The format for the module. |
| `show_always` | `false` | Always shows the `username` module. |
| `disabled` | `false` | Disables the `username` module. |
### Variables
@ -3253,7 +3285,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 module will be shown if any of the following conditions are met:
- The current directory contains a `.zig` file
@ -3334,7 +3366,7 @@ Format strings can also contain shell specific prompt sequences, e.g. [Bash](htt
| `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`. |
| `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. |

View File

@ -63,7 +63,6 @@ nix-env -iA nixos.starship
{
programs.starship = {
enable = true;
enableZshIntegration = true;
# Configuration written to ~/.config/starship.toml
settings = {
# add_newline = false;