1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-28 07:46:28 +00:00

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

This commit is contained in:
Matan Kushner 2020-10-13 15:09:01 -04:00 committed by GitHub
parent 4de9e43cff
commit 02f7418820
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 1220 additions and 1202 deletions

View File

@ -235,8 +235,8 @@ When using [aws-vault](https://github.com/99designs/aws-vault) the profile is re
### Optionen
| Option | Standardwert | Beschreibung |
| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | The format for the module. |
| ---------------- | ------------------------------------------------ | --------------------------------------------------------------- |
| `format` | `'on [$symbol$profile(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | Symbol das vor dem aktuellen AWS-Profil angezeigt wird. |
| `region_aliases` | | Table of region aliases to display in addition to the AWS name. |
| `style` | `"bold yellow"` | Stil für dieses Modul. |
@ -261,7 +261,7 @@ When using [aws-vault](https://github.com/99designs/aws-vault) the profile is re
# ~/.config/starship.toml
[aws]
format = "on [$symbol$profile(\\($region\\))]($style) "
format = 'on [$symbol$profile(\($region\))]($style) '
style = "bold blue"
symbol = "🅰 "
[aws.region_aliases]
@ -346,7 +346,7 @@ style = "bold red"
Die `display`-Option beinhaltet ein Array mit den folgenden Werten.
| Variable | Beschreibung |
| Option | Beschreibung |
| ----------- | ------------------------------------------------------- |
| `threshold` | Der Schwellenwert zur Anzeige dieser Option. |
| `style` | Der Stil, der zur Anzeige dieser Option verwendet wird. |
@ -575,7 +575,7 @@ The `dart` module shows the currently installed version of Dart. Das Modul wird
### Optionen
| Variable | Standartwert | Beschreibung |
| Option | Standartwert | Beschreibung |
| ---------- | ---------------------------------- | ----------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | The format for the module. |
| `symbol` | `"🎯 "` | A format string representing the symbol of Dart |
@ -611,7 +611,7 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
### Optionen
| Variable | Standardwert | Beschreibung |
| 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. |
@ -620,6 +620,7 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
| `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: "…/" |
<details>
<summary>Dieses Modul hat einige erweiterte Konfigurationsoptionen, welche die Darstellung von Verzeichnissen steuern.</summary>
@ -658,6 +659,7 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
[directory]
truncation_length = 8
truncation_symbol = "…/"
```
## Docker Context
@ -756,10 +758,10 @@ The `elixir` module shows the currently installed version of Elixir and Erlang/O
### Optionen
| Option | Standardwert | Beschreibung |
| ---------- | ------------------------------------------------------------- | --------------------------------------------------------------- |
| ---------- | --------------------------------------------------------- | --------------------------------------------------------------- |
| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. |
| `style` | `"bold purple"` | Stil für dieses Modul. |
| `format` | `"via [$symbol$version \\(OTP $otp_version\\)]($style) "` | The format for the module elixir. |
| `format` | `'via [$symbol$version \(OTP $otp_version\)]($style) '` | The format for the module elixir. |
| `disabled` | `false` | Disables the `elixir` module. |
### Variables
@ -898,9 +900,9 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### Optionen
| Variable | Standardwert | Beschreibung |
| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `"on [$symbol$account(\\($region\\))]($style) "` | The format for the module. |
| Option | Standardwert | Beschreibung |
| ---------------- | ------------------------------------------------ | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(\($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"` | Stil für dieses Modul. |
@ -927,7 +929,7 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
# ~/.config/starship.toml
[gcloud]
format = "on [$symbol$account(\\($project\\))]($style) "
format = 'on [$symbol$account(\($project\))]($style) '
```
#### Display active config name only
@ -995,9 +997,9 @@ The `git_commit` module shows the current commit hash of the repo in your curren
### Optionen
| Option | Standartwert | Beschreibung |
| -------------------- | ------------------------------ | ----------------------------------------------------- |
| -------------------- | -------------------------- | ----------------------------------------------------- |
| `commit_hash_length` | `7` | The length of the displayed git commit hash. |
| `format` | `"[\\($hash\\)]($style) "` | The format for the module. |
| `format` | `'[\($hash\)]($style) '` | The format for the module. |
| `style` | `"bold green"` | Stil für dieses Modul. |
| `only_detached` | `true` | Only show git commit hash when in detached HEAD state |
| `disabled` | `false` | Disables the `git_commit` module. |
@ -1027,7 +1029,7 @@ The `git_state` module will show in directories which are part of a git reposito
### Optionen
| Option | Standardwert | Beschreibung |
| -------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| -------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `rebase` | `"REBASING"` | A format string displayed when a `rebase` is in progress. |
| `merge` | `"MERGING"` | A format string displayed when a `merge` is in progress. |
| `revert` | `"REVERTING"` | A format string displayed when a `revert` is in progress. |
@ -1036,7 +1038,7 @@ The `git_state` module will show in directories which are part of a git reposito
| `am` | `"AM"` | A format string displayed when an `apply-mailbox` (`git am`) is in progress. |
| `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)\\) "` | The format for the module. |
| `format` | `'\([$state( $progress_current/$progress_total)]($style)\) '` | The format for the module. |
| `disabled` | `false` | Deaktiviert das `git_state`-Modul. |
### Variables
@ -1056,7 +1058,7 @@ The `git_state` module will show in directories which are part of a git reposito
# ~/.config/starship.toml
[git_state]
format = "[\\($state( $progress_current of $progress_total)\\)]($style) "
format = '[\($state( $progress_current of $progress_total)\)]($style) '
cherry_pick = "[🍒 PICKING](bold red)"
```
@ -1067,8 +1069,8 @@ The `git_status` module shows symbols representing the state of the repo in your
### Optionen
| Option | Standardwert | Beschreibung |
| ------------ | --------------------------------------------- | ----------------------------------- |
| `format` | `"[\[$all_status$ahead_behind\]]($style) "` | The default format for `git_status` |
| ------------ | ----------------------------------------------- | ----------------------------------- |
| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` |
| `conflicted` | `"="` | This branch has merge conflicts. |
| `ahead` | `"⇡"` | The format of `ahead` |
| `behind` | `"⇣"` | The format of `behind` |
@ -1372,11 +1374,10 @@ Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `dis
### Optionen
| Option | Standardwert | Beschreibung |
| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- |
| ----------------- | ---------------------------------------------------- | --------------------------------------------------------------------- |
| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. |
| `format` | `"[$symbol$context( \\($namespace\\))]($style) in "` | The format for the module. |
| `format` | `'[$symbol$context( \($namespace\))]($style) in '` | The format for the module. |
| `style` | `"cyan bold"` | Stil für dieses Modul. |
| `namespace_spaceholder` | `none` | The value to display if no namespace was found. |
| `context_aliases` | | Table of context aliases to display. |
| `disabled` | `true` | Deaktiviert das `kubernetes`-Modul. |
@ -1397,7 +1398,7 @@ Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `dis
# ~/.config/starship.toml
[kubernetes]
format = "on [⛵ $context \\($namespace\\)](dimmed green) "
format = 'on [⛵ $context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
@ -1553,8 +1554,8 @@ Das `nix_shell`-Modul zeigt die nix-shell Umgebung an. Das Modul wird angezeigt,
### Optionen
| Option | Standartwert | Beschreibung |
| ------------ | -------------------------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$state( \\($name\\))]($style) "` | The format for the module. |
| ------------ | ---------------------------------------------- | ----------------------------------------------------- |
| `format` | `'via [$symbol$state( \($name\))]($style) '` | The format for the module. |
| `symbol` | `"❄️ "` | A format string representing the symbol of nix-shell. |
| `style` | `"bold blue"` | Stil für dieses Modul. |
| `impure_msg` | `"impure"` | A format string shown when the shell is impure. |
@ -1581,7 +1582,7 @@ Das `nix_shell`-Modul zeigt die nix-shell Umgebung an. Das Modul wird angezeigt,
disabled = true
impure_msg = "[impure shell](bold red)"
pure_msg = "[pure shell](bold green)"
format = "via [☃️ $state( \\($name\\))](bold blue) "
format = 'via [☃️ $state( \($name\))](bold blue) '
```
## NodeJS
@ -1718,7 +1719,7 @@ The `perl` module shows the currently installed version of Perl. Das Modul wird
### Optionen
| Variable | Standartwert | Beschreibung |
| Option | Standartwert | Beschreibung |
| ---------- | ---------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | The format string for the module. |
| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl |
@ -1799,13 +1800,14 @@ Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
### Optionen
| Option | Standardwert | Beschreibung |
| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | The format for the module. |
| -------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `format` | `'via [${symbol}${pyenv_prefix}${version}( \($virtualenv\))]($style) '` | The format for the module. |
| `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_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. |
| `disabled` | `false` | Deaktiviert das `python`-Modul. |
### Variables
@ -1818,23 +1820,6 @@ Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` |
| virtualenv | `"venv"` | The current `virtualenv` name |
<details>
<summary>This module has some advanced configuration options.</summary>
| Variable | Standardwert | Beschreibung |
| --------------- | ------------ | ----------------------------------------------------------------------------- |
| `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. |
The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
</details>
### Beispiel
@ -1846,6 +1831,17 @@ symbol = "👾 "
pyenv_version_name = true
```
Using the `python3` binary to get the version.
Note - The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
## Ruby
Das `ruby` Modul zeigt die derzeit installierte Version von Ruby an. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist:
@ -1856,7 +1852,7 @@ Das `ruby` Modul zeigt die derzeit installierte Version von Ruby an. Das Modul w
### Optionen
| Option | Standartwert | Beschreibung |
| Option | Standardwert | Beschreibung |
| ---------- | ---------------------------------- | ------------------------------------------------ |
| `format` | `"via [$symbol$version]($style) "` | The format for the module. |
| `symbol` | `"💎 "` | A format string representing the symbol of Ruby. |
@ -1891,7 +1887,7 @@ Das `rust` Modul zeigt die derzeit installierte Version von Rust an. Das Modul w
### Optionen
| Option | Standartwert | Beschreibung |
| Option | Standardwert | Beschreibung |
| ---------- | ---------------------------------- | ----------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | The format for the module. |
| `symbol` | `"🦀 "` | A format string representing the symbol of Rust |
@ -1923,7 +1919,7 @@ The `shlvl` module shows the current SHLVL ("shell level") environment variable,
### Optionen
| Variable | Standartwert | Beschreibung |
| Option | Standardwert | Beschreibung |
| ----------- | ---------------------------- | --------------------------------------- |
| `threshold` | `2` | Display threshold. |
| `format` | `"[$symbol$shlvl]($style) "` | The format for the module. |
@ -1958,9 +1954,9 @@ The `singularity` module shows the current singularity image, if inside a contai
### Optionen
| Option | Standartwert | Beschreibung |
| ---------- | ------------------------------------ | ------------------------------------------------ |
| `format` | `"[$symbol\\[$env\\]]($style) "` | The format for the module. |
| Option | Standardwert | Beschreibung |
| ---------- | -------------------------------- | ------------------------------------------------ |
| `format` | `'[$symbol\[$env\]]($style) '` | The format for the module. |
| `symbol` | `""` | A format string displayed before the image name. |
| `style` | `"bold dimmed blue"` | Stil für dieses Modul. |
| `disabled` | `false` | Disables the `singularity` module. |
@ -1981,7 +1977,7 @@ The `singularity` module shows the current singularity image, if inside a contai
# ~/.config/starship.toml
[singularity]
format = "[📦 \\[$env\\]]($style) "
format = '[📦 \[$env\]]($style) '
```
## Swift
@ -1993,7 +1989,7 @@ The `swift` module shows the currently installed version of Swift. Das Modul wir
### Optionen
| Option | Standartwert | Beschreibung |
| Option | Standardwert | Beschreibung |
| ---------- | ---------------------------------- | ------------------------------------------------ |
| `format` | `"via [$symbol$version]($style) "` | The format for the module. |
| `symbol` | `"🐦 "` | A format string representing the symbol of Swift |
@ -2029,7 +2025,7 @@ Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `dis
### Optionen
| Variable | Standartwert | Beschreibung |
| Option | Standardwert | Beschreibung |
| ---------- | -------------------------- | ------------------------------------------------------ |
| `format` | `[$symbol$status]($style)` | The format of the module |
| `symbol` | `"✖"` | A format string representing the symbol for the status |
@ -2055,7 +2051,7 @@ Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `dis
[status]
style = "bg:blue"
symbol = "💣 "
format = "[\\[$symbol$status\\]]($style) "
format = '[\[$symbol$status\]]($style) '
disabled = false
```
@ -2147,7 +2143,7 @@ If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Andernfalls ist
[time]
disabled = false
format = "🕙[\\[ $time \\]]($style) "
format = '🕙[\[ $time \]]($style) '
time_format = "%T"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"

View File

@ -10,6 +10,10 @@
- **Konfiguration**: [Matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish)
- **Prompt**: [Starship](https://starship.rs/)
## How do I get command completion as shown in the demo GIF?
Completion support is provided by your shell of choice. In the case of the demo, the demo was done with [Fish Shell](https://fishshell.com/), which provides completions by default. If you use Z Shell (zsh), I'd suggest taking a look at [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions).
## Do top level `format` and `<module>.disabled` do the same thing?
Ja, beide können benutzt werden, um Module in der Prompt zu deaktivieren. Wenn nur Module deaktiviert werden wollen, sollte `<module>.disabled` benutzt werden, aus den folgenden Gründen:

View File

@ -8,7 +8,7 @@ This guide is intended to walk you through the breaking changes.
Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship.
Starship v0.45.0 will instead be accepting a `format` value, allowing for customization of the prompt outside of the modules themselves.
Starship v0.45.0 instead accepts a `format` value, allowing for customization of the prompt outside of the modules themselves.
**Example pre-v0.45.0 configuration**
@ -52,11 +52,11 @@ format = """\
"""
```
## Module `prefix` and `suffix` will be replaced by `format`
## Module `prefix` and `suffix` have been replaced by `format`
Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered.
Starship v0.45.0 will instead be accepting a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
Starship v0.45.0 instead accepts a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
**Example pre-v0.45.0 configuration**
@ -71,7 +71,7 @@ prefix = "took "
[cmd_duration]
# $duration The command duration (e.g. "15s")
# $style The default style of the module (e.g. "bold yellow")
format = "took [$duration]($style)"
format = "took [$duration]($style) "
```
### Affected Modules
@ -93,8 +93,8 @@ format = "took [$duration]($style)"
-- error_symbol = "✖"
-- use_symbol_for_status = true
-- vicmd_symbol = ""
++ success_symbol = "[](bold green) "
++ error_symbol = "[](bold red) "
++ success_symbol = "[](bold green)"
++ error_symbol = "[](bold red)"
++ vicmd_symbol = "[](bold green)"
```
@ -106,9 +106,11 @@ To configure the prompt to use the older `use_symbol_for_status = true` configur
```toml
[character]
error_symbol = "[✖](bold red) "
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.
#### Befehlsdauer
| Removed Property | Replacement |
@ -120,7 +122,7 @@ error_symbol = "[✖](bold red) "
```diff
[cmd_duration]
-- prefix = "took "
++ format = "took [$duration]($style)"
++ format = "took [$duration]($style) "
```
#### Verzeichnis
@ -134,7 +136,7 @@ error_symbol = "[✖](bold red) "
```diff
[directory]
-- prefix = "in "
++ format = "[$path]($style)[$read_only]($read_only_style)"
++ format = "[$path]($style)[$read_only]($read_only_style) "
```
#### Umgebungsvariablen
@ -166,7 +168,7 @@ error_symbol = "[✖](bold red) "
[git_commit]
-- prefix = "("
-- suffix = ")"
++ format = "[\\($hash\\)]($style) "
++ format = '[\($hash\)]($style) '
```
#### Git-Status
@ -184,12 +186,12 @@ error_symbol = "[✖](bold red) "
-- prefix = "["
-- suffix = "]"
-- show_sync_count = false
++ format = "([$all_status$ahead_behind] )"
++ format = '([\[$all_status$ahead_behind\]]($style) )'
```
Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch.
With the release of v0.45.0, this has been replaced with the
With the release of v0.45.0, this has been replaced with three separate properties, `ahead`, `behind`, and `diverged`.
To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file:
@ -230,7 +232,7 @@ behind = "⇣${count}"
[singularity]
-- prefix = ""
-- suffix = ""
++ format = "[$symbol\\[$env\\]]($style) "
++ format = '[$symbol\[$env\]]($style) '
```
#### Zeit
@ -245,7 +247,7 @@ behind = "⇣${count}"
[time]
-- format = "🕙[ %T ]"
++ time_format = "%T"
++ format = "at 🕙[$time]($style)
++ format = "at 🕙[$time]($style) "
```
#### Custom Commands

View File

@ -236,8 +236,8 @@ Cuando uses [aws-vault](https://github.com/99designs/aws-vault) el perfil se obt
### Opciones
| Opción | Por defecto | Descripción |
| ---------------- | ---------------------------------------------------- | ------------------------------------------------------------ |
| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | El formato del módulo. |
| ---------------- | ------------------------------------------------ | ------------------------------------------------------------ |
| `format` | `'on [$symbol$profile(\($region\))]($style) '` | El formato del módulo. |
| `symbol` | `"☁️ "` | El símbolo que se muestra antes del perfil de AWS. |
| `region_aliases` | | Tabla de alias de región para mostrar además del nombre AWS. |
| `style` | `"bold yellow"` | El estilo del módulo. |
@ -262,7 +262,7 @@ Cuando uses [aws-vault](https://github.com/99designs/aws-vault) el perfil se obt
# ~/.config/starship.toml
[aws]
format = "on [$symbol$profile(\\($region\\))]($style) "
format = 'on [$symbol$profile(\($region\))]($style) '
style = "bold blue"
symbol = "🅰 "
[aws.region_aliases]
@ -347,7 +347,7 @@ style = "bold red"
La opción `display` es un array de la siguiente tabla.
| Variable | Descripción |
| Opción | Descripción |
| ----------- | --------------------------------------------------------------- |
| `threshold` | El umbral para la opción de visualización. |
| `style` | El estilo usado cuando si la opción <0>display</0> está activa. |
@ -576,7 +576,7 @@ El módulo `dart` muestra la versión actualmente instalada de Dart. El módulo
### Opciones
| Variable | Por defecto | Descripción |
| Opción | Por defecto | Descripción |
| ---------- | ---------------------------------- | ------------------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | El formato del módulo. |
| `symbol` | `"🎯 "` | Una cadena de formato que representa el símbolo de Dart |
@ -612,7 +612,7 @@ Por ejemplo, dado `~/Dev/Nix/nixpkgs/pkgs` donde `nixpkgs` es la raíz del repos
### Opciones
| Variable | Por defecto | Descripción |
| Opción | Por defecto | Descripción |
| ------------------- | -------------------------------------------------- | --------------------------------------------------------------------- |
| `truncation_length` | `3` | El número de carpetas a las que se debe truncar el directorio actual. |
| `truncate_to_repo` | `true` | Truncar o no hasta la raíz del repositorio git en el que se esté. |
@ -621,6 +621,7 @@ Por ejemplo, dado `~/Dev/Nix/nixpkgs/pkgs` donde `nixpkgs` es la raíz del repos
| `disabled` | `false` | Deshabilita el módulo `directory`. |
| `read_only` | `"🔒"` | El símbolo que indica si el directorio actual es de sólo lectura. |
| `read_only_style` | `"red"` | El estilo para el símbolo de sólo lectura. |
| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" |
<details>
<summary>Este módulo tiene algunas opciones avanzadas de configuración que controlan cómo se muestra el directorio.</summary>
@ -659,6 +660,7 @@ Por ejemplo, dado `~/Dev/Nix/nixpkgs/pkgs` donde `nixpkgs` es la raíz del repos
[directory]
truncation_length = 8
truncation_symbol = "…/"
```
## Docker Context
@ -757,10 +759,10 @@ El módulo `elixir` muestra la version instalada actualmente de Elixir y Erlang/
### Opciones
| Opción | Por defecto | Descripción |
| ---------- | ------------------------------------------------------------- | -------------------------------------------------------------- |
| ---------- | --------------------------------------------------------- | -------------------------------------------------------------- |
| `symbol` | `"💧 "` | El símbolo usado antes de mostrar la version de Elixir/Erlang. |
| `style` | `"bold purple"` | El estilo del módulo. |
| `format` | `"via [$symbol$version \\(OTP $otp_version\\)]($style) "` | El formato para el módulo elixir. |
| `format` | `'via [$symbol$version \(OTP $otp_version\)]($style) '` | El formato para el módulo elixir. |
| `disabled` | `false` | Deshabilita el módulo `elixir`. |
### Variables
@ -899,9 +901,9 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### Opciones
| Variable | Por defecto | Descripción |
| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `"on [$symbol$account(\\($region\\))]($style) "` | El formato del módulo. |
| Opción | Por defecto | Descripción |
| ---------------- | ------------------------------------------------ | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(\($region\))]($style) '` | El formato del módulo. |
| `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"` | El estilo del módulo. |
@ -928,7 +930,7 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
# ~/.config/starship.toml
[gcloud]
format = "on [$symbol$account(\\($project\\))]($style) "
format = 'on [$symbol$account(\($project\))]($style) '
```
#### Display active config name only
@ -996,9 +998,9 @@ The `git_commit` module shows the current commit hash of the repo in your curren
### Opciones
| Opción | Por defecto | Descripción |
| -------------------- | ------------------------------ | ----------------------------------------------------- |
| -------------------- | -------------------------- | ----------------------------------------------------- |
| `commit_hash_length` | `7` | The length of the displayed git commit hash. |
| `format` | `"[\\($hash\\)]($style) "` | El formato del módulo. |
| `format` | `'[\($hash\)]($style) '` | El formato del módulo. |
| `style` | `"bold green"` | El estilo del módulo. |
| `only_detached` | `true` | Only show git commit hash when in detached HEAD state |
| `disabled` | `false` | Disables the `git_commit` module. |
@ -1028,7 +1030,7 @@ The `git_state` module will show in directories which are part of a git reposito
### Opciones
| Opción | Por defecto | Descripción |
| -------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| -------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `rebase` | `"REBASING"` | A format string displayed when a `rebase` is in progress. |
| `merge` | `"MERGING"` | A format string displayed when a `merge` is in progress. |
| `revert` | `"REVERTING"` | A format string displayed when a `revert` is in progress. |
@ -1037,7 +1039,7 @@ The `git_state` module will show in directories which are part of a git reposito
| `am` | `"AM"` | A format string displayed when an `apply-mailbox` (`git am`) is in progress. |
| `am_or_rebase` | `"AM/REBASE"` | A format string displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. |
| `style` | `"bold yellow"` | El estilo del módulo. |
| `format` | `"\\([$state( $progress_current/$progress_total)]($style)\\) "` | El formato del módulo. |
| `format` | `'\([$state( $progress_current/$progress_total)]($style)\) '` | El formato del módulo. |
| `disabled` | `false` | Disables the `git_state` module. |
### Variables
@ -1057,7 +1059,7 @@ The `git_state` module will show in directories which are part of a git reposito
# ~/.config/starship.toml
[git_state]
format = "[\\($state( $progress_current of $progress_total)\\)]($style) "
format = '[\($state( $progress_current of $progress_total)\)]($style) '
cherry_pick = "[🍒 PICKING](bold red)"
```
@ -1068,8 +1070,8 @@ The `git_status` module shows symbols representing the state of the repo in your
### Opciones
| Opción | Por defecto | Descripción |
| ------------ | --------------------------------------------- | ----------------------------------- |
| `format` | `"[\[$all_status$ahead_behind\]]($style) "` | The default format for `git_status` |
| ------------ | ----------------------------------------------- | ----------------------------------- |
| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` |
| `conflicted` | `"="` | This branch has merge conflicts. |
| `ahead` | `"⇡"` | The format of `ahead` |
| `behind` | `"⇣"` | The format of `behind` |
@ -1373,11 +1375,10 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
### Opciones
| Opción | Por defecto | Descripción |
| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- |
| ----------------- | ---------------------------------------------------- | --------------------------------------------------------------------- |
| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. |
| `format` | `"[$symbol$context( \\($namespace\\))]($style) in "` | El formato del módulo. |
| `format` | `'[$symbol$context( \($namespace\))]($style) in '` | El formato del módulo. |
| `style` | `"cyan bold"` | El estilo del módulo. |
| `namespace_spaceholder` | `none` | The value to display if no namespace was found. |
| `context_aliases` | | Table of context aliases to display. |
| `disabled` | `true` | Disables the `kubernetes` module. |
@ -1398,7 +1399,7 @@ 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 [⛵ $context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
@ -1554,8 +1555,8 @@ The `nix_shell` module shows the nix-shell environment. The module will be shown
### Opciones
| Opción | Por defecto | Descripción |
| ------------ | -------------------------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$state( \\($name\\))]($style) "` | El formato del módulo. |
| ------------ | ---------------------------------------------- | ----------------------------------------------------- |
| `format` | `'via [$symbol$state( \($name\))]($style) '` | El formato del módulo. |
| `symbol` | `"❄️ "` | A format string representing the symbol of nix-shell. |
| `style` | `"bold blue"` | El estilo del módulo. |
| `impure_msg` | `"impure"` | A format string shown when the shell is impure. |
@ -1582,7 +1583,7 @@ The `nix_shell` module shows the nix-shell environment. The module will be shown
disabled = true
impure_msg = "[impure shell](bold red)"
pure_msg = "[pure shell](bold green)"
format = "via [☃️ $state( \\($name\\))](bold blue) "
format = 'via [☃️ $state( \($name\))](bold blue) '
```
## NodeJS
@ -1719,7 +1720,7 @@ The `perl` module shows the currently installed version of Perl. El módulo se m
### Opciones
| Variable | Por defecto | Descripción |
| Opción | Por defecto | Descripción |
| ---------- | ---------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | The format string for the module. |
| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl |
@ -1800,13 +1801,14 @@ El módulo se muestra si algunas de las siguientes condiciones se cumplen:
### Opciones
| Opción | Por defecto | Descripción |
| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | El formato del módulo. |
| -------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `format` | `'via [${symbol}${pyenv_prefix}${version}( \($virtualenv\))]($style) '` | El formato del módulo. |
| `symbol` | `"🐍 "` | A format string representing the symbol of Python |
| `style` | `"yellow bold"` | El estilo del módulo. |
| `pyenv_version_name` | `false` | Use pyenv to get Python version |
| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. |
| `disabled` | `false` | Disables the `python` module. |
### Variables
@ -1819,23 +1821,6 @@ El módulo se muestra si algunas de las siguientes condiciones se cumplen:
| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` |
| virtualenv | `"venv"` | The current `virtualenv` name |
<details>
<summary>This module has some advanced configuration options.</summary>
| Variable | Por defecto | Descripción |
| --------------- | ----------- | ----------------------------------------------------------------------------- |
| `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. |
The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
</details>
### Ejemplo
@ -1847,6 +1832,17 @@ symbol = "👾 "
pyenv_version_name = true
```
Using the `python3` binary to get the version.
Note - The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
## Ruby
The `ruby` module shows the currently installed version of Ruby. El módulo se muestra si algunas de las siguientes condiciones se cumplen:
@ -1924,7 +1920,7 @@ The `shlvl` module shows the current SHLVL ("shell level") environment variable,
### Opciones
| Variable | Por defecto | Descripción |
| Opción | Por defecto | Descripción |
| ----------- | ---------------------------- | --------------------------------------- |
| `threshold` | `2` | Display threshold. |
| `format` | `"[$symbol$shlvl]($style) "` | El formato del módulo. |
@ -1960,8 +1956,8 @@ The `singularity` module shows the current singularity image, if inside a contai
### Opciones
| Opción | Por defecto | Descripción |
| ---------- | ------------------------------------ | ------------------------------------------------ |
| `format` | `"[$symbol\\[$env\\]]($style) "` | El formato del módulo. |
| ---------- | -------------------------------- | ------------------------------------------------ |
| `format` | `'[$symbol\[$env\]]($style) '` | El formato del módulo. |
| `symbol` | `""` | A format string displayed before the image name. |
| `style` | `"bold dimmed blue"` | El estilo del módulo. |
| `disabled` | `false` | Disables the `singularity` module. |
@ -1982,7 +1978,7 @@ The `singularity` module shows the current singularity image, if inside a contai
# ~/.config/starship.toml
[singularity]
format = "[📦 \\[$env\\]]($style) "
format = '[📦 \[$env\]]($style) '
```
## Swift
@ -2030,7 +2026,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
### Opciones
| Variable | Por defecto | Descripción |
| Opción | Por defecto | Descripción |
| ---------- | -------------------------- | ------------------------------------------------------ |
| `format` | `[$symbol$status]($style)` | The format of the module |
| `symbol` | `"✖"` | A format string representing the symbol for the status |
@ -2056,7 +2052,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
[status]
style = "bg:blue"
symbol = "💣 "
format = "[\\[$symbol$status\\]]($style) "
format = '[\[$symbol$status\]]($style) '
disabled = false
```
@ -2148,7 +2144,7 @@ If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it de
[time]
disabled = false
format = "🕙[\\[ $time \\]]($style) "
format = '🕙[\[ $time \]]($style) '
time_format = "%T"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"

View File

@ -10,6 +10,10 @@
- **Configuración**: [archivos de configuración de matchai](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish)
- **Prompt**: [Starship](https://starship.rs/)
## How do I get command completion as shown in the demo GIF?
Completion support is provided by your shell of choice. In the case of the demo, the demo was done with [Fish Shell](https://fishshell.com/), which provides completions by default. If you use Z Shell (zsh), I'd suggest taking a look at [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions).
## Do top level `format` and `<module>.disabled` do the same thing?
Sí, se pueden usar ambos para desactivar los módulos en el símbolo del sistema. Si todo lo que planeas es desactivar módulos, `<module>.disabled` es el método preferido por las siguientes razones:

View File

@ -8,7 +8,7 @@ This guide is intended to walk you through the breaking changes.
Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship.
Starship v0.45.0 will instead be accepting a `format` value, allowing for customization of the prompt outside of the modules themselves.
Starship v0.45.0 instead accepts a `format` value, allowing for customization of the prompt outside of the modules themselves.
**Example pre-v0.45.0 configuration**
@ -52,11 +52,11 @@ format = """\
"""
```
## Module `prefix` and `suffix` will be replaced by `format`
## Module `prefix` and `suffix` have been replaced by `format`
Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered.
Starship v0.45.0 will instead be accepting a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
Starship v0.45.0 instead accepts a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
**Example pre-v0.45.0 configuration**
@ -71,7 +71,7 @@ prefix = "took "
[cmd_duration]
# $duration The command duration (e.g. "15s")
# $style The default style of the module (e.g. "bold yellow")
format = "took [$duration]($style)"
format = "took [$duration]($style) "
```
### Affected Modules
@ -93,8 +93,8 @@ format = "took [$duration]($style)"
-- error_symbol = "✖"
-- use_symbol_for_status = true
-- vicmd_symbol = ""
++ success_symbol = "[](bold green) "
++ error_symbol = "[](bold red) "
++ success_symbol = "[](bold green)"
++ error_symbol = "[](bold red)"
++ vicmd_symbol = "[](bold green)"
```
@ -106,9 +106,11 @@ To configure the prompt to use the older `use_symbol_for_status = true` configur
```toml
[character]
error_symbol = "[✖](bold red) "
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.
#### Tiempo de ejecución
| Removed Property | Replacement |
@ -120,7 +122,7 @@ error_symbol = "[✖](bold red) "
```diff
[cmd_duration]
-- prefix = "took "
++ format = "took [$duration]($style)"
++ format = "took [$duration]($style) "
```
#### Directory
@ -134,7 +136,7 @@ error_symbol = "[✖](bold red) "
```diff
[directory]
-- prefix = "in "
++ format = "[$path]($style)[$read_only]($read_only_style)"
++ format = "[$path]($style)[$read_only]($read_only_style) "
```
#### Variable de entorno
@ -166,7 +168,7 @@ error_symbol = "[✖](bold red) "
[git_commit]
-- prefix = "("
-- suffix = ")"
++ format = "[\\($hash\\)]($style) "
++ format = '[\($hash\)]($style) '
```
#### Git status
@ -184,12 +186,12 @@ error_symbol = "[✖](bold red) "
-- prefix = "["
-- suffix = "]"
-- show_sync_count = false
++ format = "([$all_status$ahead_behind] )"
++ format = '([\[$all_status$ahead_behind\]]($style) )'
```
Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch.
With the release of v0.45.0, this has been replaced with the
With the release of v0.45.0, this has been replaced with three separate properties, `ahead`, `behind`, and `diverged`.
To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file:
@ -230,7 +232,7 @@ behind = "⇣${count}"
[singularity]
-- prefix = ""
-- suffix = ""
++ format = "[$symbol\\[$env\\]]($style) "
++ format = '[$symbol\[$env\]]($style) '
```
#### Hora
@ -245,7 +247,7 @@ behind = "⇣${count}"
[time]
-- format = "🕙[ %T ]"
++ time_format = "%T"
++ format = "at 🕙[$time]($style)
++ format = "at 🕙[$time]($style) "
```
#### Custom Commands

View File

@ -235,8 +235,8 @@ Quand [aws-vault](https://github.com/99designs/aws-vault) est utilisé, la valeu
### Options
| Option | Default | Description |
| ---------------- | ---------------------------------------------------- | -------------------------------------------------------- |
| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | Format du module. |
| ---------------- | ------------------------------------------------ | -------------------------------------------------------- |
| `format` | `'on [$symbol$profile(\($region\))]($style) '` | Format du module. |
| `symbol` | `"☁️ "` | Le symbole affiché avant le profil AWS actuel. |
| `region_aliases` | | Table des alias de région à afficher en plus du nom AWS. |
| `style` | `"bold yellow"` | Le style du module. |
@ -261,7 +261,7 @@ Quand [aws-vault](https://github.com/99designs/aws-vault) est utilisé, la valeu
# ~/.config/starship.toml
[aws]
format = "on [$symbol$profile(\\($region\\))]($style) "
format = 'on [$symbol$profile(\($region\))]($style) '
style = "bold blue"
symbol = "🅰 "
[aws.region_aliases]
@ -346,7 +346,7 @@ style = "bold red"
L'option `display` est une array de la table suivante.
| Variable | Description |
| Option | Description |
| ----------- | -------------------------------------------------- |
| `threshold` | La limite supérieure pour l'option d'affichage. |
| `style` | Le style de l'option display si elle est utilisée. |
@ -575,7 +575,7 @@ The `dart` module shows the currently installed version of Dart. Le module est a
### Options
| Variable | Default | Description |
| Option | Default | Description |
| ---------- | ---------------------------------- | ----------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | Format du module. |
| `symbol` | `"🎯 "` | A format string representing the symbol of Dart |
@ -611,7 +611,7 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
### Options
| Variable | Défaut | Description |
| Option | Défaut | 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. |
@ -620,6 +620,7 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
| `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: "…/" |
<details>
<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
@ -658,6 +659,7 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
[directory]
truncation_length = 8
truncation_symbol = "…/"
```
## Docker Context
@ -756,10 +758,10 @@ The `elixir` module shows the currently installed version of Elixir and Erlang/O
### Options
| Option | Default | Description |
| ---------- | ------------------------------------------------------------- | --------------------------------------------------------------- |
| ---------- | --------------------------------------------------------- | --------------------------------------------------------------- |
| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. |
| `style` | `"bold purple"` | Le style du module. |
| `format` | `"via [$symbol$version \\(OTP $otp_version\\)]($style) "` | The format for the module elixir. |
| `format` | `'via [$symbol$version \(OTP $otp_version\)]($style) '` | The format for the module elixir. |
| `disabled` | `false` | Disables the `elixir` module. |
### Variables
@ -898,9 +900,9 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### Options
| Variable | Default | Description |
| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `"on [$symbol$account(\\($region\\))]($style) "` | Format du module. |
| Option | Default | Description |
| ---------------- | ------------------------------------------------ | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(\($region\))]($style) '` | Format du 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"` | Le style du module. |
@ -927,7 +929,7 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
# ~/.config/starship.toml
[gcloud]
format = "on [$symbol$account(\\($project\\))]($style) "
format = 'on [$symbol$account(\($project\))]($style) '
```
#### Display active config name only
@ -995,9 +997,9 @@ The `git_commit` module shows the current commit hash of the repo in your curren
### Options
| Option | Default | Description |
| -------------------- | ------------------------------ | ----------------------------------------------------- |
| -------------------- | -------------------------- | ----------------------------------------------------- |
| `commit_hash_length` | `7` | The length of the displayed git commit hash. |
| `format` | `"[\\($hash\\)]($style) "` | Format du module. |
| `format` | `'[\($hash\)]($style) '` | Format du module. |
| `style` | `"bold green"` | Le style du module. |
| `only_detached` | `true` | Only show git commit hash when in detached HEAD state |
| `disabled` | `false` | Disables the `git_commit` module. |
@ -1027,7 +1029,7 @@ The `git_state` module will show in directories which are part of a git reposito
### Options
| Option | Défaut | Description |
| -------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| -------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `rebase` | `"REBASING"` | A format string displayed when a `rebase` is in progress. |
| `merge` | `"MERGING"` | A format string displayed when a `merge` is in progress. |
| `revert` | `"REVERTING"` | A format string displayed when a `revert` is in progress. |
@ -1036,7 +1038,7 @@ The `git_state` module will show in directories which are part of a git reposito
| `am` | `"AM"` | A format string displayed when an `apply-mailbox` (`git am`) is in progress. |
| `am_or_rebase` | `"AM/REBASE"` | A format string displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. |
| `style` | `"bold yellow"` | Le style du module. |
| `format` | `"\\([$state( $progress_current/$progress_total)]($style)\\) "` | Format du module. |
| `format` | `'\([$state( $progress_current/$progress_total)]($style)\) '` | Format du module. |
| `disabled` | `false` | Disables the `git_state` module. |
### Variables
@ -1056,7 +1058,7 @@ The `git_state` module will show in directories which are part of a git reposito
# ~/.config/starship.toml
[git_state]
format = "[\\($state( $progress_current of $progress_total)\\)]($style) "
format = '[\($state( $progress_current of $progress_total)\)]($style) '
cherry_pick = "[🍒 PICKING](bold red)"
```
@ -1067,8 +1069,8 @@ The `git_status` module shows symbols representing the state of the repo in your
### Options
| Option | Défaut | Description |
| ------------ | --------------------------------------------- | ----------------------------------- |
| `format` | `"[\[$all_status$ahead_behind\]]($style) "` | The default format for `git_status` |
| ------------ | ----------------------------------------------- | ----------------------------------- |
| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` |
| `conflicted` | `"="` | This branch has merge conflicts. |
| `ahead` | `"⇡"` | The format of `ahead` |
| `behind` | `"⇣"` | The format of `behind` |
@ -1372,11 +1374,10 @@ Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur
### Options
| Option | Défaut | Description |
| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- |
| ----------------- | ---------------------------------------------------- | --------------------------------------------------------------------- |
| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. |
| `format` | `"[$symbol$context( \\($namespace\\))]($style) in "` | Format du module. |
| `format` | `'[$symbol$context( \($namespace\))]($style) in '` | Format du module. |
| `style` | `"cyan bold"` | Le style du module. |
| `namespace_spaceholder` | `none` | The value to display if no namespace was found. |
| `context_aliases` | | Table of context aliases to display. |
| `disabled` | `true` | Disables the `kubernetes` module. |
@ -1397,7 +1398,7 @@ Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur
# ~/.config/starship.toml
[kubernetes]
format = "on [⛵ $context \\($namespace\\)](dimmed green) "
format = 'on [⛵ $context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
@ -1553,8 +1554,8 @@ The `nix_shell` module shows the nix-shell environment. The module will be shown
### Options
| Option | Default | Description |
| ------------ | -------------------------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$state( \\($name\\))]($style) "` | Format du module. |
| ------------ | ---------------------------------------------- | ----------------------------------------------------- |
| `format` | `'via [$symbol$state( \($name\))]($style) '` | Format du module. |
| `symbol` | `"❄️ "` | A format string representing the symbol of nix-shell. |
| `style` | `"bold blue"` | Le style du module. |
| `impure_msg` | `"impure"` | A format string shown when the shell is impure. |
@ -1581,7 +1582,7 @@ The `nix_shell` module shows the nix-shell environment. The module will be shown
disabled = true
impure_msg = "[impure shell](bold red)"
pure_msg = "[pure shell](bold green)"
format = "via [☃️ $state( \\($name\\))](bold blue) "
format = 'via [☃️ $state( \($name\))](bold blue) '
```
## NodeJS
@ -1718,7 +1719,7 @@ The `perl` module shows the currently installed version of Perl. Le module est a
### Options
| Variable | Default | Description |
| Option | Default | Description |
| ---------- | ---------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | The format string for the module. |
| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl |
@ -1799,13 +1800,14 @@ Le module est affiché si l'une des ces conditions est remplie :
### Options
| Option | Défaut | Description |
| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | Format du module. |
| -------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `format` | `'via [${symbol}${pyenv_prefix}${version}( \($virtualenv\))]($style) '` | Format du module. |
| `symbol` | `"🐍 "` | A format string representing the symbol of Python |
| `style` | `"yellow bold"` | Le style du module. |
| `pyenv_version_name` | `false` | Use pyenv to get Python version |
| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. |
| `disabled` | `false` | Disables the `python` module. |
### Variables
@ -1818,23 +1820,6 @@ Le module est affiché si l'une des ces conditions est remplie :
| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` |
| virtualenv | `"venv"` | The current `virtualenv` name |
<details>
<summary>This module has some advanced configuration options.</summary>
| Variable | Défaut | Description |
| --------------- | -------- | ----------------------------------------------------------------------------- |
| `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. |
The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
</details>
### Exemple
@ -1846,6 +1831,17 @@ symbol = "👾 "
pyenv_version_name = true
```
Using the `python3` binary to get the version.
Note - The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
## Ruby
The `ruby` module shows the currently installed version of Ruby. Le module est affiché si l'une des ces conditions est remplie :
@ -1856,7 +1852,7 @@ The `ruby` module shows the currently installed version of Ruby. Le module est a
### Options
| Option | Default | Description |
| Option | Défaut | Description |
| ---------- | ---------------------------------- | ------------------------------------------------ |
| `format` | `"via [$symbol$version]($style) "` | Format du module. |
| `symbol` | `"💎 "` | A format string representing the symbol of Ruby. |
@ -1891,7 +1887,7 @@ The `rust` module shows the currently installed version of Rust. Le module est a
### Options
| Option | Default | Description |
| Option | Défaut | Description |
| ---------- | ---------------------------------- | ----------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | Format du module. |
| `symbol` | `"🦀 "` | A format string representing the symbol of Rust |
@ -1923,7 +1919,7 @@ The `shlvl` module shows the current SHLVL ("shell level") environment variable,
### Options
| Variable | Default | Description |
| Option | Défaut | Description |
| ----------- | ---------------------------- | --------------------------------------- |
| `threshold` | `2` | Display threshold. |
| `format` | `"[$symbol$shlvl]($style) "` | Format du module. |
@ -1958,9 +1954,9 @@ The `singularity` module shows the current singularity image, if inside a contai
### Options
| Option | Default | Description |
| ---------- | ------------------------------------ | ------------------------------------------------ |
| `format` | `"[$symbol\\[$env\\]]($style) "` | Format du module. |
| Option | Défaut | Description |
| ---------- | -------------------------------- | ------------------------------------------------ |
| `format` | `'[$symbol\[$env\]]($style) '` | Format du module. |
| `symbol` | `""` | A format string displayed before the image name. |
| `style` | `"bold dimmed blue"` | Le style du module. |
| `disabled` | `false` | Disables the `singularity` module. |
@ -1981,7 +1977,7 @@ The `singularity` module shows the current singularity image, if inside a contai
# ~/.config/starship.toml
[singularity]
format = "[📦 \\[$env\\]]($style) "
format = '[📦 \[$env\]]($style) '
```
## Swift
@ -1993,7 +1989,7 @@ The `swift` module shows the currently installed version of Swift. Le module est
### Options
| Option | Default | Description |
| Option | Défaut | Description |
| ---------- | ---------------------------------- | ------------------------------------------------ |
| `format` | `"via [$symbol$version]($style) "` | Format du module. |
| `symbol` | `"🐦 "` | A format string representing the symbol of Swift |
@ -2029,7 +2025,7 @@ Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur
### Options
| Variable | Default | Description |
| Option | Défaut | Description |
| ---------- | -------------------------- | ------------------------------------------------------ |
| `format` | `[$symbol$status]($style)` | The format of the module |
| `symbol` | `"✖"` | A format string representing the symbol for the status |
@ -2055,7 +2051,7 @@ Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur
[status]
style = "bg:blue"
symbol = "💣 "
format = "[\\[$symbol$status\\]]($style) "
format = '[\[$symbol$status\]]($style) '
disabled = false
```
@ -2147,7 +2143,7 @@ If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Sinon, il est d
[time]
disabled = false
format = "🕙[\\[ $time \\]]($style) "
format = '🕙[\[ $time \]]($style) '
time_format = "%T"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"

View File

@ -10,16 +10,20 @@
- **Configuration**: [Dotfiles de matchai](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish)
- **Invite de commande**: [Starship](https://starship.rs/)
## Comment puis-je obtenir la complétion de commandes comme montré dans le GIF de démo?
Le support de complétion est fourni par le shell de votre choix. Dans le cas de la démo, elle a été faite avec [Fish Shell](https://fishshell.com/), qui fournit des complétions par défaut. Si vous utilisez le Shell Z (zsh), vous pouvez jeter un œil à [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions).
## Est-ce que l'option globale `format` et `<module>.disabled` font la même chose ?
Oui, ils peuvent tous deux être utilisés pour désactiver les modules dans l'invite de commande. Si tout ce que vous prévoyez de faire est de désactiver les modules, `<module>.disabled` est le meilleur moyen de le faire pour ces raisons :
- Disabling modules is more explicit than omitting them from the top level `format`
- Désactiver les modules est plus explicite que de les omettre du `format global`
- Les modules nouvellement créés seront ajoutés à l'invite de commande au fur et à mesure que Starship sera mis à jour
## La doc dit que Starship est cross-shell, mais il ne supporte pas X shell. Pourquoi ?
## La doc dit que Starship est cross-shell, mais il ne supporte pas le shell X. Pourquoi ?
Étant donné la façon dont Starship est construit, il devrait être possible d'ajouter le support pour pratiquement n'importe quel shell. Le binaire de Starship est sans état et agnostique, donc tant que votre shell supporte la personnalisation rapide et l'expansion du shell, Starship peut être utilisé.
Étant donné la façon dont Starship est construit, il devrait être possible d'ajouter le support pour pratiquement n'importe quel shell. Starship est sans état et agnostique, donc tant que votre shell supporte la personnalisation rapide et l'expansion, Starship peut être utilisé.
Voici un petit exemple pour que Starship fonctionne avec bash :
@ -30,59 +34,59 @@ STATUS=$?
# Récupère le nombre de tâches en cours d'exécution.
NUM_JOBS=$(jobs -p | wc -l)
# Set the prompt to the output of `starship prompt`
# Définit l'invite de commande a `starship prompt`
PS1="$(starship prompt --status=$STATUS --jobs=$NUM_JOBS)"
```
[L'implémentation Bash](https://github.com/starship/starship/blob/master/src/init/starship.bash) intégrée dans Starship est légèrement plus complexe pour permettre des fonctionnalités avancées comme le [module Durée de commande](https://starship.rs/config/#Command-Duration) et pour s'assurer que Starship est compatible avec les configurations Bash préinstallées.
L' [implémentation Bash](https://github.com/starship/starship/blob/master/src/init/starship.bash) intégrée à Starship est légèrement plus complexe pour permettre des fonctionnalités avancées comme le [module de durée de commande](https://starship.rs/config/#Command-Duration) et pour s'assurer que Starship est compatible avec les configurations Bash pré-installées.
Pour une liste de tous les flags acceptés par `starship prompt`, utilisez la commande suivante :
Pour une liste de tous les flags acceptés par `starship`, utilisez la commande suivante :
```sh
starship prompt --help
```
L'invite de commande utilisera toutes les données contextuelles fournies, mais aucun indicateur n'est "requis".
L'invite utilisera autant de contexte que possible, mais aucun paramètre n'est "requis".
## Comment utiliser Starship sur des distributions Linux avec des versions de glibc plus ancienne ?
Si vous obtenez une erreur du type "_version 'GLIBC_2.18' not found (required by starship)_" lors de l'utilisation du binaire précompilé (par exemple sur CentOS 6 ou 7), vous pouvez utiliser un binaire compilé avec `musl` au lieu de `glibc`:
Si vous obtenez une erreur du type "_version 'GLIBC_2.18' not found (required by starship)_" lors de l'utilisation de l'exécutable précompilé (par exemple sur CentOS 6 ou 7), vous pouvez utiliser un exécutable compilé avec `musl` au lieu de `glibc`:
```sh
curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux-musl
```
## Why don't I see a glyph symbol in my prompt?
## Pourquoi ne vois-je pas de glyphe dans mon invite?
The most common cause of this is system misconfiguration. Some Linux distros in particular do not come with font support out-of-the-box. You need to ensure that:
La cause la plus commune est la mauvaise configuration du système. Certaines distributions Linux ne sont pas équipées du support de police 'out of the box'. Vous devez vous assurer que:
- Your locale is set to a UTF-8 value, like `de_DE.UTF-8` or `ja_JP.UTF-8`. If `LC_ALL` is not a UTF-8 value, [you will need to change it](https://www.tecmint.com/set-system-locales-in-linux/).
- You have an emoji font installed. Most systems come with an emoji font by default, but some (notably Arch Linux) do not. You can usually install one through your system's package manager--[noto emoji](https://www.google.com/get/noto/help/emoji/) is a popular choice.
- You are using a [Nerd Font](https://www.nerdfonts.com/).
- Votre locale est définie à une valeur UTF-8, comme `de_DE.UTF-8` ou `ja_JP.UTF-8`. Si `LC_ALL` n'est pas une valeur UTF-8, [vous aurez besoin de la modifier](https://www.tecmint.com/set-system-locales-in-linux/).
- Vous avez une police emoji installée. La plupart des systèmes sont fournis avec une police emoji par défaut, mais certains (notamment Arch Linux) ne le font pas. Vous pouvez habituellement en installer un par le biais du gestionnaire de paquets de votre système -[noto emoji](https://www.google.com/get/noto/help/emoji/) est un choix populaire.
- Vous utilisez une police [Nerd Font](https://www.nerdfonts.com/).
To test your system, run the following commands in a terminal:
Pour tester votre système, exécutez les commandes suivantes dans un terminal :
```sh
echo -e "\xf0\x9f\x90\x8d"
echo -e "\xee\x82\xa0"
```
The first line should produce a [snake emoji](https://emojipedia.org/snake/), while the second should produce a [powerline branch symbol (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs).
La première ligne doit produire un emoji [serpent](https://emojipedia.org/snake/), tandis que la seconde doit produire un symbole [de branche powerline (e0a0)](https://github.com/ryanoasis/powerline-extra-symbols#glyphs).
If either symbol fails to display correctly, your system is still misconfigured. Unfortunately, getting font configuration correct is sometimes difficult. Users on the Discord may be able to help. If both symbols display correctly, but you still don't see them in starship, [file a bug report!](https://github.com/starship/starship/issues/new/choose)
Si l'un ou l'autre des symboles ne parvient pas à s'afficher correctement, votre système est toujours mal configuré. Malheureusement, il est parfois difficile d'obtenir une configuration correcte. Les utilisateurs sur Discord peuvent être en mesure d'aider. Si les deux symboles s'affichent correctement, mais vous ne les voyez toujours pas dans starship, [soumettez un rapport de bogue !](https://github.com/starship/starship/issues/new/choose)
## How do I uninstall Starship?
## Comment désinstaller Starship ?
Starship is just as easy to uninstall as it is to install in the first place.
Starship est tout aussi facile à désinstaller que d'installer.
1. Remove any lines in your shell config (e.g. `~/.bashrc`) used to initialize Starship.
1. Delete the Starship binary.
1. Supprimez les lignes de la configuration de votre shell (par exemple `~/.bashrc`) utilisées pour initialiser Starship.
1. Supprimer l'exécutable de Starship.
If Starship was installed using a package manager, please refer to their docs for uninstallation instructions.
Si Starship a été installé à l'aide d'un gestionnaire de paquets, veuillez vous référer à leur documentation pour les instructions de désinstallation.
If Starship was installed using the `curl | bash` script, the following command will delete the binary:
Si Starship a été installé en utilisant le script `curl | bash` , la commande suivante supprimera l'exécutable :
```sh
# Locate and delete the starship binary
# Localiser et supprimer l'exécutable de Starship
rm "$(which starship)"
```

View File

@ -125,7 +125,7 @@
### Démarrage rapide
1. Installer le binaire **starship** :
1. Installer l'exécutable **starship** :
#### Installer la dernière version

View File

@ -8,7 +8,7 @@ This guide is intended to walk you through the breaking changes.
Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship.
Starship v0.45.0 will instead be accepting a `format` value, allowing for customization of the prompt outside of the modules themselves.
Starship v0.45.0 instead accepts a `format` value, allowing for customization of the prompt outside of the modules themselves.
**Example pre-v0.45.0 configuration**
@ -52,11 +52,11 @@ format = """\
"""
```
## Module `prefix` and `suffix` will be replaced by `format`
## Module `prefix` and `suffix` have been replaced by `format`
Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered.
Starship v0.45.0 will instead be accepting a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
Starship v0.45.0 instead accepts a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
**Example pre-v0.45.0 configuration**
@ -71,7 +71,7 @@ prefix = "took "
[cmd_duration]
# $duration The command duration (e.g. "15s")
# $style The default style of the module (e.g. "bold yellow")
format = "took [$duration]($style)"
format = "took [$duration]($style) "
```
### Affected Modules
@ -93,8 +93,8 @@ format = "took [$duration]($style)"
-- error_symbol = "✖"
-- use_symbol_for_status = true
-- vicmd_symbol = ""
++ success_symbol = "[](bold green) "
++ error_symbol = "[](bold red) "
++ success_symbol = "[](bold green)"
++ error_symbol = "[](bold red)"
++ vicmd_symbol = "[](bold green)"
```
@ -106,9 +106,11 @@ To configure the prompt to use the older `use_symbol_for_status = true` configur
```toml
[character]
error_symbol = "[✖](bold red) "
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.
#### Temps d'exécution
| Removed Property | Replacement |
@ -120,7 +122,7 @@ error_symbol = "[✖](bold red) "
```diff
[cmd_duration]
-- prefix = "took "
++ format = "took [$duration]($style)"
++ format = "took [$duration]($style) "
```
#### Directory
@ -134,7 +136,7 @@ error_symbol = "[✖](bold red) "
```diff
[directory]
-- prefix = "in "
++ format = "[$path]($style)[$read_only]($read_only_style)"
++ format = "[$path]($style)[$read_only]($read_only_style) "
```
#### Environment Variable
@ -166,7 +168,7 @@ error_symbol = "[✖](bold red) "
[git_commit]
-- prefix = "("
-- suffix = ")"
++ format = "[\\($hash\\)]($style) "
++ format = '[\($hash\)]($style) '
```
#### Git Status
@ -184,12 +186,12 @@ error_symbol = "[✖](bold red) "
-- prefix = "["
-- suffix = "]"
-- show_sync_count = false
++ format = "([$all_status$ahead_behind] )"
++ format = '([\[$all_status$ahead_behind\]]($style) )'
```
Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch.
With the release of v0.45.0, this has been replaced with the
With the release of v0.45.0, this has been replaced with three separate properties, `ahead`, `behind`, and `diverged`.
To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file:
@ -230,7 +232,7 @@ behind = "⇣${count}"
[singularity]
-- prefix = ""
-- suffix = ""
++ format = "[$symbol\\[$env\\]]($style) "
++ format = '[$symbol\[$env\]]($style) '
```
#### Temps
@ -245,7 +247,7 @@ behind = "⇣${count}"
[time]
-- format = "🕙[ %T ]"
++ time_format = "%T"
++ format = "at 🕙[$time]($style)
++ format = "at 🕙[$time]($style) "
```
#### Custom Commands

View File

@ -236,8 +236,8 @@ $character"""
### オプション
| オプション | デフォルト | 説明 |
| ---------------- | ---------------------------------------------------- | ----------------------------- |
| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | moduleのフォーマットです。 |
| ---------------- | ------------------------------------------------ | ----------------------------- |
| `format` | `'on [$symbol$profile(\($region\))]($style) '` | moduleのフォーマットです。 |
| `symbol` | `"☁️ "` | 現在のAWSプロファイルを表示する前に表示される記号です。 |
| `region_aliases` | | AWS名に加えて表示するリージョンのエイリアスです。 |
| `style` | `"bold yellow"` | モジュールのスタイルです。 |
@ -262,7 +262,7 @@ $character"""
# ~/.config/starship.toml
[aws]
format = "on [$symbol$profile(\\($region\\))]($style) "
format = 'on [$symbol$profile(\($region\))]($style) '
style = "bold blue"
symbol = "🅰 "
[aws.region_aliases]
@ -347,7 +347,7 @@ style = "bold red"
`display`オプションは、次の表の通りです。
| 変数 | 説明 |
| オプション | 説明 |
| ----------- | ------------------------------ |
| `threshold` | バッテリーが表示される上限です。 |
| `style` | displayオプションが使用されている場合のスタイルです。 |
@ -576,7 +576,7 @@ The `dart` module shows the currently installed version of Dart. 次の条件の
### オプション
| 変数 | デフォルト | 説明 |
| オプション | デフォルト | 説明 |
| ---------- | ---------------------------------- | ----------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | moduleのフォーマットです。 |
| `symbol` | `"🎯 "` | A format string representing the symbol of Dart |
@ -612,7 +612,7 @@ fishスタイルのpwdオプションを使用すると、切り捨てられた
### オプション
| 変数 | デフォルト | 説明 |
| オプション | デフォルト | 説明 |
| ------------------- | -------------------------------------------------- | ----------------------------------------------------- |
| `truncation_length` | `3` | 現在のディレクトリを切り捨てる親フォルダーの数です。 |
| `truncate_to_repo` | `true` | 現在いるgitリポジトリのルートに切り捨てるかどうかです。 |
@ -621,6 +621,7 @@ fishスタイルのpwdオプションを使用すると、切り捨てられた
| `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: "…/" |
<details>
<summary>このモジュールは、どのようにディレクトリを表示するかについての高度なオプションをいくつか持っています。</summary>
@ -659,6 +660,7 @@ fishスタイルのpwdオプションを使用すると、切り捨てられた
[directory]
truncation_length = 8
truncation_symbol = "…/"
```
## Docker Context
@ -757,10 +759,10 @@ The `elixir` module shows the currently installed version of Elixir and Erlang/O
### オプション
| オプション | デフォルト | 説明 |
| ---------- | ------------------------------------------------------------- | --------------------------------------------------------------- |
| ---------- | --------------------------------------------------------- | --------------------------------------------------------------- |
| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. |
| `style` | `"bold purple"` | モジュールのスタイルです。 |
| `format` | `"via [$symbol$version \\(OTP $otp_version\\)]($style) "` | The format for the module elixir. |
| `format` | `'via [$symbol$version \(OTP $otp_version\)]($style) '` | The format for the module elixir. |
| `disabled` | `false` | Disables the `elixir` module. |
### 変数
@ -899,9 +901,9 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### オプション
| 変数 | デフォルト | 説明 |
| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `"on [$symbol$account(\\($region\\))]($style) "` | moduleのフォーマットです。 |
| オプション | デフォルト | 説明 |
| ---------------- | ------------------------------------------------ | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(\($region\))]($style) '` | 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"` | モジュールのスタイルです。 |
@ -928,7 +930,7 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
# ~/.config/starship.toml
[gcloud]
format = "on [$symbol$account(\\($project\\))]($style) "
format = 'on [$symbol$account(\($project\))]($style) '
```
#### Display active config name only
@ -996,9 +998,9 @@ truncation_symbol = ""
### オプション
| オプション | デフォルト | 説明 |
| -------------------- | ------------------------------ | -------------------------------------- |
| -------------------- | -------------------------- | -------------------------------------- |
| `commit_hash_length` | `7` | 表示されるgitコミットハッシュの長さです。 |
| `format` | `"[\\($hash\\)]($style) "` | moduleのフォーマットです。 |
| `format` | `'[\($hash\)]($style) '` | moduleのフォーマットです。 |
| `style` | `"bold green"` | モジュールのスタイルです。 |
| `only_detached` | `true` | 切り離されたHEAD状態のときのみgit commit hashを表示します |
| `disabled` | `false` | `git_commit`モジュールを無効にします。 |
@ -1028,7 +1030,7 @@ truncation_length = 4
### オプション
| オプション | デフォルト | 説明 |
| -------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| -------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `rebase` | `"REBASING"` | A format string displayed when a `rebase` is in progress. |
| `merge` | `"MERGING"` | A format string displayed when a `merge` is in progress. |
| `revert` | `"REVERTING"` | A format string displayed when a `revert` is in progress. |
@ -1037,7 +1039,7 @@ truncation_length = 4
| `am` | `"AM"` | A format string displayed when an `apply-mailbox` (`git am`) is in progress. |
| `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)\\) "` | moduleのフォーマットです。 |
| `format` | `'\([$state( $progress_current/$progress_total)]($style)\) '` | moduleのフォーマットです。 |
| `disabled` | `false` | `git_state`モジュールを無効にします。 |
### 変数
@ -1057,7 +1059,7 @@ truncation_length = 4
# ~/.config/starship.toml
[git_state]
format = "[\\($state( $progress_current of $progress_total)\\)]($style) "
format = '[\($state( $progress_current of $progress_total)\)]($style) '
cherry_pick = "[🍒 PICKING](bold red)"
```
@ -1068,8 +1070,8 @@ cherry_pick = "[🍒 PICKING](bold red)"
### オプション
| オプション | デフォルト | 説明 |
| ------------ | --------------------------------------------- | ------------------------- |
| `format` | `"[\[$all_status$ahead_behind\]]($style) "` | `git_status` のデフォルトフォーマット |
| ------------ | ----------------------------------------------- | ------------------------- |
| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | `git_status` のデフォルトフォーマット |
| `conflicted` | `"="` | このブランチにはマージの競合があります。 |
| `ahead` | `"⇡"` | `ahead`のフォーマット |
| `behind` | `"⇣"` | `behind`のフォーマット |
@ -1373,11 +1375,10 @@ Displays the current Kubernetes context name and, if set, the namespace from the
### オプション
| オプション | デフォルト | 説明 |
| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- |
| ----------------- | ---------------------------------------------------- | --------------------------------------------------------------------- |
| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. |
| `format` | `"[$symbol$context( \\($namespace\\))]($style) in "` | moduleのフォーマットです。 |
| `format` | `'[$symbol$context( \($namespace\))]($style) in '` | moduleのフォーマットです。 |
| `style` | `"cyan bold"` | モジュールのスタイルです。 |
| `namespace_spaceholder` | `none` | The value to display if no namespace was found. |
| `context_aliases` | | Table of context aliases to display. |
| `disabled` | `true` | Disables the `kubernetes` module. |
@ -1398,7 +1399,7 @@ Displays the current Kubernetes context name and, if set, the namespace from the
# ~/.config/starship.toml
[kubernetes]
format = "on [⛵ $context \\($namespace\\)](dimmed green) "
format = 'on [⛵ $context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
@ -1555,8 +1556,8 @@ symbol = "🎣 "
### オプション
| オプション | デフォルト | 説明 |
| ------------ | -------------------------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$state( \\($name\\))]($style) "` | moduleのフォーマットです。 |
| ------------ | ---------------------------------------------- | ----------------------------------------------------- |
| `format` | `'via [$symbol$state( \($name\))]($style) '` | moduleのフォーマットです。 |
| `symbol` | `"❄️ "` | A format string representing the symbol of nix-shell. |
| `style` | `"bold blue"` | モジュールのスタイルです。 |
| `impure_msg` | `"impure"` | A format string shown when the shell is impure. |
@ -1583,7 +1584,7 @@ symbol = "🎣 "
disabled = true
impure_msg = "[impure shell](bold red)"
pure_msg = "[pure shell](bold green)"
format = "via [☃️ $state( \\($name\\))](bold blue) "
format = 'via [☃️ $state( \($name\))](bold blue) '
```
## NodeJS
@ -1720,7 +1721,7 @@ The `perl` module shows the currently installed version of Perl. 次の条件の
### オプション
| 変数 | デフォルト | 説明 |
| オプション | デフォルト | 説明 |
| ---------- | ---------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | The format string for the module. |
| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl |
@ -1801,13 +1802,14 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name
### オプション
| オプション | デフォルト | 説明 |
| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | moduleのフォーマットです。 |
| -------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `format` | `'via [${symbol}${pyenv_prefix}${version}( \($virtualenv\))]($style) '` | moduleのフォーマットです。 |
| `symbol` | `"🐍 "` | A format string representing the symbol of Python |
| `style` | `"yellow bold"` | モジュールのスタイルです。 |
| `pyenv_version_name` | `false` | pyenvを使用してPythonバージョンを取得します |
| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. |
| `disabled` | `false` | `python`モジュールを無効にします。 |
### 変数
@ -1820,23 +1822,6 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name
| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` |
| virtualenv | `"venv"` | The current `virtualenv` name |
<details>
<summary>This module has some advanced configuration options.</summary>
| 変数 | デフォルト | 説明 |
| --------------- | -------- | ----------------------------------------------------------------------------- |
| `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. |
The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
</details>
### 設定例
@ -1848,6 +1833,17 @@ symbol = "👾 "
pyenv_version_name = true
```
Using the `python3` binary to get the version.
Note - The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
## Ruby
`ruby`モジュールは、現在インストールされているRubyのバージョンを示します。 次の条件のいずれかが満たされると、モジュールが表示されます。
@ -1925,7 +1921,7 @@ The `shlvl` module shows the current SHLVL ("shell level") environment variable,
### オプション
| 変数 | デフォルト | 説明 |
| オプション | デフォルト | 説明 |
| ----------- | ---------------------------- | --------------------------------------- |
| `threshold` | `2` | Display threshold. |
| `format` | `"[$symbol$shlvl]($style) "` | moduleのフォーマットです。 |
@ -1961,8 +1957,8 @@ The `singularity` module shows the current singularity image, if inside a contai
### オプション
| オプション | デフォルト | 説明 |
| ---------- | ------------------------------------ | ------------------------------------------------ |
| `format` | `"[$symbol\\[$env\\]]($style) "` | moduleのフォーマットです。 |
| ---------- | -------------------------------- | ------------------------------------------------ |
| `format` | `'[$symbol\[$env\]]($style) '` | moduleのフォーマットです。 |
| `symbol` | `""` | A format string displayed before the image name. |
| `style` | `"bold dimmed blue"` | モジュールのスタイルです。 |
| `disabled` | `false` | Disables the `singularity` module. |
@ -1983,7 +1979,7 @@ The `singularity` module shows the current singularity image, if inside a contai
# ~/.config/starship.toml
[singularity]
format = "[📦 \\[$env\\]]($style) "
format = '[📦 \[$env\]]($style) '
```
## Swift
@ -2031,7 +2027,7 @@ The `status` module displays the exit code of the previous command. The module w
### オプション
| 変数 | デフォルト | 説明 |
| オプション | デフォルト | 説明 |
| ---------- | -------------------------- | ------------------------------------------------------ |
| `format` | `[$symbol$status]($style)` | The format of the module |
| `symbol` | `"✖"` | A format string representing the symbol for the status |
@ -2057,7 +2053,7 @@ The `status` module displays the exit code of the previous command. The module w
[status]
style = "bg:blue"
symbol = "💣 "
format = "[\\[$symbol$status\\]]($style) "
format = '[\[$symbol$status\]]($style) '
disabled = false
```
@ -2149,7 +2145,7 @@ If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. それ以外の
[time]
disabled = false
format = "🕙[\\[ $time \\]]($style) "
format = '🕙[\[ $time \]]($style) '
time_format = "%T"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"

View File

@ -10,6 +10,10 @@
- **設定**: [matchaiのDotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish)
- **プロンプト**: [Starship](https://starship.rs/)
## How do I get command completion as shown in the demo GIF?
Completion support is provided by your shell of choice. In the case of the demo, the demo was done with [Fish Shell](https://fishshell.com/), which provides completions by default. If you use Z Shell (zsh), I'd suggest taking a look at [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions).
## Do top level `format` and `<module>.disabled` do the same thing?
はい、両方ともプロンプトでモジュールを無効にするために使用できます。 モジュールを無効にするだけの場合は、これらの理由から` <module> .disabled `を無効にする方法をお勧めします。

View File

@ -6,9 +6,9 @@ Starship v0.45.0は、v1.0.0の準備として互換性の無い変更を含む
## `prompt_order`をルートレベルの`format`に置換
v0.45.0以前は、`prompt_order` はStarshipによってレンダリングされる順序でモジュール名の配列を指定できるようになっていました。
Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship.
Starship v0.45.0は代わりに `format` を指定できるようになり、モジュール自体の外側でプロンプトをカスタマイズ可能になります。
Starship v0.45.0 instead accepts a `format` value, allowing for customization of the prompt outside of the modules themselves.
**v0.45.0以前の設定例**
@ -52,11 +52,11 @@ format = """\
"""
```
## `prefix``suffix` モジュールを`format`に置換
## Module `prefix` and `suffix` have been replaced by `format`
v0.45.0以前では、モジュールのレンダリング方法をスタイリングするために、 `prefix` や`suffix`の指定可能なモジュールがありました。
Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered.
Starship v0.45.0 は代わりに `format` の値を受け付け、モジュールのレンダリング方法をさらにカスタマイズすることができます。 接頭辞と接尾辞を定義する代わりに、コンテキストベースの変数については、モジュールの出力を表現するフォーマット文字列の中から変数を置き換えることができるようになりました。
Starship v0.45.0 instead accepts a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
**v0.45.0以前の設定例**
@ -71,7 +71,7 @@ prefix = "took "
[cmd_duration]
# $duration コマンド実行時間 (例: "15s")
# $style デフォルトのモジュールスタイル (例: "bold yellow")
format = "took [$duration]($style)"
format = "took [$duration]($style) "
```
### 影響を受けるモジュール
@ -93,8 +93,8 @@ format = "took [$duration]($style)"
-- error_symbol = "✖"
-- use_symbol_for_status = true
-- vicmd_symbol = ""
++ success_symbol = "[](bold green) "
++ error_symbol = "[](bold red) "
++ success_symbol = "[](bold green)"
++ error_symbol = "[](bold red)"
++ vicmd_symbol = "[](bold green)"
```
@ -106,9 +106,11 @@ v0.45.0 のリリースでは、ステータスコードがゼロでないとき
```toml
[character]
error_symbol = "[✖](bold red) "
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.
#### Command Duration
| 削除されたプロパティ | 置換後 |
@ -120,7 +122,7 @@ error_symbol = "[✖](bold red) "
```diff
[cmd_duration]
-- prefix = "took "
++ format = "took [$duration]($style)"
++ format = "took [$duration]($style) "
```
#### Directory
@ -134,7 +136,7 @@ error_symbol = "[✖](bold red) "
```diff
[directory]
-- prefix = "in "
++ format = "[$path]($style)[$read_only]($read_only_style)"
++ format = "[$path]($style)[$read_only]($read_only_style) "
```
#### Environment Variable
@ -166,7 +168,7 @@ error_symbol = "[✖](bold red) "
[git_commit]
-- prefix = "("
-- suffix = ")"
++ format = "[\\($hash\\)]($style) "
++ format = '[\($hash\)]($style) '
```
#### Git Status
@ -184,12 +186,12 @@ error_symbol = "[✖](bold red) "
-- prefix = "["
-- suffix = "]"
-- show_sync_count = false
++ format = "([$all_status$ahead_behind] )"
++ format = '([\[$all_status$ahead_behind\]]($style) )'
```
以前は `show_sync_count` プロパティを使用して、 ブランチが先行またはリモートブランチの後ろにあるコミット数を表示するようにプロンプトを設定していました。
v0.45.0のリリースではこれが変更されます。
With the release of v0.45.0, this has been replaced with three separate properties, `ahead`, `behind`, and `diverged`.
以前の `show_sync_count = true` 設定を使用するようにプロンプトを構成するには、次の設定ファイルを設定します。
@ -230,7 +232,7 @@ behind = "⇣${count}"
[singularity]
-- prefix = ""
-- suffix = ""
++ format = "[$symbol\\[$env\\]]($style) "
++ format = '[$symbol\[$env\]]($style) '
```
#### Time
@ -245,7 +247,7 @@ behind = "⇣${count}"
[time]
-- format = "🕙[ %T ]"
++ time_format = "%T"
++ format = "at 🕙[$time]($style)
++ format = "at 🕙[$time]($style) "
```
#### Custom Commands

View File

@ -235,8 +235,8 @@ When using [aws-vault](https://github.com/99designs/aws-vault) the profile is re
### Opções
| Option | Padrão | Descrição |
| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | The format for the module. |
| ---------------- | ------------------------------------------------ | --------------------------------------------------------------- |
| `format` | `'on [$symbol$profile(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current AWS profile. |
| `region_aliases` | | Table of region aliases to display in addition to the AWS name. |
| `style` | `"bold yellow"` | O estilo do módulo. |
@ -261,7 +261,7 @@ When using [aws-vault](https://github.com/99designs/aws-vault) the profile is re
# ~/.config/starship.toml
[aws]
format = "on [$symbol$profile(\\($region\\))]($style) "
format = 'on [$symbol$profile(\($region\))]($style) '
style = "bold blue"
symbol = "🅰 "
[aws.region_aliases]
@ -346,7 +346,7 @@ style = "bold red"
The `display` option is an array of the following table.
| Variável | Descrição |
| Option | Descrição |
| ----------- | ----------------------------------------------- |
| `threshold` | The upper bound for the display option. |
| `style` | The style used if the display option is in use. |
@ -575,7 +575,7 @@ The `dart` module shows the currently installed version of Dart. The module will
### Opções
| Variável | Padrão | Descrição |
| Option | Padrão | Descrição |
| ---------- | ---------------------------------- | ----------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | The format for the module. |
| `symbol` | `"🎯 "` | A format string representing the symbol of Dart |
@ -611,7 +611,7 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
### Opções
| Variável | Padrão | Descrição |
| Option | Padrão | Descrição |
| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------- |
| `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. |
@ -620,6 +620,7 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
| `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: "…/" |
<details>
<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
@ -658,6 +659,7 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
[directory]
truncation_length = 8
truncation_symbol = "…/"
```
## Docker Context
@ -756,10 +758,10 @@ The `elixir` module shows the currently installed version of Elixir and Erlang/O
### Opções
| Option | Padrão | Descrição |
| ---------- | ------------------------------------------------------------- | --------------------------------------------------------------- |
| ---------- | --------------------------------------------------------- | --------------------------------------------------------------- |
| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. |
| `style` | `"bold purple"` | O estilo do módulo. |
| `format` | `"via [$symbol$version \\(OTP $otp_version\\)]($style) "` | The format for the module elixir. |
| `format` | `'via [$symbol$version \(OTP $otp_version\)]($style) '` | The format for the module elixir. |
| `disabled` | `false` | Disables the `elixir` module. |
### Variables
@ -898,9 +900,9 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### Opções
| Variável | Padrão | Descrição |
| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `"on [$symbol$account(\\($region\\))]($style) "` | The format for the module. |
| Option | Padrão | Descrição |
| ---------------- | ------------------------------------------------ | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(\($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"` | O estilo do módulo. |
@ -927,7 +929,7 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
# ~/.config/starship.toml
[gcloud]
format = "on [$symbol$account(\\($project\\))]($style) "
format = 'on [$symbol$account(\($project\))]($style) '
```
#### Display active config name only
@ -995,9 +997,9 @@ The `git_commit` module shows the current commit hash of the repo in your curren
### Opções
| Option | Padrão | Descrição |
| -------------------- | ------------------------------ | ----------------------------------------------------- |
| -------------------- | -------------------------- | ----------------------------------------------------- |
| `commit_hash_length` | `7` | The length of the displayed git commit hash. |
| `format` | `"[\\($hash\\)]($style) "` | The format for the module. |
| `format` | `'[\($hash\)]($style) '` | The format for the module. |
| `style` | `"bold green"` | O estilo do módulo. |
| `only_detached` | `true` | Only show git commit hash when in detached HEAD state |
| `disabled` | `false` | Disables the `git_commit` module. |
@ -1027,7 +1029,7 @@ The `git_state` module will show in directories which are part of a git reposito
### Opções
| Option | Padrão | Descrição |
| -------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| -------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `rebase` | `"REBASING"` | A format string displayed when a `rebase` is in progress. |
| `merge` | `"MERGING"` | A format string displayed when a `merge` is in progress. |
| `revert` | `"REVERTING"` | A format string displayed when a `revert` is in progress. |
@ -1036,7 +1038,7 @@ The `git_state` module will show in directories which are part of a git reposito
| `am` | `"AM"` | A format string displayed when an `apply-mailbox` (`git am`) is in progress. |
| `am_or_rebase` | `"AM/REBASE"` | A format string displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. |
| `style` | `"bold yellow"` | O estilo do módulo. |
| `format` | `"\\([$state( $progress_current/$progress_total)]($style)\\) "` | The format for the module. |
| `format` | `'\([$state( $progress_current/$progress_total)]($style)\) '` | The format for the module. |
| `disabled` | `false` | Disables the `git_state` module. |
### Variables
@ -1056,7 +1058,7 @@ The `git_state` module will show in directories which are part of a git reposito
# ~/.config/starship.toml
[git_state]
format = "[\\($state( $progress_current of $progress_total)\\)]($style) "
format = '[\($state( $progress_current of $progress_total)\)]($style) '
cherry_pick = "[🍒 PICKING](bold red)"
```
@ -1067,8 +1069,8 @@ The `git_status` module shows symbols representing the state of the repo in your
### Opções
| Option | Padrão | Descrição |
| ------------ | --------------------------------------------- | ----------------------------------- |
| `format` | `"[\[$all_status$ahead_behind\]]($style) "` | The default format for `git_status` |
| ------------ | ----------------------------------------------- | ----------------------------------- |
| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` |
| `conflicted` | `"="` | This branch has merge conflicts. |
| `ahead` | `"⇡"` | The format of `ahead` |
| `behind` | `"⇣"` | The format of `behind` |
@ -1372,11 +1374,10 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
### Opções
| Option | Padrão | Descrição |
| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- |
| ----------------- | ---------------------------------------------------- | --------------------------------------------------------------------- |
| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. |
| `format` | `"[$symbol$context( \\($namespace\\))]($style) in "` | The format for the module. |
| `format` | `'[$symbol$context( \($namespace\))]($style) in '` | The format for the module. |
| `style` | `"cyan bold"` | O estilo do módulo. |
| `namespace_spaceholder` | `none` | The value to display if no namespace was found. |
| `context_aliases` | | Table of context aliases to display. |
| `disabled` | `true` | Disables the `kubernetes` module. |
@ -1397,7 +1398,7 @@ 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 [⛵ $context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
@ -1553,8 +1554,8 @@ The `nix_shell` module shows the nix-shell environment. The module will be shown
### Opções
| Option | Padrão | Descrição |
| ------------ | -------------------------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$state( \\($name\\))]($style) "` | The format for the module. |
| ------------ | ---------------------------------------------- | ----------------------------------------------------- |
| `format` | `'via [$symbol$state( \($name\))]($style) '` | The format for the module. |
| `symbol` | `"❄️ "` | A format string representing the symbol of nix-shell. |
| `style` | `"bold blue"` | O estilo do módulo. |
| `impure_msg` | `"impure"` | A format string shown when the shell is impure. |
@ -1581,7 +1582,7 @@ The `nix_shell` module shows the nix-shell environment. The module will be shown
disabled = true
impure_msg = "[impure shell](bold red)"
pure_msg = "[pure shell](bold green)"
format = "via [☃️ $state( \\($name\\))](bold blue) "
format = 'via [☃️ $state( \($name\))](bold blue) '
```
## NodeJS
@ -1718,7 +1719,7 @@ The `perl` module shows the currently installed version of Perl. The module will
### Opções
| Variável | Padrão | Descrição |
| Option | Padrão | Descrição |
| ---------- | ---------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | The format string for the module. |
| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl |
@ -1799,13 +1800,14 @@ The module will be shown if any of the following conditions are met:
### Opções
| Option | Padrão | Descrição |
| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | The format for the module. |
| -------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `format` | `'via [${symbol}${pyenv_prefix}${version}( \($virtualenv\))]($style) '` | The format for the module. |
| `symbol` | `"🐍 "` | A format string representing the symbol of Python |
| `style` | `"yellow bold"` | O estilo do módulo. |
| `pyenv_version_name` | `false` | Use pyenv to get Python version |
| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. |
| `disabled` | `false` | Disables the `python` module. |
### Variables
@ -1818,23 +1820,6 @@ The module will be shown if any of the following conditions are met:
| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` |
| virtualenv | `"venv"` | The current `virtualenv` name |
<details>
<summary>This module has some advanced configuration options.</summary>
| Variável | Padrão | Descrição |
| --------------- | -------- | ----------------------------------------------------------------------------- |
| `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. |
The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
</details>
### Exemplo
@ -1846,6 +1831,17 @@ symbol = "👾 "
pyenv_version_name = true
```
Using the `python3` binary to get the version.
Note - The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
## Ruby
The `ruby` module shows the currently installed version of Ruby. The module will be shown if any of the following conditions are met:
@ -1923,7 +1919,7 @@ The `shlvl` module shows the current SHLVL ("shell level") environment variable,
### Opções
| Variável | Padrão | Descrição |
| Option | Padrão | Descrição |
| ----------- | ---------------------------- | --------------------------------------- |
| `threshold` | `2` | Display threshold. |
| `format` | `"[$symbol$shlvl]($style) "` | The format for the module. |
@ -1959,8 +1955,8 @@ The `singularity` module shows the current singularity image, if inside a contai
### Opções
| Option | Padrão | Descrição |
| ---------- | ------------------------------------ | ------------------------------------------------ |
| `format` | `"[$symbol\\[$env\\]]($style) "` | The format for the module. |
| ---------- | -------------------------------- | ------------------------------------------------ |
| `format` | `'[$symbol\[$env\]]($style) '` | The format for the module. |
| `symbol` | `""` | A format string displayed before the image name. |
| `style` | `"bold dimmed blue"` | O estilo do módulo. |
| `disabled` | `false` | Disables the `singularity` module. |
@ -1981,7 +1977,7 @@ The `singularity` module shows the current singularity image, if inside a contai
# ~/.config/starship.toml
[singularity]
format = "[📦 \\[$env\\]]($style) "
format = '[📦 \[$env\]]($style) '
```
## Swift
@ -2029,7 +2025,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
### Opções
| Variável | Padrão | Descrição |
| Option | Padrão | Descrição |
| ---------- | -------------------------- | ------------------------------------------------------ |
| `format` | `[$symbol$status]($style)` | The format of the module |
| `symbol` | `"✖"` | A format string representing the symbol for the status |
@ -2055,7 +2051,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
[status]
style = "bg:blue"
symbol = "💣 "
format = "[\\[$symbol$status\\]]($style) "
format = '[\[$symbol$status\]]($style) '
disabled = false
```
@ -2147,7 +2143,7 @@ If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it de
[time]
disabled = false
format = "🕙[\\[ $time \\]]($style) "
format = '🕙[\[ $time \]]($style) '
time_format = "%T"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"

View File

@ -10,6 +10,10 @@
- **Configuration**: [matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish)
- **Prompt**: [Starship](https://starship.rs/)
## How do I get command completion as shown in the demo GIF?
Completion support is provided by your shell of choice. In the case of the demo, the demo was done with [Fish Shell](https://fishshell.com/), which provides completions by default. If you use Z Shell (zsh), I'd suggest taking a look at [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions).
## Do top level `format` and `<module>.disabled` do the same thing?
Yes, they can both be used to disable modules in the prompt. If all you plan to do is disable modules, `<module>.disabled` is the preferred way to do so for these reasons:

View File

@ -8,7 +8,7 @@ This guide is intended to walk you through the breaking changes.
Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship.
Starship v0.45.0 will instead be accepting a `format` value, allowing for customization of the prompt outside of the modules themselves.
Starship v0.45.0 instead accepts a `format` value, allowing for customization of the prompt outside of the modules themselves.
**Example pre-v0.45.0 configuration**
@ -52,11 +52,11 @@ format = """\
"""
```
## Module `prefix` and `suffix` will be replaced by `format`
## Module `prefix` and `suffix` have been replaced by `format`
Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered.
Starship v0.45.0 will instead be accepting a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
Starship v0.45.0 instead accepts a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
**Example pre-v0.45.0 configuration**
@ -71,7 +71,7 @@ prefix = "took "
[cmd_duration]
# $duration The command duration (e.g. "15s")
# $style The default style of the module (e.g. "bold yellow")
format = "took [$duration]($style)"
format = "took [$duration]($style) "
```
### Affected Modules
@ -93,8 +93,8 @@ format = "took [$duration]($style)"
-- error_symbol = "✖"
-- use_symbol_for_status = true
-- vicmd_symbol = ""
++ success_symbol = "[](bold green) "
++ error_symbol = "[](bold red) "
++ success_symbol = "[](bold green)"
++ error_symbol = "[](bold red)"
++ vicmd_symbol = "[](bold green)"
```
@ -106,9 +106,11 @@ To configure the prompt to use the older `use_symbol_for_status = true` configur
```toml
[character]
error_symbol = "[✖](bold red) "
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.
#### Tempo de execução do comando
| Removed Property | Replacement |
@ -120,7 +122,7 @@ error_symbol = "[✖](bold red) "
```diff
[cmd_duration]
-- prefix = "took "
++ format = "took [$duration]($style)"
++ format = "took [$duration]($style) "
```
#### Diretório
@ -134,7 +136,7 @@ error_symbol = "[✖](bold red) "
```diff
[directory]
-- prefix = "in "
++ format = "[$path]($style)[$read_only]($read_only_style)"
++ format = "[$path]($style)[$read_only]($read_only_style) "
```
#### Environment Variable
@ -166,7 +168,7 @@ error_symbol = "[✖](bold red) "
[git_commit]
-- prefix = "("
-- suffix = ")"
++ format = "[\\($hash\\)]($style) "
++ format = '[\($hash\)]($style) '
```
#### Git Status
@ -184,12 +186,12 @@ error_symbol = "[✖](bold red) "
-- prefix = "["
-- suffix = "]"
-- show_sync_count = false
++ format = "([$all_status$ahead_behind] )"
++ format = '([\[$all_status$ahead_behind\]]($style) )'
```
Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch.
With the release of v0.45.0, this has been replaced with the
With the release of v0.45.0, this has been replaced with three separate properties, `ahead`, `behind`, and `diverged`.
To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file:
@ -230,7 +232,7 @@ behind = "⇣${count}"
[singularity]
-- prefix = ""
-- suffix = ""
++ format = "[$symbol\\[$env\\]]($style) "
++ format = '[$symbol\[$env\]]($style) '
```
#### Time
@ -245,7 +247,7 @@ behind = "⇣${count}"
[time]
-- format = "🕙[ %T ]"
++ time_format = "%T"
++ format = "at 🕙[$time]($style)
++ format = "at 🕙[$time]($style) "
```
#### Custom Commands

View File

@ -235,8 +235,8 @@ When using [aws-vault](https://github.com/99designs/aws-vault) the profile is re
### Options
| Option | Default | Description |
| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | The format for the module. |
| ---------------- | ------------------------------------------------ | --------------------------------------------------------------- |
| `format` | `'on [$symbol$profile(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | The symbol used before displaying the current AWS profile. |
| `region_aliases` | | Table of region aliases to display in addition to the AWS name. |
| `style` | `"bold yellow"` | The style for the module. |
@ -261,7 +261,7 @@ When using [aws-vault](https://github.com/99designs/aws-vault) the profile is re
# ~/.config/starship.toml
[aws]
format = "on [$symbol$profile(\\($region\\))]($style) "
format = 'on [$symbol$profile(\($region\))]($style) '
style = "bold blue"
symbol = "🅰 "
[aws.region_aliases]
@ -346,7 +346,7 @@ style = "bold red"
The `display` option is an array of the following table.
| Variable | Description |
| Option | Description |
| ----------- | ----------------------------------------------- |
| `threshold` | The upper bound for the display option. |
| `style` | The style used if the display option is in use. |
@ -575,7 +575,7 @@ The `dart` module shows the currently installed version of Dart. The module will
### Options
| Variable | Default | Description |
| Option | Default | Description |
| ---------- | ---------------------------------- | ----------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | The format for the module. |
| `symbol` | `"🎯 "` | A format string representing the symbol of Dart |
@ -611,7 +611,7 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
### Options
| Variable | Default | Description |
| 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. |
@ -620,6 +620,7 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
| `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: "…/" |
<details>
<summary>This module has a few advanced configuration options that control how the directory is displayed.</summary>
@ -658,6 +659,7 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
[directory]
truncation_length = 8
truncation_symbol = "…/"
```
## Docker Context
@ -756,10 +758,10 @@ The `elixir` module shows the currently installed version of Elixir and Erlang/O
### Options
| Option | Default | Description |
| ---------- | ------------------------------------------------------------- | --------------------------------------------------------------- |
| ---------- | --------------------------------------------------------- | --------------------------------------------------------------- |
| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. |
| `style` | `"bold purple"` | The style for the module. |
| `format` | `"via [$symbol$version \\(OTP $otp_version\\)]($style) "` | The format for the module elixir. |
| `format` | `'via [$symbol$version \(OTP $otp_version\)]($style) '` | The format for the module elixir. |
| `disabled` | `false` | Disables the `elixir` module. |
### Variables
@ -898,9 +900,9 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### Options
| Variable | Default | Description |
| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `"on [$symbol$account(\\($region\\))]($style) "` | The format for the module. |
| Option | Default | Description |
| ---------------- | ------------------------------------------------ | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(\($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. |
@ -927,7 +929,7 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
# ~/.config/starship.toml
[gcloud]
format = "on [$symbol$account(\\($project\\))]($style) "
format = 'on [$symbol$account(\($project\))]($style) '
```
#### Display active config name only
@ -995,9 +997,9 @@ The `git_commit` module shows the current commit hash of the repo in your curren
### Options
| Option | Default | Description |
| -------------------- | ------------------------------ | ----------------------------------------------------- |
| -------------------- | -------------------------- | ----------------------------------------------------- |
| `commit_hash_length` | `7` | The length of the displayed git commit hash. |
| `format` | `"[\\($hash\\)]($style) "` | The format for the module. |
| `format` | `'[\($hash\)]($style) '` | The format for the module. |
| `style` | `"bold green"` | The style for the module. |
| `only_detached` | `true` | Only show git commit hash when in detached HEAD state |
| `disabled` | `false` | Disables the `git_commit` module. |
@ -1027,7 +1029,7 @@ The `git_state` module will show in directories which are part of a git reposito
### Options
| Option | Default | Description |
| -------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| -------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `rebase` | `"REBASING"` | A format string displayed when a `rebase` is in progress. |
| `merge` | `"MERGING"` | A format string displayed when a `merge` is in progress. |
| `revert` | `"REVERTING"` | A format string displayed when a `revert` is in progress. |
@ -1036,7 +1038,7 @@ The `git_state` module will show in directories which are part of a git reposito
| `am` | `"AM"` | A format string displayed when an `apply-mailbox` (`git am`) is in progress. |
| `am_or_rebase` | `"AM/REBASE"` | A format string displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. |
| `style` | `"bold yellow"` | The style for the module. |
| `format` | `"\\([$state( $progress_current/$progress_total)]($style)\\) "` | The format for the module. |
| `format` | `'\([$state( $progress_current/$progress_total)]($style)\) '` | The format for the module. |
| `disabled` | `false` | Disables the `git_state` module. |
### Variables
@ -1056,7 +1058,7 @@ The `git_state` module will show in directories which are part of a git reposito
# ~/.config/starship.toml
[git_state]
format = "[\\($state( $progress_current of $progress_total)\\)]($style) "
format = '[\($state( $progress_current of $progress_total)\)]($style) '
cherry_pick = "[🍒 PICKING](bold red)"
```
@ -1067,8 +1069,8 @@ The `git_status` module shows symbols representing the state of the repo in your
### Options
| Option | Default | Description |
| ------------ | --------------------------------------------- | ----------------------------------- |
| `format` | `"[\[$all_status$ahead_behind\]]($style) "` | The default format for `git_status` |
| ------------ | ----------------------------------------------- | ----------------------------------- |
| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` |
| `conflicted` | `"="` | This branch has merge conflicts. |
| `ahead` | `"⇡"` | The format of `ahead` |
| `behind` | `"⇣"` | The format of `behind` |
@ -1372,11 +1374,10 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
### Options
| Option | Default | Description |
| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- |
| ----------------- | ---------------------------------------------------- | --------------------------------------------------------------------- |
| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. |
| `format` | `"[$symbol$context( \\($namespace\\))]($style) in "` | The format for the module. |
| `format` | `'[$symbol$context( \($namespace\))]($style) in '` | The format for the module. |
| `style` | `"cyan bold"` | The style for the module. |
| `namespace_spaceholder` | `none` | The value to display if no namespace was found. |
| `context_aliases` | | Table of context aliases to display. |
| `disabled` | `true` | Disables the `kubernetes` module. |
@ -1397,7 +1398,7 @@ 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 [⛵ $context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
@ -1553,8 +1554,8 @@ The `nix_shell` module shows the nix-shell environment. The module will be shown
### Options
| Option | Default | Description |
| ------------ | -------------------------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$state( \\($name\\))]($style) "` | The format for the module. |
| ------------ | ---------------------------------------------- | ----------------------------------------------------- |
| `format` | `'via [$symbol$state( \($name\))]($style) '` | The format for the module. |
| `symbol` | `"❄️ "` | A format string representing the symbol of nix-shell. |
| `style` | `"bold blue"` | The style for the module. |
| `impure_msg` | `"impure"` | A format string shown when the shell is impure. |
@ -1581,7 +1582,7 @@ The `nix_shell` module shows the nix-shell environment. The module will be shown
disabled = true
impure_msg = "[impure shell](bold red)"
pure_msg = "[pure shell](bold green)"
format = "via [☃️ $state( \\($name\\))](bold blue) "
format = 'via [☃️ $state( \($name\))](bold blue) '
```
## NodeJS
@ -1718,7 +1719,7 @@ The `perl` module shows the currently installed version of Perl. The module will
### Options
| Variable | Default | Description |
| Option | Default | Description |
| ---------- | ---------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | The format string for the module. |
| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl |
@ -1799,13 +1800,14 @@ The module will be shown if any of the following conditions are met:
### Options
| Option | Default | Description |
| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | The format for the module. |
| -------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `format` | `'via [${symbol}${pyenv_prefix}${version}( \($virtualenv\))]($style) '` | The format for the module. |
| `symbol` | `"🐍 "` | A format string representing the symbol of Python |
| `style` | `"yellow bold"` | The style for the module. |
| `pyenv_version_name` | `false` | Use pyenv to get Python version |
| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. |
| `disabled` | `false` | Disables the `python` module. |
### Variables
@ -1818,23 +1820,6 @@ The module will be shown if any of the following conditions are met:
| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` |
| virtualenv | `"venv"` | The current `virtualenv` name |
<details>
<summary>This module has some advanced configuration options.</summary>
| Variable | Default | Description |
| --------------- | -------- | ----------------------------------------------------------------------------- |
| `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. |
The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
</details>
### Example
@ -1846,6 +1831,17 @@ symbol = "👾 "
pyenv_version_name = true
```
Using the `python3` binary to get the version.
Note - The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
## Ruby
The `ruby` module shows the currently installed version of Ruby. The module will be shown if any of the following conditions are met:
@ -1923,7 +1919,7 @@ The `shlvl` module shows the current SHLVL ("shell level") environment variable,
### Options
| Variable | Default | Description |
| Option | Default | Description |
| ----------- | ---------------------------- | --------------------------------------- |
| `threshold` | `2` | Display threshold. |
| `format` | `"[$symbol$shlvl]($style) "` | The format for the module. |
@ -1959,8 +1955,8 @@ The `singularity` module shows the current singularity image, if inside a contai
### Options
| Option | Default | Description |
| ---------- | ------------------------------------ | ------------------------------------------------ |
| `format` | `"[$symbol\\[$env\\]]($style) "` | The format for the module. |
| ---------- | -------------------------------- | ------------------------------------------------ |
| `format` | `'[$symbol\[$env\]]($style) '` | The format for the module. |
| `symbol` | `""` | A format string displayed before the image name. |
| `style` | `"bold dimmed blue"` | The style for the module. |
| `disabled` | `false` | Disables the `singularity` module. |
@ -1981,7 +1977,7 @@ The `singularity` module shows the current singularity image, if inside a contai
# ~/.config/starship.toml
[singularity]
format = "[📦 \\[$env\\]]($style) "
format = '[📦 \[$env\]]($style) '
```
## Swift
@ -2029,7 +2025,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
### Options
| Variable | Default | Description |
| Option | Default | Description |
| ---------- | -------------------------- | ------------------------------------------------------ |
| `format` | `[$symbol$status]($style)` | The format of the module |
| `symbol` | `"✖"` | A format string representing the symbol for the status |
@ -2055,7 +2051,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y
[status]
style = "bg:blue"
symbol = "💣 "
format = "[\\[$symbol$status\\]]($style) "
format = '[\[$symbol$status\]]($style) '
disabled = false
```
@ -2147,7 +2143,7 @@ If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it de
[time]
disabled = false
format = "🕙[\\[ $time \\]]($style) "
format = '🕙[\[ $time \]]($style) '
time_format = "%T"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"

View File

@ -10,6 +10,10 @@
- **Configuration**: [matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish)
- **Prompt**: [Starship](https://starship.rs/)
## How do I get command completion as shown in the demo GIF?
Completion support is provided by your shell of choice. In the case of the demo, the demo was done with [Fish Shell](https://fishshell.com/), which provides completions by default. If you use Z Shell (zsh), I'd suggest taking a look at [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions).
## Do top level `format` and `<module>.disabled` do the same thing?
Yes, they can both be used to disable modules in the prompt. If all you plan to do is disable modules, `<module>.disabled` is the preferred way to do so for these reasons:

View File

@ -8,7 +8,7 @@ This guide is intended to walk you through the breaking changes.
Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship.
Starship v0.45.0 will instead be accepting a `format` value, allowing for customization of the prompt outside of the modules themselves.
Starship v0.45.0 instead accepts a `format` value, allowing for customization of the prompt outside of the modules themselves.
**Example pre-v0.45.0 configuration**
@ -52,11 +52,11 @@ format = """\
"""
```
## Module `prefix` and `suffix` will be replaced by `format`
## Module `prefix` and `suffix` have been replaced by `format`
Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered.
Starship v0.45.0 will instead be accepting a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
Starship v0.45.0 instead accepts a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
**Example pre-v0.45.0 configuration**
@ -71,7 +71,7 @@ prefix = "took "
[cmd_duration]
# $duration The command duration (e.g. "15s")
# $style The default style of the module (e.g. "bold yellow")
format = "took [$duration]($style)"
format = "took [$duration]($style) "
```
### Affected Modules
@ -93,8 +93,8 @@ format = "took [$duration]($style)"
-- error_symbol = "✖"
-- use_symbol_for_status = true
-- vicmd_symbol = ""
++ success_symbol = "[](bold green) "
++ error_symbol = "[](bold red) "
++ success_symbol = "[](bold green)"
++ error_symbol = "[](bold red)"
++ vicmd_symbol = "[](bold green)"
```
@ -106,9 +106,11 @@ To configure the prompt to use the older `use_symbol_for_status = true` configur
```toml
[character]
error_symbol = "[✖](bold red) "
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.
#### Command Duration
| Removed Property | Replacement |
@ -120,7 +122,7 @@ error_symbol = "[✖](bold red) "
```diff
[cmd_duration]
-- prefix = "took "
++ format = "took [$duration]($style)"
++ format = "took [$duration]($style) "
```
#### Directory
@ -134,7 +136,7 @@ error_symbol = "[✖](bold red) "
```diff
[directory]
-- prefix = "in "
++ format = "[$path]($style)[$read_only]($read_only_style)"
++ format = "[$path]($style)[$read_only]($read_only_style) "
```
#### Environment Variable
@ -166,7 +168,7 @@ error_symbol = "[✖](bold red) "
[git_commit]
-- prefix = "("
-- suffix = ")"
++ format = "[\\($hash\\)]($style) "
++ format = '[\($hash\)]($style) '
```
#### Git Status
@ -184,12 +186,12 @@ error_symbol = "[✖](bold red) "
-- prefix = "["
-- suffix = "]"
-- show_sync_count = false
++ format = "([$all_status$ahead_behind] )"
++ format = '([\[$all_status$ahead_behind\]]($style) )'
```
Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch.
With the release of v0.45.0, this has been replaced with the
With the release of v0.45.0, this has been replaced with three separate properties, `ahead`, `behind`, and `diverged`.
To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file:
@ -230,7 +232,7 @@ behind = "⇣${count}"
[singularity]
-- prefix = ""
-- suffix = ""
++ format = "[$symbol\\[$env\\]]($style) "
++ format = '[$symbol\[$env\]]($style) '
```
#### Time
@ -245,7 +247,7 @@ behind = "⇣${count}"
[time]
-- format = "🕙[ %T ]"
++ time_format = "%T"
++ format = "at 🕙[$time]($style)
++ format = "at 🕙[$time]($style) "
```
#### Custom Commands

View File

@ -235,8 +235,8 @@ $character"""
### Опции
| Option | По умолчанию | Описание |
| ---------------- | ---------------------------------------------------- | -------------------------------------------------------------- |
| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | The format for the module. |
| ---------------- | ------------------------------------------------ | -------------------------------------------------------------- |
| `format` | `'on [$symbol$profile(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | Символ перед отображением текущего профиля AWS. |
| `region_aliases` | | Таблица региона псевдонимов, отображаемая вместе с именем AWS. |
| `style` | `"bold yellow"` | Стиль модуля. |
@ -261,7 +261,7 @@ $character"""
# ~/.config/starship.toml
[aws]
format = "on [$symbol$profile(\\($region\\))]($style) "
format = 'on [$symbol$profile(\($region\))]($style) '
style = "bold blue"
symbol = "🅰 "
[aws.region_aliases]
@ -346,7 +346,7 @@ style = "bold red"
Опция `display` представляет собой массив следующей таблицы.
| Переменная | Описание |
| Option | Описание |
| ----------- | -------------------------------------------------------- |
| `threshold` | Верхняя граница опции отображения. |
| `style` | Используемый стиль, если используется опция отображения. |
@ -575,7 +575,7 @@ The `dart` module shows the currently installed version of Dart. Модуль б
### Опции
| Переменная | По умолчанию | Описание |
| Option | По умолчанию | Описание |
| ---------- | ---------------------------------- | ----------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | The format for the module. |
| `symbol` | `"🎯 "` | A format string representing the symbol of Dart |
@ -611,7 +611,7 @@ format = "via [🔰 $version](bold red) "
### Опции
| Переменная | По умолчанию | Описание |
| Option | По умолчанию | Описание |
| ------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------- |
| `truncation_length` | `3` | Количество родительских папок, к которым должен быть усечен текущий каталог. |
| `truncate_to_repo` | `true` | Следует или нет обрезать до корня репозитория git, в котором вы находитесь. |
@ -620,6 +620,7 @@ format = "via [🔰 $version](bold red) "
| `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: "…/" |
<details>
<summary>Этот модуль имеет несколько расширенных опций конфигурации, которые контролируют отображение каталога.</summary>
@ -658,6 +659,7 @@ format = "via [🔰 $version](bold red) "
[directory]
truncation_length = 8
truncation_symbol = "…/"
```
## Контекст Docker
@ -756,10 +758,10 @@ heuristic = false
### Опции
| Option | По умолчанию | Описание |
| ---------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
| ---------- | --------------------------------------------------------- | ------------------------------------------------------------- |
| `symbol` | `"💧 "` | Символ, используемый перед отображением версии Elixir/Erlang. |
| `style` | `"bold purple"` | Стиль модуля. |
| `format` | `"via [$symbol$version \\(OTP $otp_version\\)]($style) "` | The format for the module elixir. |
| `format` | `'via [$symbol$version \(OTP $otp_version\)]($style) '` | The format for the module elixir. |
| `disabled` | `false` | Отключает модуль `elixir`. |
### Variables
@ -898,9 +900,9 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### Опции
| Переменная | По умолчанию | Описание |
| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `"on [$symbol$account(\\($region\\))]($style) "` | The format for the module. |
| Option | По умолчанию | Описание |
| ---------------- | ------------------------------------------------ | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(\($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"` | Стиль модуля. |
@ -927,7 +929,7 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
# ~/.config/starship.toml
[gcloud]
format = "on [$symbol$account(\\($project\\))]($style) "
format = 'on [$symbol$account(\($project\))]($style) '
```
#### Display active config name only
@ -995,9 +997,9 @@ truncation_symbol = ""
### Опции
| Option | По умолчанию | Описание |
| -------------------- | ------------------------------ | ----------------------------------------------------------------------- |
| -------------------- | -------------------------- | ----------------------------------------------------------------------- |
| `commit_hash_length` | `7` | Длина отображаемого хэша коммита git. |
| `format` | `"[\\($hash\\)]($style) "` | The format for the module. |
| `format` | `'[\($hash\)]($style) '` | The format for the module. |
| `style` | `"bold green"` | Стиль модуля. |
| `only_detached` | `true` | Показывать хэш коммита git, только находясь в состоянии отделённой HEAD |
| `disabled` | `false` | Отключает модуль `git_commit`. |
@ -1027,7 +1029,7 @@ commit_hash_length = 4
### Опции
| Option | По умолчанию | Описание |
| -------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| -------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `rebase` | `"REBASING"` | A format string displayed when a `rebase` is in progress. |
| `merge` | `"MERGING"` | A format string displayed when a `merge` is in progress. |
| `revert` | `"REVERTING"` | A format string displayed when a `revert` is in progress. |
@ -1036,7 +1038,7 @@ commit_hash_length = 4
| `am` | `"AM"` | A format string displayed when an `apply-mailbox` (`git am`) is in progress. |
| `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. |
| `format` | `'\([$state( $progress_current/$progress_total)]($style)\) '` | The format for the module. |
| `disabled` | `false` | Отключает модуль `git_state`. |
### Variables
@ -1056,7 +1058,7 @@ commit_hash_length = 4
# ~/.config/starship.toml
[git_state]
format = "[\\($state( $progress_current of $progress_total)\\)]($style) "
format = '[\($state( $progress_current of $progress_total)\)]($style) '
cherry_pick = "[🍒 PICKING](bold red)"
```
@ -1067,8 +1069,8 @@ cherry_pick = "[🍒 PICKING](bold red)"
### Опции
| Option | По умолчанию | Описание |
| ------------ | --------------------------------------------- | ----------------------------------- |
| `format` | `"[\[$all_status$ahead_behind\]]($style) "` | The default format for `git_status` |
| ------------ | ----------------------------------------------- | ----------------------------------- |
| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` |
| `conflicted` | `"="` | Эта ветка имеет конфликты слияния. |
| `ahead` | `"⇡"` | The format of `ahead` |
| `behind` | `"⇣"` | The format of `behind` |
@ -1372,11 +1374,10 @@ Displays the current Kubernetes context name and, if set, the namespace from the
### Опции
| Option | По умолчанию | Описание |
| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- |
| ----------------- | ---------------------------------------------------- | --------------------------------------------------------------------- |
| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. |
| `format` | `"[$symbol$context( \\($namespace\\))]($style) in "` | The format for the module. |
| `format` | `'[$symbol$context( \($namespace\))]($style) in '` | The format for the module. |
| `style` | `"cyan bold"` | Стиль модуля. |
| `namespace_spaceholder` | `none` | The value to display if no namespace was found. |
| `context_aliases` | | Table of context aliases to display. |
| `disabled` | `true` | Отключает модуль `kubernetes`. |
@ -1397,7 +1398,7 @@ Displays the current Kubernetes context name and, if set, the namespace from the
# ~/.config/starship.toml
[kubernetes]
format = "on [⛵ $context \\($namespace\\)](dimmed green) "
format = 'on [⛵ $context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
@ -1553,8 +1554,8 @@ symbol = "🎣 "
### Опции
| Option | По умолчанию | Описание |
| ------------ | -------------------------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$state( \\($name\\))]($style) "` | The format for the module. |
| ------------ | ---------------------------------------------- | ----------------------------------------------------- |
| `format` | `'via [$symbol$state( \($name\))]($style) '` | The format for the module. |
| `symbol` | `"❄️ "` | A format string representing the symbol of nix-shell. |
| `style` | `"bold blue"` | Стиль модуля. |
| `impure_msg` | `"impure"` | A format string shown when the shell is impure. |
@ -1581,7 +1582,7 @@ symbol = "🎣 "
disabled = true
impure_msg = "[impure shell](bold red)"
pure_msg = "[pure shell](bold green)"
format = "via [☃️ $state( \\($name\\))](bold blue) "
format = 'via [☃️ $state( \($name\))](bold blue) '
```
## NodeJS
@ -1718,7 +1719,7 @@ The `perl` module shows the currently installed version of Perl. Модуль б
### Опции
| Переменная | По умолчанию | Описание |
| Option | По умолчанию | Описание |
| ---------- | ---------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | The format string for the module. |
| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl |
@ -1799,13 +1800,14 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name
### Опции
| Option | По умолчанию | Описание |
| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | The format for the module. |
| -------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `format` | `'via [${symbol}${pyenv_prefix}${version}( \($virtualenv\))]($style) '` | The format for the module. |
| `symbol` | `"🐍 "` | A format string representing the symbol of Python |
| `style` | `"yellow bold"` | Стиль модуля. |
| `pyenv_version_name` | `false` | Использовать pyenv для получения версии Python |
| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. |
| `disabled` | `false` | Disables the `python` module. |
### Variables
@ -1818,23 +1820,6 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name
| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` |
| virtualenv | `"venv"` | The current `virtualenv` name |
<details>
<summary>This module has some advanced configuration options.</summary>
| Переменная | По умолчанию | Описание |
| --------------- | ------------ | ----------------------------------------------------------------------------- |
| `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. |
The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
</details>
### Пример
@ -1846,6 +1831,17 @@ symbol = "👾 "
pyenv_version_name = true
```
Using the `python3` binary to get the version.
Note - The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
## Ruby
Модуль `ruby` показывает установленную версию Ruby. Модуль будет показан, если любое из следующих условий соблюдено:
@ -1923,7 +1919,7 @@ The `shlvl` module shows the current SHLVL ("shell level") environment variable,
### Опции
| Переменная | По умолчанию | Описание |
| Option | По умолчанию | Описание |
| ----------- | ---------------------------- | --------------------------------------- |
| `threshold` | `2` | Display threshold. |
| `format` | `"[$symbol$shlvl]($style) "` | The format for the module. |
@ -1959,8 +1955,8 @@ threshold = 3
### Опции
| Option | По умолчанию | Описание |
| ---------- | ------------------------------------ | ------------------------------------------------ |
| `format` | `"[$symbol\\[$env\\]]($style) "` | The format for the module. |
| ---------- | -------------------------------- | ------------------------------------------------ |
| `format` | `'[$symbol\[$env\]]($style) '` | The format for the module. |
| `symbol` | `""` | A format string displayed before the image name. |
| `style` | `"bold dimmed blue"` | Стиль модуля. |
| `disabled` | `false` | Disables the `singularity` module. |
@ -1981,7 +1977,7 @@ threshold = 3
# ~/.config/starship.toml
[singularity]
format = "[📦 \\[$env\\]]($style) "
format = '[📦 \[$env\]]($style) '
```
## Swift
@ -2029,7 +2025,7 @@ The `status` module displays the exit code of the previous command. The module w
### Опции
| Переменная | По умолчанию | Описание |
| Option | По умолчанию | Описание |
| ---------- | -------------------------- | ------------------------------------------------------ |
| `format` | `[$symbol$status]($style)` | The format of the module |
| `symbol` | `"✖"` | A format string representing the symbol for the status |
@ -2055,7 +2051,7 @@ The `status` module displays the exit code of the previous command. The module w
[status]
style = "bg:blue"
symbol = "💣 "
format = "[\\[$symbol$status\\]]($style) "
format = '[\[$symbol$status\]]($style) '
disabled = false
```
@ -2147,7 +2143,7 @@ If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Иначе по
[time]
disabled = false
format = "🕙[\\[ $time \\]]($style) "
format = '🕙[\[ $time \]]($style) '
time_format = "%T"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"

View File

@ -10,6 +10,10 @@
- **Конфигурация**: [matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish)
- **Подсказка**: [Starship](https://starship.rs/)
## How do I get command completion as shown in the demo GIF?
Completion support is provided by your shell of choice. In the case of the demo, the demo was done with [Fish Shell](https://fishshell.com/), which provides completions by default. If you use Z Shell (zsh), I'd suggest taking a look at [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions).
## Do top level `format` and `<module>.disabled` do the same thing?
Да, они могут быть использованы для отключения модулей в подсказке. Если всё, что вы хотите сделать - это отключить модули, `<module>.disabled` - предпочитаемый способ сделать это по следующим причинам:

View File

@ -8,7 +8,7 @@ This guide is intended to walk you through the breaking changes.
Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship.
Starship v0.45.0 will instead be accepting a `format` value, allowing for customization of the prompt outside of the modules themselves.
Starship v0.45.0 instead accepts a `format` value, allowing for customization of the prompt outside of the modules themselves.
**Example pre-v0.45.0 configuration**
@ -52,11 +52,11 @@ format = """\
"""
```
## Module `prefix` and `suffix` will be replaced by `format`
## Module `prefix` and `suffix` have been replaced by `format`
Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered.
Starship v0.45.0 will instead be accepting a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
Starship v0.45.0 instead accepts a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
**Example pre-v0.45.0 configuration**
@ -71,7 +71,7 @@ prefix = "took "
[cmd_duration]
# $duration The command duration (e.g. "15s")
# $style The default style of the module (e.g. "bold yellow")
format = "took [$duration]($style)"
format = "took [$duration]($style) "
```
### Affected Modules
@ -93,8 +93,8 @@ format = "took [$duration]($style)"
-- error_symbol = "✖"
-- use_symbol_for_status = true
-- vicmd_symbol = ""
++ success_symbol = "[](bold green) "
++ error_symbol = "[](bold red) "
++ success_symbol = "[](bold green)"
++ error_symbol = "[](bold red)"
++ vicmd_symbol = "[](bold green)"
```
@ -106,9 +106,11 @@ To configure the prompt to use the older `use_symbol_for_status = true` configur
```toml
[character]
error_symbol = "[✖](bold red) "
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.
#### Длительность команды
| Removed Property | Replacement |
@ -120,7 +122,7 @@ error_symbol = "[✖](bold red) "
```diff
[cmd_duration]
-- prefix = "took "
++ format = "took [$duration]($style)"
++ format = "took [$duration]($style) "
```
#### Каталог
@ -134,7 +136,7 @@ error_symbol = "[✖](bold red) "
```diff
[directory]
-- prefix = "in "
++ format = "[$path]($style)[$read_only]($read_only_style)"
++ format = "[$path]($style)[$read_only]($read_only_style) "
```
#### Переменная Окружения
@ -166,7 +168,7 @@ error_symbol = "[✖](bold red) "
[git_commit]
-- prefix = "("
-- suffix = ")"
++ format = "[\\($hash\\)]($style) "
++ format = '[\($hash\)]($style) '
```
#### Статус Git
@ -184,12 +186,12 @@ error_symbol = "[✖](bold red) "
-- prefix = "["
-- suffix = "]"
-- show_sync_count = false
++ format = "([$all_status$ahead_behind] )"
++ format = '([\[$all_status$ahead_behind\]]($style) )'
```
Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch.
With the release of v0.45.0, this has been replaced with the
With the release of v0.45.0, this has been replaced with three separate properties, `ahead`, `behind`, and `diverged`.
To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file:
@ -230,7 +232,7 @@ behind = "⇣${count}"
[singularity]
-- prefix = ""
-- suffix = ""
++ format = "[$symbol\\[$env\\]]($style) "
++ format = '[$symbol\[$env\]]($style) '
```
#### Время
@ -245,7 +247,7 @@ behind = "⇣${count}"
[time]
-- format = "🕙[ %T ]"
++ time_format = "%T"
++ format = "at 🕙[$time]($style)
++ format = "at 🕙[$time]($style) "
```
#### Custom Commands

View File

@ -235,8 +235,8 @@ When using [aws-vault](https://github.com/99designs/aws-vault) the profile is re
### 配置项
| Option | 默认值 | 描述 |
| ---------------- | ---------------------------------------------------- | ------------------------- |
| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | 组件格式化模板。 |
| ---------------- | ------------------------------------------------ | ------------------------- |
| `format` | `'on [$symbol$profile(\($region\))]($style) '` | 组件格式化模板。 |
| `symbol` | `"☁️ "` | 这个字段的内容会显示在当前 AWS 配置信息之前。 |
| `region_aliases` | | 地区缩写列表,用来显示在 AWS 主机名之后。 |
| `style` | `"bold yellow"` | 此组件的样式。 |
@ -261,7 +261,7 @@ When using [aws-vault](https://github.com/99designs/aws-vault) the profile is re
# ~/.config/starship.toml
[aws]
format = "on [$symbol$profile(\\($region\\))]($style) "
format = 'on [$symbol$profile(\($region\))]($style) '
style = "bold blue"
symbol = "🅰 "
[aws.region_aliases]
@ -346,7 +346,7 @@ style = "bold red"
`display` 字段的子字段如下:
| 字段 | 描述 |
| Option | 描述 |
| ----------- | ---------------- |
| `threshold` | 当前显示设置的电量上限(见示例) |
| `style` | 若组件被显示,则使用此样式 |
@ -575,7 +575,7 @@ The `dart` module shows the currently installed version of Dart. 此组件将在
### 配置项
| 字段 | 默认值 | 描述 |
| Option | 默认值 | 描述 |
| ---------- | ---------------------------------- | ----------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | 组件格式化模板。 |
| `symbol` | `"🎯 "` | A format string representing the symbol of Dart |
@ -611,7 +611,7 @@ format = "via [🔰 $version](bold red) "
### 配置项
| 字段 | 默认值 | 描述 |
| Option | 默认值 | 描述 |
| ------------------- | -------------------------------------------------- | ----------------------------------------------------- |
| `truncation_length` | `3` | 当前目录路径被截断后最多保留的父目录数量。 |
| `truncate_to_repo` | `true` | 是否只截断到您当前处于的 git 仓库根目录下。 |
@ -620,6 +620,7 @@ format = "via [🔰 $version](bold red) "
| `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: "…/" |
<details>
<summary>此组件有几个高级配置选项来控制当前目录路径的显示方式。</summary>
@ -658,6 +659,7 @@ format = "via [🔰 $version](bold red) "
[directory]
truncation_length = 8
truncation_symbol = "…/"
```
## Docker Context
@ -756,10 +758,10 @@ The `elixir` module shows the currently installed version of Elixir and Erlang/O
### 配置项
| Option | 默认值 | 描述 |
| ---------- | ------------------------------------------------------------- | --------------------------------------------------------------- |
| ---------- | --------------------------------------------------------- | --------------------------------------------------------------- |
| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. |
| `style` | `"bold purple"` | 此组件的样式。 |
| `format` | `"via [$symbol$version \\(OTP $otp_version\\)]($style) "` | The format for the module elixir. |
| `format` | `'via [$symbol$version \(OTP $otp_version\)]($style) '` | The format for the module elixir. |
| `disabled` | `false` | Disables the `elixir` module. |
### Variables
@ -898,9 +900,9 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### 配置项
| 字段 | 默认值 | 描述 |
| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `"on [$symbol$account(\\($region\\))]($style) "` | 组件格式化模板。 |
| Option | 默认值 | 描述 |
| ---------------- | ------------------------------------------------ | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(\($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"` | 此组件的样式。 |
@ -927,7 +929,7 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
# ~/.config/starship.toml
[gcloud]
format = "on [$symbol$account(\\($project\\))]($style) "
format = 'on [$symbol$account(\($project\))]($style) '
```
#### Display active config name only
@ -995,9 +997,9 @@ truncation_symbol = ""
### 配置项
| Option | 默认值 | 描述 |
| -------------------- | ------------------------------ | ----------------------------------------------------- |
| -------------------- | -------------------------- | ----------------------------------------------------- |
| `commit_hash_length` | `7` | 显示的 git 提交哈希值的长度。 |
| `format` | `"[\\($hash\\)]($style) "` | 组件格式化模板。 |
| `format` | `'[\($hash\)]($style) '` | 组件格式化模板。 |
| `style` | `"bold green"` | 此组件的样式。 |
| `only_detached` | `true` | Only show git commit hash when in detached HEAD state |
| `disabled` | `false` | 禁用 `git_commit` 组件。 |
@ -1027,7 +1029,7 @@ commit_hash_length = 4
### 配置项
| Option | 默认值 | 描述 |
| -------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| -------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `rebase` | `"REBASING"` | A format string displayed when a `rebase` is in progress. |
| `merge` | `"MERGING"` | A format string displayed when a `merge` is in progress. |
| `revert` | `"REVERTING"` | A format string displayed when a `revert` is in progress. |
@ -1036,7 +1038,7 @@ commit_hash_length = 4
| `am` | `"AM"` | A format string displayed when an `apply-mailbox` (`git am`) is in progress. |
| `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)\\) "` | 组件格式化模板。 |
| `format` | `'\([$state( $progress_current/$progress_total)]($style)\) '` | 组件格式化模板。 |
| `disabled` | `false` | 禁用 `git_state` 模块 |
### Variables
@ -1056,7 +1058,7 @@ commit_hash_length = 4
# ~/.config/starship.toml
[git_state]
format = "[\\($state( $progress_current of $progress_total)\\)]($style) "
format = '[\($state( $progress_current of $progress_total)\)]($style) '
cherry_pick = "[🍒 PICKING](bold red)"
```
@ -1067,8 +1069,8 @@ cherry_pick = "[🍒 PICKING](bold red)"
### 配置项
| Option | 默认值 | 描述 |
| ------------ | --------------------------------------------- | ----------------------------------- |
| `format` | `"[\[$all_status$ahead_behind\]]($style) "` | The default format for `git_status` |
| ------------ | ----------------------------------------------- | ----------------------------------- |
| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` |
| `conflicted` | `"="` | 这个分支有合并冲突。 |
| `ahead` | `"⇡"` | The format of `ahead` |
| `behind` | `"⇣"` | The format of `behind` |
@ -1372,11 +1374,10 @@ Displays the current Kubernetes context name and, if set, the namespace from the
### 配置项
| Option | 默认值 | 描述 |
| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- |
| ----------------- | ---------------------------------------------------- | --------------------------------------------------------------------- |
| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. |
| `format` | `"[$symbol$context( \\($namespace\\))]($style) in "` | 组件格式化模板。 |
| `format` | `'[$symbol$context( \($namespace\))]($style) in '` | 组件格式化模板。 |
| `style` | `"cyan bold"` | 此组件的样式。 |
| `namespace_spaceholder` | `none` | The value to display if no namespace was found. |
| `context_aliases` | | Table of context aliases to display. |
| `disabled` | `true` | Disables the `kubernetes` module. |
@ -1397,7 +1398,7 @@ Displays the current Kubernetes context name and, if set, the namespace from the
# ~/.config/starship.toml
[kubernetes]
format = "on [⛵ $context \\($namespace\\)](dimmed green) "
format = 'on [⛵ $context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
@ -1553,8 +1554,8 @@ symbol = "🎣 "
### 配置项
| Option | 默认值 | 描述 |
| ------------ | -------------------------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$state( \\($name\\))]($style) "` | 组件格式化模板。 |
| ------------ | ---------------------------------------------- | ----------------------------------------------------- |
| `format` | `'via [$symbol$state( \($name\))]($style) '` | 组件格式化模板。 |
| `symbol` | `"❄️ "` | A format string representing the symbol of nix-shell. |
| `style` | `"bold blue"` | 此组件的样式。 |
| `impure_msg` | `"impure"` | A format string shown when the shell is impure. |
@ -1581,7 +1582,7 @@ symbol = "🎣 "
disabled = true
impure_msg = "[impure shell](bold red)"
pure_msg = "[pure shell](bold green)"
format = "via [☃️ $state( \\($name\\))](bold blue) "
format = 'via [☃️ $state( \($name\))](bold blue) '
```
## NodeJS
@ -1718,7 +1719,7 @@ The `perl` module shows the currently installed version of Perl. 此组件将在
### 配置项
| 字段 | 默认值 | 描述 |
| Option | 默认值 | 描述 |
| ---------- | ---------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | The format string for the module. |
| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl |
@ -1799,13 +1800,14 @@ format = "via [🔹 $version](147 bold) "
### 配置项
| Option | 默认值 | 描述 |
| -------------------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | 组件格式化模板。 |
| -------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `'via [${symbol}${pyenv_prefix}${version}( \($virtualenv\))]($style) '` | 组件格式化模板。 |
| `symbol` | `"🐍 "` | 用于表示Python的格式化字符串。 |
| `style` | `"yellow bold"` | 此组件的样式。 |
| `pyenv_version_name` | `false` | 使用 pyenv 获取 Python 版本 |
| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used |
| `scan_for_pyfiles` | `true` | 如果设置为false, 在本目录下的Python文件将不会在本组件中显示。 |
| `python_binary` | `python` | 配置在Starship运行时获取Python版本的二进制文件 |
| `disabled` | `false` | 禁用 `python` 组件。 |
### Variables
@ -1818,23 +1820,6 @@ format = "via [🔹 $version](147 bold) "
| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` |
| virtualenv | `"venv"` | 当前`virtualenv`名称 |
<details>
<summary>这个组件存在一些高级配置选项。</summary>
| 字段 | 默认值 | 描述 |
| --------------- | -------- | ------------------------------ |
| `python_binary` | `python` | 配置在Starship运行时获取Python版本的二进制文件 |
`python_binary`变量更改Starship执行的二进制文件以获得 Python版本它没有改变使用的参数。
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
</details>
### 示例
@ -1846,6 +1831,17 @@ symbol = "👾 "
pyenv_version_name = true
```
Using the `python3` binary to get the version.
Note - The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
## Ruby
`ruby` 组件显示当前安装的 Ruby 版本。 此组件将在符合以下任意条件之一时显示:
@ -1923,7 +1919,7 @@ The `shlvl` module shows the current SHLVL ("shell level") environment variable,
### 配置项
| 字段 | 默认值 | 描述 |
| Option | 默认值 | 描述 |
| ----------- | ---------------------------- | --------------------------------------- |
| `threshold` | `2` | Display threshold. |
| `format` | `"[$symbol$shlvl]($style) "` | 组件格式化模板。 |
@ -1959,8 +1955,8 @@ The `singularity` module shows the current singularity image, if inside a contai
### 配置项
| Option | 默认值 | 描述 |
| ---------- | ------------------------------------ | ------------------------------------------------ |
| `format` | `"[$symbol\\[$env\\]]($style) "` | 组件格式化模板。 |
| ---------- | -------------------------------- | ------------------------------------------------ |
| `format` | `'[$symbol\[$env\]]($style) '` | 组件格式化模板。 |
| `symbol` | `""` | A format string displayed before the image name. |
| `style` | `"bold dimmed blue"` | 此组件的样式。 |
| `disabled` | `false` | Disables the `singularity` module. |
@ -1981,7 +1977,7 @@ The `singularity` module shows the current singularity image, if inside a contai
# ~/.config/starship.toml
[singularity]
format = "[📦 \\[$env\\]]($style) "
format = '[📦 \[$env\]]($style) '
```
## Swift
@ -2029,7 +2025,7 @@ The `status` module displays the exit code of the previous command. The module w
### 配置项
| 字段 | 默认值 | 描述 |
| Option | 默认值 | 描述 |
| ---------- | -------------------------- | ------------------------------------------------------ |
| `format` | `[$symbol$status]($style)` | The format of the module |
| `symbol` | `"✖"` | A format string representing the symbol for the status |
@ -2055,7 +2051,7 @@ The `status` module displays the exit code of the previous command. The module w
[status]
style = "bg:blue"
symbol = "💣 "
format = "[\\[$symbol$status\\]]($style) "
format = '[\[$symbol$status\]]($style) '
disabled = false
```
@ -2147,7 +2143,7 @@ If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. 否则,其默
[time]
disabled = false
format = "🕙[\\[ $time \\]]($style) "
format = '🕙[\[ $time \]]($style) '
time_format = "%T"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"

View File

@ -10,6 +10,10 @@
- **fish 配置**[matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish)
- **提示符工具**[Starship](https://starship.rs/)
## How do I get command completion as shown in the demo GIF?
Completion support is provided by your shell of choice. In the case of the demo, the demo was done with [Fish Shell](https://fishshell.com/), which provides completions by default. If you use Z Shell (zsh), I'd suggest taking a look at [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions).
## Do top level `format` and `<module>.disabled` do the same thing?
是的,他们都可以用来禁用提示符中的组件。 如果你只是想禁用组件,推荐使用 `<module>.disabled`,原因如下:

View File

@ -8,7 +8,7 @@ This guide is intended to walk you through the breaking changes.
Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship.
Starship v0.45.0 will instead be accepting a `format` value, allowing for customization of the prompt outside of the modules themselves.
Starship v0.45.0 instead accepts a `format` value, allowing for customization of the prompt outside of the modules themselves.
**Example pre-v0.45.0 configuration**
@ -52,11 +52,11 @@ format = """\
"""
```
## Module `prefix` and `suffix` will be replaced by `format`
## Module `prefix` and `suffix` have been replaced by `format`
Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered.
Starship v0.45.0 will instead be accepting a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
Starship v0.45.0 instead accepts a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
**Example pre-v0.45.0 configuration**
@ -71,7 +71,7 @@ prefix = "took "
[cmd_duration]
# $duration The command duration (e.g. "15s")
# $style The default style of the module (e.g. "bold yellow")
format = "took [$duration]($style)"
format = "took [$duration]($style) "
```
### Affected Modules
@ -93,8 +93,8 @@ format = "took [$duration]($style)"
-- error_symbol = "✖"
-- use_symbol_for_status = true
-- vicmd_symbol = ""
++ success_symbol = "[](bold green) "
++ error_symbol = "[](bold red) "
++ success_symbol = "[](bold green)"
++ error_symbol = "[](bold red)"
++ vicmd_symbol = "[](bold green)"
```
@ -106,9 +106,11 @@ To configure the prompt to use the older `use_symbol_for_status = true` configur
```toml
[character]
error_symbol = "[✖](bold red) "
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.
#### Command Duration
| Removed Property | Replacement |
@ -120,7 +122,7 @@ error_symbol = "[✖](bold red) "
```diff
[cmd_duration]
-- prefix = "took "
++ format = "took [$duration]($style)"
++ format = "took [$duration]($style) "
```
#### Directory
@ -134,7 +136,7 @@ error_symbol = "[✖](bold red) "
```diff
[directory]
-- prefix = "in "
++ format = "[$path]($style)[$read_only]($read_only_style)"
++ format = "[$path]($style)[$read_only]($read_only_style) "
```
#### Environment Variable
@ -166,7 +168,7 @@ error_symbol = "[✖](bold red) "
[git_commit]
-- prefix = "("
-- suffix = ")"
++ format = "[\\($hash\\)]($style) "
++ format = '[\($hash\)]($style) '
```
#### Git Status
@ -184,12 +186,12 @@ error_symbol = "[✖](bold red) "
-- prefix = "["
-- suffix = "]"
-- show_sync_count = false
++ format = "([$all_status$ahead_behind] )"
++ format = '([\[$all_status$ahead_behind\]]($style) )'
```
Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch.
With the release of v0.45.0, this has been replaced with the
With the release of v0.45.0, this has been replaced with three separate properties, `ahead`, `behind`, and `diverged`.
To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file:
@ -230,7 +232,7 @@ behind = "⇣${count}"
[singularity]
-- prefix = ""
-- suffix = ""
++ format = "[$symbol\\[$env\\]]($style) "
++ format = '[$symbol\[$env\]]($style) '
```
#### Time
@ -245,7 +247,7 @@ behind = "⇣${count}"
[time]
-- format = "🕙[ %T ]"
++ time_format = "%T"
++ format = "at 🕙[$time]($style)
++ format = "at 🕙[$time]($style) "
```
#### Custom Commands

View File

@ -235,8 +235,8 @@ $character"""
### 選項
| Option | 預設 | 說明 |
| ---------------- | ---------------------------------------------------- | -------------------------- |
| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | The format for the module. |
| ---------------- | ------------------------------------------------ | -------------------------- |
| `format` | `'on [$symbol$profile(\($region\))]($style) '` | The format for the module. |
| `symbol` | `"☁️ "` | 顯示在目前 AWS 配置之前的符號。 |
| `region_aliases` | | 除了AWS名稱外顯示區域別名表 |
| `style` | `"bold yellow"` | 這個模組的風格。 |
@ -261,7 +261,7 @@ $character"""
# ~/.config/starship.toml
[aws]
format = "on [$symbol$profile(\\($region\\))]($style) "
format = 'on [$symbol$profile(\($region\))]($style) '
style = "bold blue"
symbol = "🅰 "
[aws.region_aliases]
@ -346,7 +346,7 @@ style = "bold red"
`display` 選項是一個下列表格的陣列。
| 變數 | 說明 |
| Option | 說明 |
| ----------- | ----------- |
| `threshold` | 顯示選項的上界。 |
| `style` | 顯示選項使用時的風格。 |
@ -575,7 +575,7 @@ The `dart` module shows the currently installed version of Dart. 這個模組在
### 選項
| 變數 | 預設 | 說明 |
| Option | 預設 | 說明 |
| ---------- | ---------------------------------- | ----------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | The format for the module. |
| `symbol` | `"🎯 "` | A format string representing the symbol of Dart |
@ -611,7 +611,7 @@ format = "via [🔰 $version](bold red) "
### 選項
| 變數 | 預設 | 說明 |
| Option | 預設 | 說明 |
| ------------------- | -------------------------------------------------- | ----------------------------------------------------- |
| `truncation_length` | `3` | 到達現在資料夾的路徑中,要被裁減掉的資料夾數目。 |
| `truncate_to_repo` | `true` | 是否要裁減到你現在所在的 git 儲存庫的根目錄。 |
@ -620,6 +620,7 @@ format = "via [🔰 $version](bold red) "
| `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: "…/" |
<details>
<summary>這個模組有些進階設定選項可以控制顯示資料夾。</summary>
@ -658,6 +659,7 @@ format = "via [🔰 $version](bold red) "
[directory]
truncation_length = 8
truncation_symbol = "…/"
```
## Docker Context
@ -756,10 +758,10 @@ The `elixir` module shows the currently installed version of Elixir and Erlang/O
### 選項
| Option | 預設 | 說明 |
| ---------- | ------------------------------------------------------------- | --------------------------------------------------------------- |
| ---------- | --------------------------------------------------------- | --------------------------------------------------------------- |
| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. |
| `style` | `"bold purple"` | 這個模組的風格。 |
| `format` | `"via [$symbol$version \\(OTP $otp_version\\)]($style) "` | The format for the module elixir. |
| `format` | `'via [$symbol$version \(OTP $otp_version\)]($style) '` | The format for the module elixir. |
| `disabled` | `false` | Disables the `elixir` module. |
### Variables
@ -898,9 +900,9 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
### 選項
| 變數 | 預設 | 說明 |
| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- |
| `format` | `"on [$symbol$account(\\($region\\))]($style) "` | The format for the module. |
| Option | 預設 | 說明 |
| ---------------- | ------------------------------------------------ | --------------------------------------------------------------- |
| `format` | `'on [$symbol$account(\($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"` | 這個模組的風格。 |
@ -927,7 +929,7 @@ The `gcloud` module shows the current configuration for [`gcloud`](https://cloud
# ~/.config/starship.toml
[gcloud]
format = "on [$symbol$account(\\($project\\))]($style) "
format = 'on [$symbol$account(\($project\))]($style) '
```
#### Display active config name only
@ -995,9 +997,9 @@ The `git_commit` module shows the current commit hash of the repo in your curren
### 選項
| Option | 預設 | 說明 |
| -------------------- | ------------------------------ | ----------------------------------------------------- |
| -------------------- | -------------------------- | ----------------------------------------------------- |
| `commit_hash_length` | `7` | The length of the displayed git commit hash. |
| `format` | `"[\\($hash\\)]($style) "` | The format for the module. |
| `format` | `'[\($hash\)]($style) '` | The format for the module. |
| `style` | `"bold green"` | 這個模組的風格。 |
| `only_detached` | `true` | Only show git commit hash when in detached HEAD state |
| `disabled` | `false` | Disables the `git_commit` module. |
@ -1027,7 +1029,7 @@ commit_hash_length = 4
### 選項
| Option | 預設 | 說明 |
| -------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| -------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `rebase` | `"REBASING"` | A format string displayed when a `rebase` is in progress. |
| `merge` | `"MERGING"` | A format string displayed when a `merge` is in progress. |
| `revert` | `"REVERTING"` | A format string displayed when a `revert` is in progress. |
@ -1036,7 +1038,7 @@ commit_hash_length = 4
| `am` | `"AM"` | A format string displayed when an `apply-mailbox` (`git am`) is in progress. |
| `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. |
| `format` | `'\([$state( $progress_current/$progress_total)]($style)\) '` | The format for the module. |
| `disabled` | `false` | 停用 `git_state` 模組。 |
### Variables
@ -1056,7 +1058,7 @@ commit_hash_length = 4
# ~/.config/starship.toml
[git_state]
format = "[\\($state( $progress_current of $progress_total)\\)]($style) "
format = '[\($state( $progress_current of $progress_total)\)]($style) '
cherry_pick = "[🍒 PICKING](bold red)"
```
@ -1067,8 +1069,8 @@ cherry_pick = "[🍒 PICKING](bold red)"
### 選項
| Option | 預設 | 說明 |
| ------------ | --------------------------------------------- | ----------------------------------- |
| `format` | `"[\[$all_status$ahead_behind\]]($style) "` | The default format for `git_status` |
| ------------ | ----------------------------------------------- | ----------------------------------- |
| `format` | `'([\[$all_status$ahead_behind\]]($style) )'` | The default format for `git_status` |
| `conflicted` | `"="` | 這個分支有合併衝突。 |
| `ahead` | `"⇡"` | The format of `ahead` |
| `behind` | `"⇣"` | The format of `behind` |
@ -1372,11 +1374,10 @@ Displays the current Kubernetes context name and, if set, the namespace from the
### 選項
| Option | 預設 | 說明 |
| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- |
| ----------------- | ---------------------------------------------------- | --------------------------------------------------------------------- |
| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. |
| `format` | `"[$symbol$context( \\($namespace\\))]($style) in "` | The format for the module. |
| `format` | `'[$symbol$context( \($namespace\))]($style) in '` | The format for the module. |
| `style` | `"cyan bold"` | 這個模組的風格。 |
| `namespace_spaceholder` | `none` | The value to display if no namespace was found. |
| `context_aliases` | | Table of context aliases to display. |
| `disabled` | `true` | Disables the `kubernetes` module. |
@ -1397,7 +1398,7 @@ Displays the current Kubernetes context name and, if set, the namespace from the
# ~/.config/starship.toml
[kubernetes]
format = "on [⛵ $context \\($namespace\\)](dimmed green) "
format = 'on [⛵ $context \($namespace\)](dimmed green) '
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"
@ -1553,8 +1554,8 @@ symbol = "🎣 "
### 選項
| Option | 預設 | 說明 |
| ------------ | -------------------------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$state( \\($name\\))]($style) "` | The format for the module. |
| ------------ | ---------------------------------------------- | ----------------------------------------------------- |
| `format` | `'via [$symbol$state( \($name\))]($style) '` | The format for the module. |
| `symbol` | `"❄️ "` | A format string representing the symbol of nix-shell. |
| `style` | `"bold blue"` | 這個模組的風格。 |
| `impure_msg` | `"impure"` | A format string shown when the shell is impure. |
@ -1581,7 +1582,7 @@ symbol = "🎣 "
disabled = true
impure_msg = "[impure shell](bold red)"
pure_msg = "[pure shell](bold green)"
format = "via [☃️ $state( \\($name\\))](bold blue) "
format = 'via [☃️ $state( \($name\))](bold blue) '
```
## NodeJS
@ -1718,7 +1719,7 @@ The `perl` module shows the currently installed version of Perl. 這個模組在
### 選項
| 變數 | 預設 | 說明 |
| Option | 預設 | 說明 |
| ---------- | ---------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | The format string for the module. |
| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl |
@ -1799,13 +1800,14 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name
### 選項
| Option | 預設 | 說明 |
| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | The format for the module. |
| -------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `format` | `'via [${symbol}${pyenv_prefix}${version}( \($virtualenv\))]($style) '` | The format for the module. |
| `symbol` | `"🐍 "` | A format string representing the symbol of Python |
| `style` | `"yellow bold"` | 這個模組的風格。 |
| `pyenv_version_name` | `false` | 使用 pyenv 取得 Python 的版本。 |
| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used |
| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. |
| `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. |
| `disabled` | `false` | 停用 `python` 模組。 |
### Variables
@ -1818,23 +1820,6 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name
| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` |
| virtualenv | `"venv"` | The current `virtualenv` name |
<details>
<summary>This module has some advanced configuration options.</summary>
| 變數 | 預設 | 說明 |
| --------------- | -------- | ----------------------------------------------------------------------------- |
| `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. |
The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
</details>
### 範例
@ -1846,6 +1831,17 @@ symbol = "👾 "
pyenv_version_name = true
```
Using the `python3` binary to get the version.
Note - The `python_binary` variable changes the binary that Starship executes to get the version of Python, it doesn't change the arguments that are used.
```toml
# ~/.config/starship.toml
[python]
python_binary = "python3"
```
## Ruby
`ruby` 模組顯示現在安裝的 Ruby 版本。 這個模組在下列其中一個條件達成時顯示:
@ -1923,7 +1919,7 @@ The `shlvl` module shows the current SHLVL ("shell level") environment variable,
### 選項
| 變數 | 預設 | 說明 |
| Option | 預設 | 說明 |
| ----------- | ---------------------------- | --------------------------------------- |
| `threshold` | `2` | Display threshold. |
| `format` | `"[$symbol$shlvl]($style) "` | The format for the module. |
@ -1959,8 +1955,8 @@ The `singularity` module shows the current singularity image, if inside a contai
### 選項
| Option | 預設 | 說明 |
| ---------- | ------------------------------------ | ------------------------------------------------ |
| `format` | `"[$symbol\\[$env\\]]($style) "` | The format for the module. |
| ---------- | -------------------------------- | ------------------------------------------------ |
| `format` | `'[$symbol\[$env\]]($style) '` | The format for the module. |
| `symbol` | `""` | A format string displayed before the image name. |
| `style` | `"bold dimmed blue"` | 這個模組的風格。 |
| `disabled` | `false` | Disables the `singularity` module. |
@ -1981,7 +1977,7 @@ The `singularity` module shows the current singularity image, if inside a contai
# ~/.config/starship.toml
[singularity]
format = "[📦 \\[$env\\]]($style) "
format = '[📦 \[$env\]]($style) '
```
## Swift
@ -2029,7 +2025,7 @@ The `status` module displays the exit code of the previous command. The module w
### 選項
| 變數 | 預設 | 說明 |
| Option | 預設 | 說明 |
| ---------- | -------------------------- | ------------------------------------------------------ |
| `format` | `[$symbol$status]($style)` | The format of the module |
| `symbol` | `"✖"` | A format string representing the symbol for the status |
@ -2055,7 +2051,7 @@ The `status` module displays the exit code of the previous command. The module w
[status]
style = "bg:blue"
symbol = "💣 "
format = "[\\[$symbol$status\\]]($style) "
format = '[\[$symbol$status\]]($style) '
disabled = false
```
@ -2147,7 +2143,7 @@ If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. 不然的話,
[time]
disabled = false
format = "🕙[\\[ $time \\]]($style) "
format = '🕙[\[ $time \]]($style) '
time_format = "%T"
utc_time_offset = "-5"
time_range = "10:00:00-14:00:00"

View File

@ -10,6 +10,10 @@
- **Configuration**: [matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish)
- **Prompt**: [Starship](https://starship.rs/)
## How do I get command completion as shown in the demo GIF?
Completion support is provided by your shell of choice. In the case of the demo, the demo was done with [Fish Shell](https://fishshell.com/), which provides completions by default. If you use Z Shell (zsh), I'd suggest taking a look at [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions).
## Do top level `format` and `<module>.disabled` do the same thing?
Yes, they can both be used to disable modules in the prompt. If all you plan to do is disable modules, `<module>.disabled` is the preferred way to do so for these reasons:

View File

@ -8,7 +8,7 @@ This guide is intended to walk you through the breaking changes.
Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship.
Starship v0.45.0 will instead be accepting a `format` value, allowing for customization of the prompt outside of the modules themselves.
Starship v0.45.0 instead accepts a `format` value, allowing for customization of the prompt outside of the modules themselves.
**Example pre-v0.45.0 configuration**
@ -52,11 +52,11 @@ format = """\
"""
```
## Module `prefix` and `suffix` will be replaced by `format`
## Module `prefix` and `suffix` have been replaced by `format`
Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered.
Starship v0.45.0 will instead be accepting a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
Starship v0.45.0 instead accepts a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output.
**Example pre-v0.45.0 configuration**
@ -71,7 +71,7 @@ prefix = "took "
[cmd_duration]
# $duration The command duration (e.g. "15s")
# $style The default style of the module (e.g. "bold yellow")
format = "took [$duration]($style)"
format = "took [$duration]($style) "
```
### Affected Modules
@ -93,8 +93,8 @@ format = "took [$duration]($style)"
-- error_symbol = "✖"
-- use_symbol_for_status = true
-- vicmd_symbol = ""
++ success_symbol = "[](bold green) "
++ error_symbol = "[](bold red) "
++ success_symbol = "[](bold green)"
++ error_symbol = "[](bold red)"
++ vicmd_symbol = "[](bold green)"
```
@ -106,9 +106,11 @@ To configure the prompt to use the older `use_symbol_for_status = true` configur
```toml
[character]
error_symbol = "[✖](bold red) "
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.
#### 指令持續時間
| Removed Property | Replacement |
@ -120,7 +122,7 @@ error_symbol = "[✖](bold red) "
```diff
[cmd_duration]
-- prefix = "took "
++ format = "took [$duration]($style)"
++ format = "took [$duration]($style) "
```
#### 資料夾
@ -134,7 +136,7 @@ error_symbol = "[✖](bold red) "
```diff
[directory]
-- prefix = "in "
++ format = "[$path]($style)[$read_only]($read_only_style)"
++ format = "[$path]($style)[$read_only]($read_only_style) "
```
#### 環境變數
@ -166,7 +168,7 @@ error_symbol = "[✖](bold red) "
[git_commit]
-- prefix = "("
-- suffix = ")"
++ format = "[\\($hash\\)]($style) "
++ format = '[\($hash\)]($style) '
```
#### Git Status
@ -184,12 +186,12 @@ error_symbol = "[✖](bold red) "
-- prefix = "["
-- suffix = "]"
-- show_sync_count = false
++ format = "([$all_status$ahead_behind] )"
++ format = '([\[$all_status$ahead_behind\]]($style) )'
```
Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch.
With the release of v0.45.0, this has been replaced with the
With the release of v0.45.0, this has been replaced with three separate properties, `ahead`, `behind`, and `diverged`.
To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file:
@ -230,7 +232,7 @@ behind = "⇣${count}"
[singularity]
-- prefix = ""
-- suffix = ""
++ format = "[$symbol\\[$env\\]]($style) "
++ format = '[$symbol\[$env\]]($style) '
```
#### 時間
@ -245,7 +247,7 @@ behind = "⇣${count}"
[time]
-- format = "🕙[ %T ]"
++ time_format = "%T"
++ format = "at 🕙[$time]($style)
++ format = "at 🕙[$time]($style) "
```
#### Custom Commands