From 5f7dd0ede84f9b9b3b81c398a98ac9fc3a472ae4 Mon Sep 17 00:00:00 2001 From: Matan Kushner Date: Thu, 23 Jul 2020 17:07:10 -0400 Subject: [PATCH] docs(i18n): New Crowdin translations (#1366) --- docs/de-DE/advanced-config/README.md | 11 +- docs/de-DE/config/README.md | 1465 ++++++++++++++++------- docs/de-DE/faq/README.md | 30 +- docs/de-DE/guide/README.md | 4 +- docs/es-ES/advanced-config/README.md | 11 +- docs/es-ES/config/README.md | 1457 +++++++++++++++------- docs/es-ES/faq/README.md | 30 +- docs/es-ES/guide/README.md | 4 +- docs/fr-FR/advanced-config/README.md | 15 +- docs/fr-FR/config/README.md | 1449 +++++++++++++++------- docs/fr-FR/faq/README.md | 30 +- docs/fr-FR/guide/README.md | 22 +- docs/ja-JP/advanced-config/README.md | 11 +- docs/ja-JP/config/README.md | 1447 +++++++++++++++------- docs/ja-JP/faq/README.md | 30 +- docs/ja-JP/guide/README.md | 4 +- docs/pt-BR/advanced-config/README.md | 23 +- docs/pt-BR/config/README.md | 1659 ++++++++++++++++++-------- docs/pt-BR/faq/README.md | 30 +- docs/pt-BR/guide/README.md | 4 +- docs/pt-BR/presets/README.md | 10 +- docs/pt-PT/advanced-config/README.md | 11 +- docs/pt-PT/config/README.md | 1441 +++++++++++++++------- docs/pt-PT/faq/README.md | 30 +- docs/pt-PT/guide/README.md | 4 +- docs/ru-RU/advanced-config/README.md | 11 +- docs/ru-RU/config/README.md | 1455 +++++++++++++++------- docs/ru-RU/faq/README.md | 30 +- docs/ru-RU/guide/README.md | 4 +- docs/zh-CN/advanced-config/README.md | 11 +- docs/zh-CN/config/README.md | 1465 ++++++++++++++++------- docs/zh-CN/faq/README.md | 30 +- docs/zh-CN/guide/README.md | 4 +- docs/zh-TW/advanced-config/README.md | 11 +- docs/zh-TW/config/README.md | 1453 +++++++++++++++------- docs/zh-TW/faq/README.md | 30 +- docs/zh-TW/guide/README.md | 4 +- 37 files changed, 9732 insertions(+), 4008 deletions(-) diff --git a/docs/de-DE/advanced-config/README.md b/docs/de-DE/advanced-config/README.md index 1dc52bb2..4c09f943 100644 --- a/docs/de-DE/advanced-config/README.md +++ b/docs/de-DE/advanced-config/README.md @@ -57,7 +57,16 @@ Füge dies in `Zsh` zum `precmd_functions`-Array hinzu: precmd_functions+=(set_win_title) ``` -Um die Funktion dauerhaft zu machen, schreiben Sie diese in die Shell-Konfigurationsdatei: (`~/.bashrc` oder `~/.zsrhc`). +If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. + +For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: + +```bash +function set_win_title(){ + echo -ne "\033]0; $(basename $PWD) \007" +} +starship_precmd_user_func="set_win_title" +``` ## Style-Strings diff --git a/docs/de-DE/config/README.md b/docs/de-DE/config/README.md index 740be12a..fe12ce53 100644 --- a/docs/de-DE/config/README.md +++ b/docs/de-DE/config/README.md @@ -15,24 +15,26 @@ mkdir -p ~/.config && touch ~/.config/starship.toml Die gesamte Konfiguration von Starship wird über diese [TOML](https://github.com/toml-lang/toml)-Datei durchgeführt: ```toml -# Kein Zeilenumbruch am Anfang der Eingabe +# Don't print a new line at the start of the prompt add_newline = false -# Ersetze das "❯" Symbol in der Konsole mit "➜" -[character] # Wir nehmen Änderungen im Module "character" vor -symbol = "➜" # Das "symbol" Feld wird "➜" gesetzt +# Replace the "❯" symbol in the prompt with "➜" +[character] # The name of the module we are configuring is "character" +success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green" -# Deaktiviere das "package" Modul um es ganz aus der Anzeige zu entfernen +# Disable the package module, hiding it from the prompt completely [package] disabled = true ``` Sie können den Pfad zur `starship.toml` mit der `STARSHIP_CONFIG` Umgebungsvariable ändern: + ```sh export STARSHIP_CONFIG=~/.starship ``` Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: + ```ps1 $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` @@ -41,16 +43,39 @@ $ENV:STARSHIP_CONFIG = "$HOME\.starship" **Module**: Eine Komponente in der Konsole, die auf kontextualisierte Informationen des OS basiert. Zum Beispiel zeigt das Modul "nodejs" die Version von NodeJS, die derzeit auf Ihrem Computer installiert ist, wenn Ihr aktuelles Verzeichnis ein NodeJS-Projekt ist. -**Segment**: Kleinere Unterkomponenten, die ein Modul erstellen. Zum Beispiel, das "symbol" Segment im "nodejs" Modul beinhaltet das Symbol das vor der Versionsnummer gezeigt wird (Standard: ⬢). +**Variable**: Smaller sub-components that contains information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of NodeJS. -Hier eine Darstellung des Node-Moduls. Im folgenden Beispiel betrachten wir die Segmente "symbol" und "version". Jedes Modul hat einen Präfix und einen Suffix, welche auf die Standardfarbe des Terminals gesetzt sind. +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. -``` -[prefix] [symbol] [version] [suffix] - "via " "⬢" "v10.4.1" "" -``` +### Format Strings -### Style-Strings +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. + +#### Variable + +A variable contains a `$` symbol followed by the name of the variable. The name of a variable only contains letters, numbers and `_`. + +For example: + +- `$version` is a format string with a variable named `version`. +- `$git_branch$git_commit` is a format string with two variables named `git_branch` and `git_commit`. +- `$git_branch $git_commit` has the two variables separated with a space. + +#### Text Group + +A text group is made up of two different parts. + +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. + +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used style the first part. + +For example: + +- `[on](red bold)` will print a string `on` with bold text colored red. +- `[⬢ $version](bold green)` will print a symbol `⬢` followed by the content of variable `version`, with bold text colored green. +- `[a [b](red) c](green)` will print `a b c` with `b` red, and `a` and `c` green. + +#### Style-Strings Die meisten Module in Starship lassen dich den Darstellungsstil verändern. Dies passiert meistens an einem bestimmten Eintrag (gewöhnlich `style` genannt), der einen String mit den Einstellungen darstellt. Es folgen ein paar Beispiele für solche Strings zusammen mit Beschreibungen was sie bewirken. Details zur vollen Syntax findest du im [Erweiterten Konfigurationshandbuch](/advanced-config/). @@ -63,80 +88,128 @@ Die meisten Module in Starship lassen dich den Darstellungsstil verändern. Dies Wie genau sich diese Konfiguration auswirkt liegt an deinem Terminal-Emulator. Einige Emulatoren zum Beispiel werden die Farben erhellen statt Text dick zu machen, und ein paar Farbthemen benutzen dieselben Werte für normale und helle Farben. Für kursiven Text muss dein Terminal Kursivschrift unterstützen. +#### Conditional Format Strings + +A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. + +For example: + +- `(@$region)` will show nothing if the variable `region` is `None`, otherwise `@` followed by the value of region. +- `(some text)` will always show nothing since there are no variables wrapped in the braces. +- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. + +#### Escapable characters + +The following symbols have special usage in a format string. If you want to print the following symbols, you have to escape them with a backslash (`\`). + +- $ +- \\ +- [ +- ] +- ( +- ) + +Note that `toml` has [its own escape syntax](https://github.com/toml-lang/toml#user-content-string). It is recommended to use a literal string (`''`) in your config. If you want to use a basic string (`""`), pay attention to escape the backslash `\`. + +For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: + +```toml +# with basic string +format = "\n\\$" + +# with multiline basic string +format = """ + +\\$""" + +# with literal string +format = ''' + +\$''' +``` + ## Prompt Dies ist eine Liste mit Prompt-weiten Konfigurationsoptionen. ### Optionen -| Variable | Standardwert | Beschreibung | -| -------------- | ----------------------------- | ------------------------------------------------------------------ | -| `add_newline` | `true` | Neuer Zeilenumbruch bei Start des Prompts. | -| `prompt_order` | [link](#default-prompt-order) | Stelle die Reihenfolge ein, in der die Module den prompt aufbauen. | -| `scan_timeout` | `30` | Timeout für das Scannen von Dateien (in Millisekunden). | +| Option | Standardwert | Beschreibung | +| -------------- | ------------------------------ | ------------------------------------------------------- | +| `format` | [link](#default-prompt-format) | Configure the format of the prompt. | +| `scan_timeout` | `30` | Timeout für das Scannen von Dateien (in Millisekunden). | ### Beispiel ```toml # ~/.config/starship.toml -# Kein Zeilenumbrunch am Anfang der Eingabe -add_newline = false -# Ersetze die vorgegebene Reihenfolge der Statuszeile mit einer eigenen -prompt_order=["rust","line_break","package","line_break","character"] -# Gib Starship zehn Millisekunden um die Dateien im akutellen Pfad zu prüfen. +# Disable the newline at the start of the prompt +format = "$all" + +# Use custom format +format = """ +[┌───────────────────>](bold green) +[│](bold green)$directory$rust$package +[└─>](bold green) """ + +# Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 ``` -### Standard-Promptreihenfolge +### Default Prompt Format -Die Standard `prompt_order` wird benutzt um die Reihenfolge der Module im Prompt zu definieren, falls `prompt_order` leer oder nicht gesetzt ist. Die Standardwerte sind folgende: +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. Die Standardwerte sind folgende: ```toml -prompt_order = [ - "username", - "hostname", - "kubernetes", - "directory", - "git_branch", - "git_commit", - "git_state", - "git_status", - "hg_branch", - "docker_context", - "package", - "dotnet", - "elixir", - "elm", - "erlang", - "golang", - "haskell", - "java", - "julia", - "nim", - "nodejs", - "ocaml", - "php", - "purescript", - "python", - "ruby", - "rust", - "terraform", - "zig", - "nix_shell", - "conda", - "memory_usage", - "aws", - "env_var", - "crystal", - "cmd_duration", - "custom", - "line_break", - "jobs", - "battery", - "time", - "character", -] +format = "\n$all" + +# Which is equivalent to +format = """ + +$username\ +$hostname\ +$kubernetes\ +$directory\ +$git_branch\ +$git_commit\ +$git_state\ +$git_status\ +$hg_branch\ +$docker_context\ +$package\ +$cmake\ +$dotnet\ +$elixir\ +$elm\ +$erlang\ +$golang\ +$helm\ +$java\ +$julia\ +$nim\ +$nodejs\ +$ocaml\ +$php\ +$purescript\ +$python\ +$ruby\ +$rust\ +$terraform\ +$zig\ +$nix_shell\ +$conda\ +$memory_usage\ +$aws\ +$env_var\ +$crystal\ +$cmd_duration\ +$custom\ +$line_break\ +$jobs\ +$battery\ +$time\ +$character""" ``` ## AWS @@ -147,41 +220,80 @@ When using [aws-vault](https://github.com/99designs/aws-vault) the profile is re ### Optionen -| Variable | Standardwert | Beschreibung | -| ----------------- | --------------- | ------------------------------------------------------------------------------------ | -| `symbol` | `"☁️ "` | Symbol das vor dem aktuellen AWS-Profil angezeigt wird. | -| `displayed_items` | `all` | Welche Objekte angezeigt werden sollen. Mögliche Werte: [`all`, `profile`, `region`] | -| `region_aliases` | | Table of region aliases to display in addition to the AWS name. | -| `style` | `"bold yellow"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `aws`-Modul. | +| Option | Standardwert | Beschreibung | +| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- | +| `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. | +| `disabled` | `false` | Deaktiviert das `aws`-Modul. | -### Beispiel +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | ---------------- | ------------------------------------ | +| region | `ap-northeast-1` | The current AWS region | +| profile | `astronauts` | The current AWS profile | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Examples + +#### Display everything ```toml # ~/.config/starship.toml [aws] +format = "on [$symbol$profile(\\($region\\))]($style) " style = "bold blue" symbol = "🅰 " -displayed_items = "region" [aws.region_aliases] ap-southeast-2 = "au" us-east-1 = "va" ``` +#### Display region + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$region]($style) " +style = "bold blue" +symbol = "🅰 " +[aws.region_aliases] +ap-southeast-2 = "au" +us-east-1 = "va" +``` + +#### Display profile + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$profile]($style) " +style = "bold blue" +symbol = "🅰 " +``` + ## Akkustand Das `battery` Modul zeigt, wie hoch der Akku des Geräts geladen ist und den aktuellen Ladestatus. Das Modul ist nur sichtbar, wenn der Akku des Geräts unter 10% geladen ist. ### Optionen -| Variable | Standardwert | Beschreibung | -| -------------------- | ------------------------ | ----------------------------------------------------------------------------------- | -| `full_symbol` | `"•"` | Das Symbol das angezeigt wird wenn der Akku voll geladen ist. | -| `charging_symbol` | `"⇡"` | Das Symbol das angezeigt wird wenn der Akku aufgeladen wird. | -| `discharging_symbol` | `"⇣"` | Das Symbol, das angezeigt wird, wenn die Batterie entladen wird. | -| `display` | [link](#battery-display) | Stellt den Grenzwert ein ab dem der Ladezustand (das battery-Modul) angezeigt wird. | -| `disabled` | `false` | Wenn der Wert auf `true` steht, wird das Akkustand-Modul deaktiviert. | +| Option | Standartwert | Beschreibung | +| -------------------- | --------------------------------- | ----------------------------------------------------------------------------------- | +| `full_symbol` | `"•"` | Das Symbol das angezeigt wird wenn der Akku voll geladen ist. | +| `charging_symbol` | `"⇡"` | Das Symbol das angezeigt wird wenn der Akku aufgeladen wird. | +| `discharging_symbol` | `"⇣"` | Das Symbol, das angezeigt wird, wenn die Batterie entladen wird. | +| `format` | `"[$symbol$percentage]($style) "` | The format for the module. | +| `display` | [link](#battery-display) | Stellt den Grenzwert ein ab dem der Ladezustand (das battery-Modul) angezeigt wird. | +| `disabled` | `false` | Wenn der Wert auf `true` steht, wird das Akkustand-Modul deaktiviert. |
Das Batterie-Modul unterstützt auch einige untypische Zustände. @@ -244,31 +356,85 @@ style = "bold yellow" Das `character` Modul zeigt ein Zeichen ( meistens einen Pfeil "❯") vor der Texteingabe an. -Das Zeichen zeigt an ob der letzte Befehl erfolgreich war, oder einen Fehler erzeugt hat. Das Modul ändert entweder die Farbe, ("style_success","style_failure") standardmäßig Grün/Rot. Oder das Symbol, wenn `use_symbol_for_status` auf `true` steht. +Das Zeichen zeigt an ob der letzte Befehl erfolgreich war, oder einen Fehler erzeugt hat. It can do this in two ways: + +- changing color (`red`/`green`) +- changing shape (`❯`/`✖`) + +By default it only changes color. If you also want to change it's shape take a look at [this example](#with-custom-error-shape). ### Optionen -| Variable | Standardwert | Beschreibung | -| ----------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------- | -| `symbol` | `"❯"` | Das Symbol, das vor der Texteingabe im Prompt verwendet wird. | -| `error_symbol` | `"✖"` | Das Symbol, das vor der Texteingabe angezeigt wird, wenn der letzte Befehl fehlgeschlagen ist. | -| `use_symbol_for_status` | `false` | Fehlerstatus durch Ändern des Symbols anzeigen. | -| `vicmd_symbol` | `"❮"` | Das Symbol, das vor Texteingaben im Prompt verwendet wird, wenn die Shell sich im "normal mode" von vim befindet. | -| `style_success` | `"bold green"` | Der Stil, der verwendet wird, wenn der letzte Befehl erfolgreich war. | -| `style_failure` | `"bold red"` | Der Stil, der verwendet wird, wenn der letzte Befehl fehlgeschlagen ist. | -| `disabled` | `false` | Deaktiviert das `character`-Modul. | +| Option | Standardwert | Beschreibung | +| ---------------- | ------------------- | -------------------------------------------------------------------------------- | +| `format` | `"$symbol "` | The format string used before the text input. | +| `success_symbol` | `"[❯](bold green)"` | The format string used before the text input if the previous command succeeded. | +| `error_symbol` | `"[❯](bold red)"` | The format string used before the text input if the previous command failed. | +| `vicmd_symbol` | `"[❮](bold green)"` | The format string used before the text input if the shell is in vim normal mode. | +| `disabled` | `false` | Deaktiviert das `character`-Modul. | -### Beispiel +### Variables + +| Variable | Beispiel | Beschreibung | +| -------- | -------- | --------------------------------------------------------------------- | +| symbol | | A mirror of either `success_symbol`, `error_symbol` or `vicmd_symbol` | + +### Examples + +#### With custom error shape ```toml # ~/.config/starship.toml [character] -symbol = "➜" -error_symbol = "✗" -use_symbol_for_status = true +success_symbol = "[➜](bold green) " +error_symbol = "[✗](bold red) " ``` +#### Without custom error shape + +```toml +# ~/.config/starship.toml + +[character] +success_symbol = "[➜](bold green) " +error_symbol = "[➜](bold red) " +``` + +#### With custom vim shape + +```toml +# ~/.config/starship.toml + +[character] +vicmd_symbol = "[V](bold green) " +``` + +## CMake + +The `cmake` module shows the currently installed version of CMake if: + +- The current directory contains a `CMakeLists.txt` file + +### Optionen + +| Option | Standardwert | Beschreibung | +| ---------- | ---------------------------------- | -------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🛆 "` | The symbol used before the version of cmake. | +| `style` | `"bold blue"` | Stil für dieses Modul. | +| `disabled` | `false` | Disables the `cmake` module. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | --------- | ------------------------------------ | +| version | `v3.17.3` | The version of cmake | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + ## Befehlsdauer Das `cmd_duration` Modul zeigt an wie lange der letzte Befehl ausgeführt wurde. Das Modul wird nur angezeigt wenn der letzte Befehl länger als zwei Sekunden ausgeführt wurde. Mit der `min_time` Option kann die Zeit eingestellt werden ab der `cmd_duration` angezeigt wird. @@ -283,13 +449,22 @@ Bash Nutzer, die eine "preexec" ähnliche Funktion benötigen, können [rcaloras ### Optionen -| Variable | Standardwert | Beschreibung | -| ------------------- | --------------- | ------------------------------------------------------------------ | -| `min_time` | `2_000` | Schwellwert für kleinste anzuzeigende Laufzeit (in Millisekunden). | -| `show_milliseconds` | `false` | Zeige Millisekunden zusätzlich zu Sekunden. | -| `prefix` | `took` | Prefix der unmittelbar vor der Ausführungszeit angezeigt wird. | -| `style` | `"bold yellow"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `cmd_duration`-Modul. | +| Option | Standardwert | Beschreibung | +| ------------------- | ----------------------------- | ------------------------------------------------------------------ | +| `min_time` | `2_000` | Schwellwert für kleinste anzuzeigende Laufzeit (in Millisekunden). | +| `show_milliseconds` | `false` | Zeige Millisekunden zusätzlich zu Sekunden. | +| `format` | `"took [$duration]($style) "` | The format for the module. | +| `style` | `"bold yellow"` | Stil für dieses Modul. | +| `disabled` | `false` | Deaktiviert das `cmd_duration`-Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | --------------------------------------- | +| duration | `16m40s` | The time it took to execute the command | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -298,7 +473,7 @@ Bash Nutzer, die eine "preexec" ähnliche Funktion benötigen, können [rcaloras [cmd_duration] min_time = 500 -prefix = "underwent " +format = "underwent [$duration](bold yellow)" ``` ## Conda @@ -313,12 +488,23 @@ Hinweis: Dies unterdrückt nicht conda's eigenen Prompt-Modifikator, sie können ### Optionen -| Variable | Standardwert | Beschreibung | -| ------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `truncation_length` | `1` | Die Anzahl der Verzeichnisse, auf die der Verzeichnisspfad abgeschnitten werden soll, wenn die Umgebung über `conda erstellt wurde -p [path]`. `0` bedeutet keine Kürzung. Beachte auch die Beschreibung für das [`directory`](#directory) Modul. | -| `symbol` | `"C "` | Symbol das vor dem Umgebungsnamen angezeigt wird. | -| `style` | `"bold green"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `conda`-Modul. | +| Option | Standardwert | Beschreibung | +| ------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `truncation_length` | `1` | Die Anzahl der Verzeichnisse, auf die der Verzeichnisspfad abgeschnitten werden soll, wenn die Umgebung über `conda erstellt wurde -p [path]`. `0` bedeutet keine Kürzung. Beachte auch die Beschreibung für das [`directory`](#directory) Modul. | +| `symbol` | `"🅒 "` | Symbol das vor dem Umgebungsnamen angezeigt wird. | +| `style` | `"bold green"` | Stil für dieses Modul. | +| `format` | `"[$symbol$environment]($style) "` | The format for the module. | +| `disabled` | `false` | Deaktiviert das `conda`-Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| ----------- | ------------ | ------------------------------------ | +| environment | `astronauts` | The current conda environment | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -326,7 +512,7 @@ Hinweis: Dies unterdrückt nicht conda's eigenen Prompt-Modifikator, sie können # ~/.config/starship.toml [conda] -style = "dimmed green" +format = "[$symbol$environment](dimmed green) " ``` ## Crystal @@ -338,11 +524,22 @@ The `crystal` module shows the currently installed version of Crystal. Das Modul ### Optionen -| Variable | Standardwert | Beschreibung | -| ---------- | ------------ | --------------------------------------------------------- | -| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. | -| `style` | `"bold red"` | Stil für dieses Modul. | -| `disabled` | `false` | Disables the `crystal` module. | +| Option | Standardwert | Beschreibung | +| ---------- | ---------------------------------- | --------------------------------------------------------- | +| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. | +| `style` | `"bold red"` | Stil für dieses Modul. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `crystal` module. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | --------- | ------------------------------------ | +| version | `v0.32.1` | The version of `crystal` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -350,8 +547,7 @@ The `crystal` module shows the currently installed version of Crystal. Das Modul # ~/.config/starship.toml [crystal] -symbol = "✨ " -style = "bold blue" +format = "via [✨ $version](bold blue) " ``` ## Verzeichnis @@ -364,18 +560,20 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an ### Optionen -| Variable | 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. | -| `prefix` | `"in "` | Präfix der vor dem Verzeichnis angezeigt wird. | -| `style` | `"bold cyan"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `directory`-Modul. | +| Variable | Standartwert | Beschreibung | +| ------------------------ | ----------------------------------------------- | -------------------------------------------------------------------------------- | +| `truncation_length` | `3` | Die Anzahl der übergeordneten Ordner, die angezeigt werden. | +| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | +| `format` | `"[$path]($style)[$lock_symbol]($lock_style) "` | The format for the module. | +| `style` | `"bold cyan"` | Stil für dieses Modul. | +| `disabled` | `false` | Deaktiviert das `directory`-Modul. | +| `read_only_symbol` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_symbol_style` | `"red"` | The style for the read only symbol. |
Dieses Modul hat einige erweiterte Konfigurationsoptionen, welche die Darstellung von Verzeichnissen steuern. -| Variable | Standardwert | Beschreibung | +| Advanced Option | Standardwert | Beschreibung | | --------------------------- | ------------ | ---------------------------------------------------------------------------------------- | | `substitutions` | | A table of substitutions to be made to the path. | | `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. | @@ -393,6 +591,15 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
+### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | --------------------- | ----------------------------------- | +| path | `"D:/Projects"` | The current directory path | +| style\* | `"black bold dimmed"` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + ### Beispiel ```toml @@ -408,12 +615,23 @@ The `docker_context` module shows the currently active [Docker context](https:// ### Optionen -| Variable | Standardwert | Beschreibung | -| ----------------- | ------------- | --------------------------------------------------------------------------------------- | -| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context . | -| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. | -| `style` | `"bold blue"` | Stil für dieses Modul. | -| `disabled` | `true` | Disables the `docker_context` module. | +| Option | Standardwert | Beschreibung | +| ----------------- | ---------------------------------- | --------------------------------------------------------------------------------------- | +| `format` | `"via [$symbol$context]($style) "` | The format for the module. | +| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context. | +| `style` | `"blue bold"` | Stil für dieses Modul. | +| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. | +| `disabled` | `true` | Disables the `docker_context` module. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------------- | ------------------------------------ | +| context | `test_context` | The current docker context | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -421,25 +639,51 @@ The `docker_context` module shows the currently active [Docker context](https:// # ~/.config/starship.toml [docker_context] -symbol = "🐋 " +format = "via [🐋 $context](blue bold)" ``` ## Dotnet The `dotnet` module shows the relevant version of the .NET Core SDK for the current directory. If the SDK has been pinned in the current directory, the pinned version is shown. Otherwise the module shows the latest installed version of the SDK. -This module will only be shown in your prompt when one of the following files are present in the current directory: `global.json`, `project.json`, `*.sln`, `*.csproj`, `*.fsproj`, `*.xproj`. You'll also need the .NET Core command-line tools installed in order to use it correctly. +This module will only be shown in your prompt when one or more of the following files are present in the current directory: + +- `global.json` +- `project.json` +- `Directory.Build.props` +- `Directory.Build.targets` +- `Packages.props` +- `*.sln` +- `*.csproj` +- `*.fsproj` +- `*.xproj` + +You'll also need the .NET Core SDK installed in order to use it correctly. Internally, this module uses its own mechanism for version detection. Typically it is twice as fast as running `dotnet --version`, but it may show an incorrect version if your .NET project has an unusual directory layout. If accuracy is more important than speed, you can disable the mechanism by setting `heuristic = false` in the module options. +The module will also show the Target Framework Moniker () when there is a csproj file in the current directory. + ### Optionen -| Variable | Standardwert | Beschreibung | -| ----------- | ------------- | ------------------------------------------------------------------ | -| `symbol` | `"•NET "` | Symbol das vor der dotnet-Version angezeigt wird. | -| `heuristic` | `true` | Schnelle Versionserkennung nutzen um Starship bedienbar zu halten. | -| `style` | `"bold blue"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `dotnet`-Modul. | +| Option | Standardwert | Beschreibung | +| ----------- | ---------------------------------------- | ------------------------------------------------------------------ | +| `format` | `"v[$symbol$version( 🎯 $tfm)]($style) "` | The format for the module. | +| `symbol` | `"•NET "` | Symbol das vor der dotnet-Version angezeigt wird. | +| `heuristic` | `true` | Schnelle Versionserkennung nutzen um Starship bedienbar zu halten. | +| `style` | `"bold blue"` | Stil für dieses Modul. | +| `disabled` | `false` | Deaktiviert das `dotnet`-Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | ---------------- | ------------------------------------------------------------------ | +| version | `v3.1.201` | The version of `dotnet` sdk | +| tfm | `netstandard2.0` | The Target Framework Moniker that the current project is targeting | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -460,11 +704,23 @@ The `elixir` module shows the currently installed version of Elixir and Erlang/O ### Optionen -| Variable | Standardwert | Beschreibung | -| ---------- | --------------- | --------------------------------------------------------------- | -| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. | -| `style` | `"bold purple"` | Stil für dieses Modul. | -| `disabled` | `false` | Disables the `elixir` module. | +| 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. | +| `disabled` | `false` | Disables the `elixir` module. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| ----------- | -------- | ------------------------------------ | +| version | `v1.10` | The version of `elixir` | +| otp_version | | The otp version of `elixir` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -487,12 +743,22 @@ The `elm` module shows the currently installed version of Elm. Das Modul wird ge ### Optionen -| Variable | Standardwert | Beschreibung | -| ---------- | ------------- | ----------------------------------------------------- | -| `symbol` | `"🌳 "` | The symbol used before displaying the version of Elm. | -| `style` | `"bold cyan"` | Stil für dieses Modul. | -| `disabled` | `false` | Disables the `elm` module. | +| Option | Standardwert | Beschreibung | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🌳 "` | A format string representing the symbol of Elm. | +| `style` | `"cyan bold"` | Stil für dieses Modul. | +| `disabled` | `false` | Disables the `elm` module. | +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | --------- | ------------------------------------ | +| version | `v0.19.1` | The version of `elm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -500,7 +766,7 @@ The `elm` module shows the currently installed version of Elm. Das Modul wird ge # ~/.config/starship.toml [elm] -symbol = " " +format = "via [ $version](cyan bold) " ``` ## Umgebungsvariablen @@ -512,15 +778,23 @@ The `env_var` module displays the current value of a selected environment variab ### Optionen -| Variable | Standardwert | Beschreibung | -| ---------- | --------------------- | ---------------------------------------------------------------------------------------- | -| `symbol` | | Das Symbol, das vor der Anzeige der Variable verwendet wird. | -| `variable` | | Die anzuzeigende Umgebungsvariable. | -| `default` | | Der Standardwert, der angezeigt wird, wenn die ausgewählte Variable nicht definiert ist. | -| `prefix` | `""` | Präfix der vor der Variable angezeigt wird. | -| `suffix` | `""` | Suffix der nach der Variable angezeigt wird. | -| `style` | `"dimmed bold black"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `env_var`-Modul. | +| Option | Standardwert | Beschreibung | +| ---------- | ------------------------------ | ---------------------------------------------------------------------------------------- | +| `symbol` | | Das Symbol, das vor der Anzeige der Variable verwendet wird. | +| `variable` | | Die anzuzeigende Umgebungsvariable. | +| `default` | | Der Standardwert, der angezeigt wird, wenn die ausgewählte Variable nicht definiert ist. | +| `format` | `"with [$env_value]($style) "` | The format for the module. | +| `disabled` | `false` | Deaktiviert das `env_var`-Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | ------------------------------------------- | ------------------------------------------ | +| env_value | `Windows NT` (if *variable* would be `$OS`) | The environment value of option `variable` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | `black bold dimmed` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -541,11 +815,22 @@ The `erlang` module shows the currently installed version of Erlang/OTP. Das Mod ### Optionen -| Variable | Standardwert | Beschreibung | -| ---------- | ------------ | -------------------------------------------------------- | -| `symbol` | `"🖧 "` | The symbol used before displaying the version of Erlang. | -| `style` | `bold red` | The style for this module. | -| `disabled` | `false` | Disables the `erlang` module. | +| Option | Standardwert | Beschreibung | +| ---------- | ---------------------------------- | -------------------------------------------------------- | +| `symbol` | `"🖧 "` | The symbol used before displaying the version of erlang. | +| `style` | `"bold red"` | Stil für dieses Modul. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `erlang` module. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | --------- | ------------------------------------ | +| version | `v22.1.3` | The version of `erlang` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -553,7 +838,7 @@ The `erlang` module shows the currently installed version of Erlang/OTP. Das Mod # ~/.config/starship.toml [erlang] -symbol = "e " +format = "via [e $version](bold red) " ``` ## Git-Branch @@ -562,13 +847,24 @@ Das `git_branch`-Modul zeigt den aktiven Git-Branch des Repositories im aktuelle ### Optionen -| Variable | Standardwert | Beschreibung | -| ------------------- | --------------- | ------------------------------------------------------------------------------------------------------ | -| `symbol` | `" "` | Das Symbol, das vor dem Branchnamen des Git-Repositorys in Ihrem aktuellen Verzeichnis angezeigt wird. | -| `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes | -| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. You can use "" for no symbol | -| `style` | `"bold purple"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `git_branch`-Modul. | +| Option | Standardwert | Beschreibung | +| ------------------- | -------------------------------- | ---------------------------------------------------------------------------------------- | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. Use `"$branch"` to refer to the current branch name. | +| `symbol` | `" "` | A format string representing the symbol of git branch. | +| `style` | `"bold purple"` | Stil für dieses Modul. | +| `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes. | +| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. You can use `""` for no symbol. | +| `disabled` | `false` | Deaktiviert das `git_branch`-Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| branch | `master` | The current branch name, falls back to `HEAD` if there's no current branch (e.g. git detached HEAD). | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -587,14 +883,22 @@ The `git_commit` module shows the current commit hash of the repo in your curren ### Optionen -| Variable | Standardwert | Beschreibung | -| -------------------- | -------------- | ----------------------------------------------------- | -| `commit_hash_length` | `7` | The length of the displayed git commit hash. | -| `prefix` | `"("` | Prefix to display immediately before git commit. | -| `suffix` | `")"` | Suffix to display immediately after git commit. | -| `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. | +| Option | Standardwert | Beschreibung | +| -------------------- | ------------------------------ | ----------------------------------------------------- | +| `commit_hash_length` | `7` | The length of the displayed git commit hash. | +| `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. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | --------- | ----------------------------------- | +| hash | `b703eb3` | The current git commit hash | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -611,18 +915,29 @@ The `git_state` module will show in directories which are part of a git reposito ### Optionen -| Variable | Standardwert | Beschreibung | -| ------------------ | ------------------ | ---------------------------------------------------------------------------------------------------------------- | -| `rebase` | `"REBASING"` | The text displayed when a `rebase` is in progress. | -| `merge` | `"MERGING"` | The text displayed when a `merge` is in progress. | -| `revert` | `"REVERTING"` | The text displayed when a `revert` is in progress. | -| `cherry_pick` | `"CHERRY-PICKING"` | The text displayed when a `cherry-pick` is in progress. | -| `bisect` | `"BISECTING"` | The text displayed when a `bisect` is in progress. | -| `am` | `"AM"` | The text displayed when an `apply-mailbox` (`git am`) is in progress. | -| `am_or_rebase` | `"AM/REBASE"` | The text displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. | -| `progress_divider` | `"/"` | The symbol or text which will separate the current and total progress amounts. (e.g., `" of "`, for `"3 of 10"`) | -| `style` | `"bold yellow"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `git_state`-Modul. | +| 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. | +| `cherry_pick` | `"CHERRY-PICKING"` | A format string displayed when a `cherry-pick` is in progress. | +| `bisect` | `"BISECTING"` | A format string displayed when a `bisect` is in progress. | +| `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. | +| `disabled` | `false` | Deaktiviert das `git_state`-Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| ---------------- | ---------- | ----------------------------------- | +| state | `REBASING` | The current state of the repo | +| progress_current | `1` | The current operation progress | +| progress_total | `2` | The total operation progress | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -630,8 +945,8 @@ The `git_state` module will show in directories which are part of a git reposito # ~/.config/starship.toml [git_state] -progress_divider = " of " -cherry_pick = "🍒 PICKING" +format = "[\\($state( $progress_current of $progress_total)\\)]($style) " +cherry_pick = "[🍒 PICKING](bold red)" ``` ## Git-Status @@ -640,37 +955,54 @@ The `git_status` module shows symbols representing the state of the repo in your ### Optionen -| Variable | Standardwert | Beschreibung | -| ------------------ | -------------------------- | ------------------------------------------------------- | -| `conflicted` | `"="` | This branch has merge conflicts. | -| `conflicted_count` | [link](#git-status-counts) | Show and style the number of conflicts. | -| `ahead` | `"⇡"` | This branch is ahead of the branch being tracked. | -| `behind` | `"⇣"` | This branch is behind of the branch being tracked. | -| `diverged` | `"⇕"` | This branch has diverged from the branch being tracked. | -| `untracked` | `"?"` | There are untracked files in the working directory. | -| `untracked_count` | [link](#git-status-counts) | Show and style the number of untracked files. | -| `stashed` | `"$"` | A stash exists for the local repository. | -| `stashed_count` | [link](#git-status-counts) | Show and style the number of stashes. | -| `modified` | `"!"` | There are file modifications in the working directory. | -| `modified_count` | [link](#git-status-counts) | Show and style the number of modified files. | -| `staged` | `"+"` | A new file has been added to the staging area. | -| `staged_count` | [link](#git-status-counts) | Show and style the number of files staged files. | -| `renamed` | `"»"` | A renamed file has been added to the staging area. | -| `renamed_count` | [link](#git-status-counts) | Show and style the number of renamed files. | -| `deleted` | `"✘"` | A file's deletion has been added to the staging area. | -| `deleted_count` | [link](#git-status-counts) | Show and style the number of deleted files. | -| `show_sync_count` | `false` | Show ahead/behind count of the branch being tracked. | -| `prefix` | `[` | Prefix to display immediately before git status. | -| `suffix` | `]` | Suffix to display immediately after git status. | -| `style` | `"bold red"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `git_status`-Modul. | +| Option | Standartwert | Beschreibung | +| ----------------- | ----------------------------------------------- | ---------------------------------------------------- | +| `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` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `show_sync_count` | `false` | Show ahead/behind count of the branch being tracked. | +| `style` | `"bold red"` | Stil für dieses Modul. | +| `disabled` | `false` | Deaktiviert das `git_status`-Modul. | -#### Git Status Counts +### Variables -| Variable | Standardwert | Beschreibung | -| --------- | ------------ | ------------------------------------------------------ | -| `enabled` | `false` | Show the number of files | -| `style` | | Optionally style the count differently than the module | +The following variables can be used in `format`: + +| Variable | Beschreibung | +| -------------- | --------------------------------------------------------------------------------------------- | +| `all_status` | Shortcut for`$conflicted$stashed$deleted$renamed$modified$staged$untracked` | +| `ahead_behind` | Displays `diverged` `ahead` or `behind` format string based on the current status of the repo | +| `conflicted` | Displays `conflicted` when this branch has merge conflicts. | +| `untracked` | Displays `untracked` when there are untracked files in the working directory. | +| `stashed` | Displays `stashed` when a stash exists for the local repository. | +| `modified` | Displays `modified` when there are file modifications in the working directory. | +| `staged` | Displays `staged` when a new file has been added to the staging area. | +| `renamed` | Displays `renamed` when a renamed file has been added to the staging area. | +| `deleted` | Displays `deleted` when a file's deletion has been added to the staging area. | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +The following variables can be used in `diverged`: + +| Variable | Beschreibung | +| -------------- | ---------------------------------------------- | +| `ahead_count` | Number of commits ahead of the tracking branch | +| `behind_count` | Number of commits behind the tracking branch | + +The following variables can be used in `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` and `deleted`: + +| Variable | Beschreibung | +| -------- | ------------------------ | +| `count` | Show the number of files | ### Beispiel @@ -685,10 +1017,7 @@ diverged = "😵" untracked = "🤷‍" stashed = "📦" modified = "📝" -staged.value = "++" -staged.style = "green" -staged_count.enabled = true -staged_count.style = "green" +staged = '[++\($count\)](green)' renamed = "👅" deleted = "🗑" ``` @@ -708,11 +1037,22 @@ Das `golang`-Modul zeigt die aktuell installierte Version von Golang. Das Modul ### Optionen -| Variable | Standardwert | Beschreibung | -| ---------- | ------------- | ------------------------------------------------- | -| `symbol` | `"🐹 "` | Symbol das vor der Golang-Version angezeigt wird. | -| `style` | `"bold cyan"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `golang`-Modul. | +| Option | Standardwert | Beschreibung | +| ---------- | ---------------------------------- | ---------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐹 "` | A format string representing the symbol of Go. | +| `style` | `"bold cyan"` | Stil für dieses Modul. | +| `disabled` | `false` | Deaktiviert das `golang`-Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | --------- | ------------------------------------ | +| version | `v1.12.1` | The version of `go` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -720,30 +1060,42 @@ Das `golang`-Modul zeigt die aktuell installierte Version von Golang. Das Modul # ~/.config/starship.toml [golang] -symbol = "🏎💨 " +format = "via [🏎💨 $version](bold cyan) " ``` -## Haskell -The `haskell` module shows the currently installed version of Haskell Stack version. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: +## Helm -- Das aktuelle Verzeichnis enthält eine `stack.yaml`-Datei +The `helm` module shows the currently installed version of Helm. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: + +- Das aktuelle Verzeichnis enthält eine `helmfile.yaml`-Datei +- The current directory contains a `Chart.yaml` file ### Optionen -| Variable | Standardwert | Beschreibung | -| ---------- | ------------ | --------------------------------------------------------- | -| `symbol` | `"λ "` | The symbol used before displaying the version of Haskell. | -| `style` | `"bold red"` | Stil für dieses Modul. | -| `disabled` | `false` | Disables the `haskell` module. | +| Option | Standartwert | Beschreibung | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⎈ "` | A format string representing the symbol of Helm. | +| `style` | `"bold white"` | Stil für dieses Modul. | +| `disabled` | `false` | Disables the `helm` module. | +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ------------------------------------ | +| version | `v3.1.1` | The version of `helm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel ```toml # ~/.config/starship.toml -[haskell] -symbol = " " +[helm] +format = "via [⎈ $version](bold white) " ``` ## Hostname @@ -752,14 +1104,23 @@ Das `hostname`-Modul zeigt den Hostnamen des Systems an. ### Optionen -| Variable | Standardwert | Beschreibung | -| ---------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | -| `ssh_only` | `true` | Zeigt den Hostnamen nur, wenn via SSH-Sitzung verbunden. | -| `prefix` | `""` | Prefix der unmittelbar vor dem Hostnamen angezeigt wird. | -| `suffix` | `""` | Suffix der unmittelbar nach dem Hostnamen angezeigt wird. | -| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation | -| `style` | `"bold dimmed green"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `hostname`-Modul. | +| Option | Standartwert | Beschreibung | +| ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `ssh_only` | `true` | Zeigt den Hostnamen nur, wenn via SSH-Sitzung verbunden. | +| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation | +| `format` | `"on [$hostname]($style) "` | The format for the module. | +| `style` | `"bold dimmed green"` | Stil für dieses Modul. | +| `disabled` | `false` | Deaktiviert das `hostname`-Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -768,8 +1129,7 @@ Das `hostname`-Modul zeigt den Hostnamen des Systems an. [hostname] ssh_only = false -prefix = "10218;" -suffix = " 10219;" +format = "on [$hostname](bold red) " trim_at = ".companyname.com" disabled = false ``` @@ -783,11 +1143,22 @@ Das `java` Modul zeigt die derzeit installierte Version von Java an. Das Modul w ### Optionen -| Variable | Standardwert | Beschreibung | -| ---------- | -------------- | ----------------------------------------------- | -| `symbol` | `"☕ "` | Symbol das vor der Java-Version angezeigt wird. | -| `style` | `"dimmed red"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `Java`-Modul. | +| Option | Standartwert | Beschreibung | +| ---------- | -------------------------------------- | ----------------------------------------------- | +| `format` | `"via [${symbol}${version}]($style) "` | The format for the module. | +| `symbol` | `"☕ "` | A format string representing the symbol of Java | +| `style` | `"red dimmed"` | Stil für dieses Modul. | +| `disabled` | `false` | Deaktiviert das `Java`-Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ------------------------------------ | +| version | `v14` | The version of `java` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -804,12 +1175,23 @@ The `jobs` module shows the current number of jobs running. The module will be s ### Optionen -| Variable | Standardwert | Beschreibung | -| ----------- | ------------- | -------------------------------------------------------------------------------- | -| `symbol` | `"✦"` | Symbol das vor der Anzahl der Jobs angezeigt wird. | -| `threshold` | `1` | Zeigt die Anzahl der Jobs wenn der angegebene Schwellenwert überschritten wurde. | -| `style` | `"bold blue"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `jobs`-Modul. | +| Option | Standartwert | Beschreibung | +| ----------- | ----------------------------- | -------------------------------------------------------------------------------- | +| `threshold` | `1` | Zeigt die Anzahl der Jobs wenn der angegebene Schwellenwert überschritten wurde. | +| `format` | `"[$symbol$number]($style) "` | The format for the module. | +| `symbol` | `"✦"` | A format string representing the number of jobs. | +| `style` | `"bold blue"` | Stil für dieses Modul. | +| `disabled` | `false` | Deaktiviert das `jobs`-Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -831,11 +1213,22 @@ The `julia` module shows the currently installed version of Julia. Das Modul wir ### Optionen -| Variable | Standardwert | Beschreibung | -| ---------- | --------------- | ------------------------------------------------------- | -| `symbol` | `"ஃ "` | The symbol used before displaying the version of Julia. | -| `style` | `"bold purple"` | Stil für dieses Modul. | -| `disabled` | `false` | Disables the `julia` module. | +| Option | Standartwert | Beschreibung | +| ---------- | ---------------------------------- | ------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"ஃ "` | A format string representing the symbol of Julia. | +| `style` | `"bold purple"` | Stil für dieses Modul. | +| `disabled` | `false` | Disables the `julia` module. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ------------------------------------ | +| version | `v1.4.0` | The version of `julia` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -845,6 +1238,7 @@ The `julia` module shows the currently installed version of Julia. Das Modul wir [julia] symbol = "∴ " ``` + ## Kubernetes Displays the current Kubernetes context name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`. @@ -857,12 +1251,25 @@ Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `dis ### Optionen -| Variable | Standardwert | Beschreibung | -| ----------------- | ------------- | ------------------------------------------------------ | -| `symbol` | `"☸ "` | Symbol das vor der Cluster-Information angezeigt wird. | -| `context_aliases` | | Table of context aliases to display | -| `style` | `"bold blue"` | Stil für dieses Modul. | -| `disabled` | `true` | Deaktiviert das `kubernetes`-Modul | +| Option | Standartwert | Beschreibung | +| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- | +| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. | +| `format` | `"on [$symbol$context( \\($namespace\\))]($style) "` | 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. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------------------- | ---------------------------------------- | +| context | `starship-cluster` | The current kubernetes context | +| namespace | `starship-namespace` | If set, the current kubernetes namespace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -870,8 +1277,7 @@ Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `dis # ~/.config/starship.toml [kubernetes] -symbol = "⛵ " -style = "dimmed green" +format = "on [⛵ $context \\($namespace\\)](dimmed green) " disabled = false [kubernetes.context_aliases] "dev.local.cluster.k8s" = "dev" @@ -883,7 +1289,7 @@ Das `line_break`-Modul unterteilt den Prompt in zwei Zeilen. ### Optionen -| Variable | Standardwert | Beschreibung | +| Option | Standartwert | Beschreibung | | ---------- | ------------ | ---------------------------------------------------------------------- | | `disabled` | `false` | Deaktiviert das `line_break`-Modul, wodurch der Prompt einzeilig wird. | @@ -910,15 +1316,26 @@ Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `dis ### Optionen -| Variable | Standardwert | Beschreibung | -| ----------------- | --------------------- | -------------------------------------------------------------------------- | -| `show_percentage` | `false` | Zeigt die Speicherauslastung als Prozentsatz des verfügbaren Speichers an. | -| `show_swap` | `true` | Swap-Nutzung anzeigen, wenn die Gesamtsumme des swaps nicht Null ist. | -| `threshold` | `75` | Speicherauslastung ausblenden, wenn sie unter diesem Prozentsatz ist. | -| `symbol` | `"🐏 "` | Symbol das vor der Speicherauslastung angezeigt wird. | -| `separator` | `" | "` | Symbol oder Text, der ram und swap-Nutzung trennt. | -| `style` | `"bold dimmed white"` | Stil für dieses Modul. | -| `disabled` | `true` | Deaktiviert das `memory_usage`-Modul. | +| Option | Standartwert | Beschreibung | +| ----------- | --------------------------------------------- | --------------------------------------------------------------------- | +| `threshold` | `75` | Speicherauslastung ausblenden, wenn sie unter diesem Prozentsatz ist. | +| `format` | `"via $symbol [${ram}( | ${swap})]($style) "` | The format for the module. | +| `symbol` | `"🐏"` | Symbol das vor der Speicherauslastung angezeigt wird. | +| `style` | `"bold dimmed white"` | Stil für dieses Modul. | +| `disabled` | `true` | Deaktiviert das `memory_usage`-Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| ------------- | ------------- | ------------------------------------------------------------------ | +| ram | `31GiB/65GiB` | The usage/total RAM of the current system memory. | +| ram_pct | `48%` | The percentage of the current system memory. | +| swap\** | `1GiB/4GiB` | The swap memory size of the current system swap memory file. | +| swap_pct\** | `77%` | The swap memory percentage of the current system swap memory file. | +| symbol | `🐏` | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string \*\*: The SWAP file information is only displayed if detected on the current system ### Beispiel @@ -941,13 +1358,24 @@ The `hg_branch` module shows the active branch of the repo in your current direc ### Optionen -| Variable | Standardwert | Beschreibung | -| ------------------- | --------------- | -------------------------------------------------------------------------------------------- | -| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. | -| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes | -| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. | -| `style` | `"bold purple"` | Stil für dieses Modul. | -| `disabled` | `true` | Disables the `hg_branch` module. | +| Option | Standartwert | Beschreibung | +| ------------------- | -------------------------------- | -------------------------------------------------------------------------------------------- | +| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. | +| `style` | `"bold purple"` | Stil für dieses Modul. | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. | +| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes | +| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. | +| `disabled` | `true` | Disables the `hg_branch` module. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ------------------------------------ | +| branch | `master` | The active mercurial branch | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -955,26 +1383,38 @@ The `hg_branch` module shows the active branch of the repo in your current direc # ~/.config/starship.toml [hg_branch] -symbol = "🌱 " +format = "on [🌱 $branch](bold purple)" truncation_length = 4 truncation_symbol = "" ``` ## Nim -The `nim` module shows the currently installed version of Nim. Das Modul wird nur dann angezeigt, wenn eine der folgenden Bedingungen zutrifft: -- The current directory contains a `nim.cfg` file +The `nim` module shows the currently installed version of Nim. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: + +- Das aktuelle Verzeichnis enthält eine `nim.cfg`-Datei - The current directory contains a file with the `.nim` extension - The current directory contains a file with the `.nims` extension - The current directory contains a file with the `.nimble` extension ### Optionen -| Variable | Standardwert | Beschreibung | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | -| `style` | `"bold yellow"` | Stil für dieses Modul. | -| `disabled` | `false` | Disables the `nim` module. | +| Option | Standartwert | Beschreibung | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module | +| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | +| `style` | `"bold yellow"` | Stil für dieses Modul. | +| `disabled` | `false` | Disables the `nim` module. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ------------------------------------ | +| version | `v1.2.0` | The version of `nimc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -992,14 +1432,25 @@ Das `nix_shell`-Modul zeigt die nix-shell Umgebung an. Das Modul wird angezeigt, ### Optionen -| Variable | Standardwert | Beschreibung | -| ------------ | ------------- | ------------------------------------------------- | -| `use_name` | `false` | Namen der nix-Shell anzeigen. | -| `impure_msg` | `"impure"` | Passt die "impure"-Nachricht an. | -| `pure_msg` | `"pure"` | Passt die "pure"-Nachricht an. | -| `symbol` | `"❄️ "` | The symbol used before displaying the shell name. | -| `style` | `"bold blue"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `nix_shell`-Modul. | +| Option | Standartwert | Beschreibung | +| ------------ | -------------------------------------------------- | ----------------------------------------------------- | +| `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. | +| `pure_msg` | `"pure"` | A format string shown when the shell is pure. | +| `disabled` | `false` | Deaktiviert das `nix_shell`-Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ------------------------------------ | +| state | `pure` | The state of the nix-shell | +| name | `lorri` | The name of the nix-shell | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -1008,28 +1459,39 @@ Das `nix_shell`-Modul zeigt die nix-shell Umgebung an. Das Modul wird angezeigt, [nix_shell] disabled = true -use_name = true -impure_msg = "impure shell" -pure_msg = "pure shell" -symbol = "☃️ " +impure_msg = "[impure shell](bold red)" +pure_msg = "[pure shell](bold green)" +format = "via [☃️ $state( \\($name\\))](bold blue) " ``` ## NodeJS -Das `nodejs` Modul zeigt die derzeit installierte Version von NodeJS. Das Modul wird nur dann angezeigt, wenn eine der folgenden Bedingungen zutrifft: +Das `nodejs`-Modul zeigt die aktuell installierte Version von NodeJS. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: -- The current directory contains a `package.json` file +- Das aktuelle Verzeichnis enthält eine `package.json`-Datei - The current directory contains a `.node-version` file - Das aktuelle Verzeichnis enthält ein `node_modules`-Verzeichnis -- Das aktuelle Verzeichnis enthält eine Datei mit der `.js`-Erweiterung +- The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension +- The current directory contains a file with the `.ts` extension ### Optionen -| Variable | Standartwert | Beschreibung | -| ---------- | -------------- | ------------------------------------------------- | -| `symbol` | `"⬢ "` | Symbol das vor der NodeJS-Version angezeigt wird. | -| `style` | `"bold green"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `nodejs`-Modul. | +| Option | Standartwert | Beschreibung | +| ---------- | ---------------------------------- | -------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⬢ "` | A format string representing the symbol of NodeJS. | +| `style` | `"bold green"` | Stil für dieses Modul. | +| `disabled` | `false` | Deaktiviert das `nodejs`-Modul. | + +###  Variables + +| Variable | Beispiel | Beschreibung | +| --------- | ---------- | ------------------------------------ | +| version | `v13.12.0` | The version of `node` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -1037,7 +1499,7 @@ Das `nodejs` Modul zeigt die derzeit installierte Version von NodeJS. Das Modul # ~/.config/starship.toml [nodejs] -symbol = "🤖 " +format = "via [🤖 $version](bold green) " ``` ## Paketversion @@ -1056,12 +1518,23 @@ Das `Package` Modul wird angezeigt, wenn das aktuelle Verzeichnis das Repository ### Optionen -| Variable | Standardwert | Beschreibung | -| ----------------- | ------------ | --------------------------------------------------------- | -| `symbol` | `"📦 "` | Symbol das vor der Paketversion angezeigt wird. | -| `style` | `"bold 208"` | Stil für dieses Modul. | -| `display_private` | `false` | Enable displaying version for packages marked as private. | -| `disabled` | `false` | Deaktiviert das `package`-Modul. | +| Option | Standartwert | Beschreibung | +| ----------------- | ---------------------------------- | --------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"📦 "` | Symbol das vor der Paketversion angezeigt wird. | +| `style` | `"bold 208"` | Stil für dieses Modul. | +| `display_private` | `false` | Enable displaying version for packages marked as private. | +| `disabled` | `false` | Deaktiviert das `package`-Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ------------------------------------ | +| version | `v1.0.0` | The version of your package | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -1069,7 +1542,7 @@ Das `Package` Modul wird angezeigt, wenn das aktuelle Verzeichnis das Repository # ~/.config/starship.toml [package] -symbol = "🎁 " +format = "via [🎁 $version](208 bold) " ``` ## OCaml @@ -1085,11 +1558,22 @@ The `ocaml` module shows the currently installed version of OCaml. Das Modul wir ### Optionen -| Variable | Standardwert | Beschreibung | -| ---------- | --------------- | ------------------------------------------------------- | -| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | -| `style` | `"bold yellow"` | Stil für dieses Modul. | -| `disabled` | `false` | Disables the `ocaml` module. | +| Option | Standartwert | Beschreibung | +| ---------- | ---------------------------------- | ------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format string for the module. | +| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | +| `style` | `"bold yellow"` | Stil für dieses Modul. | +| `disabled` | `false` | Disables the `ocaml` module. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | --------- | ------------------------------------ | +| version | `v4.10.0` | The version of `ocaml` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -1097,24 +1581,35 @@ The `ocaml` module shows the currently installed version of OCaml. Das Modul wir # ~/.config/starship.toml [ocaml] -symbol = "🐪 " +format = "via [🐪 $version]($style) " ``` ## PHP -Das `php`-Modul zeigt die aktuell installierte Version von PHP. Das Modul wird nur dann angezeigt, wenn eine der folgenden Bedingungen zutrifft: +Das `php`-Modul zeigt die aktuell installierte Version von PHP. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: -- The current directory contains a `composer.json` file +- Das aktuelle Verzeichnis enthält eine `composer.json`-Datei - The current directory contains a `.php-version` file - Das aktuelle Verzeichnis enthält eine `.php`-Datei ### Optionen -| Variable | Standardwert | Beschreibung | -| ---------- | ------------ | ---------------------------------------------- | -| `symbol` | `"🐘 "` | Symbol das vor der PHP-Version angezeigt wird. | -| `style` | `"bold 147"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `php`-Modul. | +| Option | Standartwert | Beschreibung | +| ---------- | ---------------------------------- | ---------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐘 "` | Symbol das vor der PHP-Version angezeigt wird. | +| `style` | `"147 bold"` | Stil für dieses Modul. | +| `disabled` | `false` | Deaktiviert das `php`-Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ------------------------------------ | +| version | `v7.3.8` | The version of `php` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -1122,7 +1617,7 @@ Das `php`-Modul zeigt die aktuell installierte Version von PHP. Das Modul wird n # ~/.config/starship.toml [php] -symbol = "🔹 " +format = "via [🔹 $version](147 bold) " ``` ## Python @@ -1145,19 +1640,28 @@ Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: ### Optionen -| Variable | Standardwert | Beschreibung | -| -------------------- | --------------- | -------------------------------------------------------------------------- | -| `symbol` | `"🐍 "` | Symbol das vor der Python-Version angezeigt wird. | -| `pyenv_version_name` | `false` | Verwende `pyenv` um die Python-Versionzu beziehen. | -| `pyenv_prefix` | `"pyenv "` | Prefix zur Anzeige der pyenv-Version (Standard: `pyenv MY_VERSION`) | -| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | -| `style` | `"bold yellow"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `python`-Modul. | +| Option | Standartwert | Beschreibung | +| -------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${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. | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `disabled` | `false` | Deaktiviert das `python`-Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| ---------- | --------------- | ------------------------------------ | +| version | `"v3.8.1"` | The version of `python` | +| symbol | `"🐍 "` | Mirrors the value of option `symbol` | +| style | `"yellow bold"` | Mirrors the value of option `style` | +| virtualenv | `"venv"` | The current `virtualenv` name |
This module has some advanced configuration options. -| Variable | Standardwert | Beschreibung | +| Variable | Standartwert | Beschreibung | | --------------- | ------------ | ----------------------------------------------------------------------------- | | `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. | @@ -1193,11 +1697,22 @@ Das `ruby` Modul zeigt die derzeit installierte Version von Ruby an. Das Modul w ### Optionen -| Variable | Standardwert | Beschreibung | -| ---------- | ------------ | ----------------------------------------------- | -| `symbol` | `"💎 "` | Symbol das vor der Ruby-Version angezeigt wird. | -| `style` | `"bold red"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `ruby`-Modul. | +| Option | Standartwert | Beschreibung | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"💎 "` | A format string representing the symbol of Ruby. | +| `style` | `"bold red"` | Stil für dieses Modul. | +| `disabled` | `false` | Deaktiviert das `ruby`-Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ------------------------------------ | +| version | `v2.5.1` | The version of `ruby` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -1217,11 +1732,22 @@ Das `rust` Modul zeigt die derzeit installierte Version von Rust an. Das Modul w ### Optionen -| Variable | Standardwert | Beschreibung | -| ---------- | ------------ | ----------------------------------------------- | -| `symbol` | `"🦀 "` | Symbol das vor der Rust-Version angezeigt wird. | -| `style` | `"bold red"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `rust`-Modul. | +| Option | Standartwert | Beschreibung | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🦀 "` | A format string representing the symbol of Rust | +| `style` | `"bold red"` | Stil für dieses Modul. | +| `disabled` | `false` | Deaktiviert das `rust`-Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | ----------------- | ------------------------------------ | +| version | `v1.43.0-nightly` | The version of `rustc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -1229,7 +1755,7 @@ Das `rust` Modul zeigt die derzeit installierte Version von Rust an. Das Modul w # ~/.config/starship.toml [rust] -symbol = "⚙️ " +format = "via [⚙️ $version](red bold)" ``` ## Singularity @@ -1238,14 +1764,22 @@ The `singularity` module shows the current singularity image, if inside a contai ### Optionen -| Variable | Standartwert | Beschreibung | -| ---------- | -------------------- | ------------------------------------------------ | -| `label` | `""` | Prefix before the image name display. | -| `prefix` | `"["` | Prefix to display immediately before image name. | -| `suffix` | `"]"` | Suffix to display immediately after image name. | -| `symbol` | `""` | The symbol used before the image name. | -| `style` | `"bold dimmed blue"` | Stil für dieses Modul. | -| `disabled` | `false` | Disables the `singularity` module. | +| Option | Standartwert | 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. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | ------------ | ------------------------------------ | +| env | `centos.img` | The current singularity image | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -1253,32 +1787,54 @@ The `singularity` module shows the current singularity image, if inside a contai # ~/.config/starship.toml [singularity] -symbol = "📦 " +format = "[📦 \\[$env\\]]($style) " ``` ## Terraform -Das `Terraform` Modul zeigt den aktuell ausgewählten terraform Arbeitsbereich und die Version an. Standardmäßig wird die Terraform-Version nicht angezeigt, da dies bei aktuellen Versionen von Terraform langsam ist, wenn viele Plugins verwendet werden. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: +Das `Terraform` Modul zeigt den aktuell ausgewählten terraform Arbeitsbereich und die Version an. Standardmäßig wird die Terraform-Version nicht angezeigt, da dies bei aktuellen Versionen von Terraform langsam ist, wenn viele Plugins verwendet werden. If you still want to enable it, [follow the example shown below](#with-version). Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: - Das aktuelle Verzeichnis enthält eine `.terraform`-Datei - Das aktuelle Verzeichnis enthält eine Datei mit der `.tf`-Erweiterung ### Optionen -| Variable | Standartwert | Beschreibung | -| -------------- | ------------ | -------------------------------------------------------------------------------------- | -| `symbol` | `"💠 "` | Das Symbol das vor dem Terraform-Workspacenamen angezeigt wird. | -| `show_version` | `false` | Blendet die Terraform Versionsnummer ein. Kann In großen Workspaces sehr langsam sein. | -| `style` | `"bold 105"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `terraform` Modul. | +| Option | Standartwert | Beschreibung | +| ---------- | ------------------------------------ | ----------------------------------------------------- | +| `format` | `"via [$symbol$workspace]($style) "` | The format string for the module. | +| `symbol` | `"💠 "` | A format string shown before the terraform workspace. | +| `style` | `"bold 105"` | Stil für dieses Modul. | +| `disabled` | `false` | Deaktiviert das `terraform` Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | ---------- | ------------------------------------ | +| version | `v0.12.24` | The version of `terraform` | +| workspace | `default` | The current terraform workspace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel +#### With Version + ```toml # ~/.config/starship.toml [terraform] -symbol = "🏎💨 " +format = "[🏎💨 $version$workspace]($style) " +``` + +#### Without version + +```toml +# ~/.config/starship.toml + +[terraform] +format = "[🏎💨 $workspace]($style) " ``` ## Zeit @@ -1293,16 +1849,26 @@ Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `dis ### Optionen -| Variable | Standartwert | Beschreibung | -| ----------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------- | -| `use_12hr` | `false` | Aktiviert 12-Stunden-Format. | -| `format` | siehe unten | Das Format zum Anzeigen der Uhrzeit in [chrono-Formatierung](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html). | -| `style` | `"bold yellow"` | Stil für dieses Modul. | -| `utc_time_offset` | `"local"` | Verwendetes Zeitzonen-Offset. Liegt zwischen -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. | -| `disabled` | `true` | Deaktiviert das `time`-Modul. | -| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | +| Option | Standartwert | Beschreibung | +| ----------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `format` | `"at [$time]($style) "` | The format string for the module. | +| `use_12hr` | `false` | Aktiviert 12-Stunden-Format | +| `time_format` | siehe unten | Das Format zum Anzeigen der Uhrzeit in [chrono-Formatierung](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html). | +| `style` | `"bold yellow"` | Stil für dieses Modul | +| `utc_time_offset` | `"local"` | Verwendetes Zeitzonen-Offset. Range from -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. | +| `disabled` | `true` | Deaktiviert das `time`-Modul. | +| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | -Wird `use_12hr` auf `true` gestellt, nimmt `format` automatisch den Wert `"%r"` an. Andernfalls ist es standardmäßig `"%T"`. Wird hingegen `format` gesetzt, so überschreibt dies die Einstellung `use_12hr`. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Andernfalls ist es standardmäßig `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | ---------- | ----------------------------------- | +| zeit | `13:08:10` | The current time. | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -1311,7 +1877,8 @@ Wird `use_12hr` auf `true` gestellt, nimmt `format` automatisch den Wert `"%r"` [time] disabled = false -format = "🕙[ %T ]" +format = "🕙[\\[ $time \\]]($style) " +time_format = "%T" utc_time_offset = "-5" time_range = "10:00:00-14:00:00" ``` @@ -1327,12 +1894,20 @@ Das `username` Modul zeigt den Namen des aktiven Benutzers. Das Modul wird gezei ### Optionen -| Variable | Standartwert | Beschreibung | -| ------------- | --------------- | ---------------------------------------------- | -| `style_root` | `"bold red"` | Stil wenn der Benutzer unter root läuft. | -| `style_user` | `"bold yellow"` | Stil wenn der Benutzer nicht unter root läuft. | -| `show_always` | `false` | Immer das `username` Modul anzeigen. | -| `disabled` | `false` | Deavktiviert das `username` Modul. | +| Option | Standartwert | Beschreibung | +| ------------- | ------------------------ | ---------------------------------------------- | +| `style_root` | `"bold red"` | Stil wenn der Benutzer unter root läuft. | +| `style_user` | `"bold yellow"` | Stil wenn der Benutzer nicht unter root läuft. | +| `format` | `"via [$user]($style) "` | The format for the module. | +| `show_always` | `false` | Immer das `username` Modul anzeigen. | +| `disabled` | `false` | Deavktiviert das `username` Modul. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| -------- | ------------ | ------------------------------------------------------------------------------------------- | +| `style` | `"red bold"` | Mirrors the value of option `style_root` when root is logged in and `style_user` otherwise. | +| `user` | `"matchai"` | The currently logged-in user ID. | ### Beispiel @@ -1340,10 +1915,13 @@ Das `username` Modul zeigt den Namen des aktiven Benutzers. Das Modul wird gezei # ~/.config/starship.toml [username] -disabled = true +style_user = "white bold" +style_root = "black bold" +format = "user: [$user]($style) " +disabled = false +show_always = true ``` - ## Zig The `zig` module shows the currently installed version of Zig. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: @@ -1352,11 +1930,22 @@ The `zig` module shows the currently installed version of Zig. Das Modul wird ge ### Optionen -| Variable | Standartwert | Beschreibung | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | -| `style` | `"bold yellow"` | Stil für dieses Modul. | -| `disabled` | `false` | Disables the `zig` module. | +| Option | Standartwert | Beschreibung | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | +| `style` | `"bold yellow"` | Stil für dieses Modul. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `zig` module. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ------------------------------------ | +| version | `v0.6.0` | The version of `zig` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -1372,6 +1961,7 @@ symbol = "⚡️ " The `custom` modules show the output of some arbitrary commands. These modules will be shown if any of the following conditions are met: + - The current directory contains a file whose name is in `files` - The current directory contains a directory whose name is in `directories` - The current directory contains a file whose extension is in `extensions` @@ -1391,24 +1981,34 @@ The order in which custom modules are shown can be individually set by setting ` ### Optionen -| Variable | Standartwert | Beschreibung | -| -------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. | -| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | -| `shell` | | [See below](#custom-command-shell) | -| `beschreibung` | `""` | The description of the module that is shown when running `starship explain`. | -| `files` | `[]` | The files that will be searched in the working directory for a match. | -| `directories` | `[]` | The directories that will be searched in the working directory for a match. | -| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | -| `symbol` | `""` | The symbol used before displaying the command output. | -| `style` | `"bold green"` | Stil für dieses Modul. | -| `prefix` | `""` | Prefix to display immediately before the command output. | -| `suffix` | `""` | Suffix to display immediately after the command output. | -| `disabled` | `false` | Disables this `custom` module. | +| Option | Standartwert | Beschreibung | +| -------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `command` | | The command whose output should be printed. | +| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | +| `shell` | | [See below](#custom-command-shell) | +| `beschreibung` | `""` | The description of the module that is shown when running `starship explain`. | +| `files` | `[]` | The files that will be searched in the working directory for a match. | +| `directories` | `[]` | The directories that will be searched in the working directory for a match. | +| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | +| `symbol` | `""` | The symbol used before displaying the command output. | +| `style` | `"bold green"` | Stil für dieses Modul. | +| `format` | `"[$symbol$output]($style) "` | The format for the module. | +| `disabled` | `false` | Disables this `custom` module. | + +### Variables + +| Variable | Beschreibung | +| --------- | -------------------------------------- | +| output | The output of shell command in `shell` | +| symbol | Mirrors the value of option `symbol` | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string #### Custom command shell `shell` accepts a non-empty list of strings, where: + - The first string is the path to the shell to use to execute the command. - Other following arguments are passed to the shell. @@ -1459,11 +2059,22 @@ The `purescript` module shows the currently installed version of PureScript vers ### Optionen -| Variable | Standartwert | Beschreibung | -| ---------- | -------------- | ------------------------------------------------------------ | -| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | -| `style` | `"bold white"` | Stil für dieses Modul. | -| `disabled` | `false` | Disables the `purescript` module. | +| Option | Standartwert | Beschreibung | +| ---------- | ---------------------------------- | ------------------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | +| `style` | `"bold white"` | Stil für dieses Modul. | +| `disabled` | `false` | Disables the `purescript` module. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ------------------------------------ | +| version | `0.13.5` | The version of `purescript` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Beispiel @@ -1471,5 +2082,5 @@ The `purescript` module shows the currently installed version of PureScript vers # ~/.config/starship.toml [purescript] -symbol = "<=> " +format = "via [$symbol$version](bold white)" ``` diff --git a/docs/de-DE/faq/README.md b/docs/de-DE/faq/README.md index e8d17001..a99c33c6 100644 --- a/docs/de-DE/faq/README.md +++ b/docs/de-DE/faq/README.md @@ -5,9 +5,9 @@ - **Terminal Emulator**: [iTerm2](https://iterm2.com/) - **Theme**: Minimal - **Farbschema**: [Snazzy](https://github.com/sindresorhus/iterm2-snazzy) - - **Font**: [Fira Code](https://github.com/tonsky/FiraCode) + - **Font**: [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads) - **Shell**: [Fish Shell](https://fishshell.com/) - - **Konfiguration**: [Matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/master/.config/fish/config.fish) + - **Konfiguration**: [Matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish) - **Prompt**: [Starship](https://starship.rs/) ## Tun `prompt_order` und `.disabled` dasselbe? @@ -46,7 +46,7 @@ Die Eingabeaufforderung verwendet so viel Kontext wie möglich, aber keine Flagg ## How do I run Starship on Linux distributions with older versions of glibc? -If you get an error like "*version 'GLIBC_2.18' not found (required by starship)*" when using the prebuilt binary (for example, on CentOS 6 or 7), you can use a binary compiled with `musl` instead of `glibc`: +If you get an error like "_version 'GLIBC_2.18' not found (required by starship)_" when using the prebuilt binary (for example, on CentOS 6 or 7), you can use a binary compiled with `musl` instead of `glibc`: ```sh curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux-musl @@ -56,13 +56,13 @@ curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux- 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: - - 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 [powerline-patched font](https://github.com/powerline/fonts). +- 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/). To test your system, run the following commands in a terminal: -``` +```sh echo -e "\xf0\x9f\x90\x8d" echo -e "\xee\x82\xa0" ``` @@ -70,3 +70,19 @@ 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). 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) + +## How do I uninstall Starship? + +Starship is just as easy to uninstall as it is to install in the first place. + +1. Remove any lines in your shell config (e.g. `~/.bashrc`) used to initialize Starship. +1. Delete the Starship binary. + +If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. + +If Starship was installed using the `curl | bash` script, the following command will delete the binary: + +```sh +# Locate and delete the starship binary +rm "$(which starship)" +``` diff --git a/docs/de-DE/guide/README.md b/docs/de-DE/guide/README.md index b493c9a9..5f2f4022 100644 --- a/docs/de-DE/guide/README.md +++ b/docs/de-DE/guide/README.md @@ -121,7 +121,7 @@ ### Voraussetzungen -- Eine [Powerline-Schriftart](https://github.com/powerline/fonts) installiert und in deinem Terminal aktiviert (z.B. [Fira Code](https://github.com/tonsky/FiraCode)). +- A [Nerd Font](https://www.nerdfonts.com/) installed and enabled in your terminal (for example, try the [Fira Code Nerd Font](https://www.nerdfonts.com/font-downloads)). ### Erste Schritte @@ -224,7 +224,7 @@ Falls du an Starship mitwirken willst, wirf bitte einen Blick auf den [Leitfaden ### Code Contributors -This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. +This project exists thanks to all the people who contribute. [[Contribute](https://github.com/starship/starship/blob/master/CONTRIBUTING.md)]. ### Financial Contributors diff --git a/docs/es-ES/advanced-config/README.md b/docs/es-ES/advanced-config/README.md index 2f32333a..a3d3eae5 100644 --- a/docs/es-ES/advanced-config/README.md +++ b/docs/es-ES/advanced-config/README.md @@ -57,7 +57,16 @@ En `zsh`, añade esto al array `precmd_functions`: precmd_functions+=(set_win_title) ``` -Si te gusta el resultado, añade estas líneas a tu archivo de configuración del shell (`~/.bashrc` o `~/.zsrhc`) para hacerlo permanente. +If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. + +For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: + +```bash +function set_win_title(){ + echo -ne "\033]0; $(basename $PWD) \007" +} +starship_precmd_user_func="set_win_title" +``` ## Cadenas de estilo diff --git a/docs/es-ES/config/README.md b/docs/es-ES/config/README.md index 4d66fef7..368b8fdf 100644 --- a/docs/es-ES/config/README.md +++ b/docs/es-ES/config/README.md @@ -15,24 +15,26 @@ mkdir -p ~/.config && touch ~/.config/starship.toml Toda la configuración de starship se incluye en este fichero [TOML](https://github.com/toml-lang/toml): ```toml -# Evita imprimir una nueva linea al comiendo del símbolo del sistema +# Don't print a new line at the start of the prompt add_newline = false -# Reemplaza en el símbolo del sistema el carácter "❯" por "➜" -[character] # El nombre del módulo que estamos configurando es "character" -symbol = "➜" # El segmento "symbol" se actualiza por "➜" +# Replace the "❯" symbol in the prompt with "➜" +[character] # The name of the module we are configuring is "character" +success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green" -# Desactiva el gestor de paquetes, ocultándolo del símbolo de sistema por completo +# Disable the package module, hiding it from the prompt completely [package] disabled = true ``` Puedes modificar la ubicación por defecto del fichero `starship.toml` con la variable de entorno `STARSHIP_CONFIG`: + ```sh export STARSHIP_CONFIG=~/.starship ``` El equivalente en PowerShell (Windows) es añadir esta línea a tu `$PROFILE`: + ```ps1 $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` @@ -41,16 +43,39 @@ $ENV:STARSHIP_CONFIG = "$HOME\.starship" **Módulo**: un componente en el símbolo de sistema que provee de información basada en información contextual de tu sistema operativo. Por ejemplo, el módulo "nodejs" muestra la versión de NodeJS que tienes actualmente instalada en tu ordenador, si el directorio actual es un proyecto NodeJS. -**Segmento**: sub-componentes más pequeños que forman un módulo. Por ejemplo, el segmento "symbol" en el módulo "nodejs" contiene el carácter que se muestra antes del número de versión (⬢ por defecto). +**Variable**: Smaller sub-components that contains information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of NodeJS. -A continuación mostramos la representación del módulo "node". En el siguiente ejemplo, "symbol" y "version" son segmentos que lo contienen. Cada módulo tiene además un prefijo y un sufijo que indican el color por defecto en el terminal. +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. -``` -[prefix] [symbol] [version] [suffix] - "via " "⬢" "v10.4.1" "" -``` +### Format Strings -### Dar estilo a cadenas de texto +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. + +#### Variable + +A variable contains a `$` symbol followed by the name of the variable. The name of a variable only contains letters, numbers and `_`. + +For example: + +- `$version` is a format string with a variable named `version`. +- `$git_branch$git_commit` is a format string with two variables named `git_branch` and `git_commit`. +- `$git_branch $git_commit` has the two variables separated with a space. + +#### Text Group + +A text group is made up of two different parts. + +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. + +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used style the first part. + +For example: + +- `[on](red bold)` will print a string `on` with bold text colored red. +- `[⬢ $version](bold green)` will print a symbol `⬢` followed by the content of variable `version`, with bold text colored green. +- `[a [b](red) c](green)` will print `a b c` with `b` red, and `a` and `c` green. + +#### Cadenas de estilo La mayoría de los módulos de starship permiten configurar los estilos de su cadenas texto. Esto se consigue con una entrada (normalmente llamada `style` - estilo) que no es más que un texto donde se especifica la configuración. A continuación mostramos algunos ejemplos de textos estilados junto con su funcionalidad. Para más detalles sobre la sintaxis completa, consulta [la guía de configuración avanzada](/advanced-config/). @@ -63,80 +88,128 @@ La mayoría de los módulos de starship permiten configurar los estilos de su ca Nótese que el estilo es similar a como se controlaría por el emulador de su terminal. Por ejemplo, algunos emuladores de terminal harán los colores más brillantes en lugar de más gruesos, y algunos temas usan los mismos valores para texto normal y colores brillantes. Además, para mostrar textos en cursiva tu terminal debe tener soporte para hacerlo. +#### Conditional Format Strings + +A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. + +For example: + +- `(@$region)` will show nothing if the variable `region` is `None`, otherwise `@` followed by the value of region. +- `(some text)` will always show nothing since there are no variables wrapped in the braces. +- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. + +#### Escapable characters + +The following symbols have special usage in a format string. If you want to print the following symbols, you have to escape them with a backslash (`\`). + +- $ +- \\ +- [ +- ] +- ( +- ) + +Note that `toml` has [its own escape syntax](https://github.com/toml-lang/toml#user-content-string). It is recommended to use a literal string (`''`) in your config. If you want to use a basic string (`""`), pay attention to escape the backslash `\`. + +For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: + +```toml +# with basic string +format = "\n\\$" + +# with multiline basic string +format = """ + +\\$""" + +# with literal string +format = ''' + +\$''' +``` + ## Símbolo del sistema Esta es la lista de opciones de configuración. ### Opciones -| Variable | Por defecto | Descripción | -| -------------- | ----------------------------- | ------------------------------------------------------------------------------- | -| `add_newline` | `true` | Añade una nueva línea antes del símbolo de sistema. | -| `prompt_order` | [link](#default-prompt-order) | Configura el orden en el que se muestran los módulos en el símbolo del sistema. | -| `scan_timeout` | `30` | Tiempo de espera tras el que starship escanea archivos (en milisegundos). | +| Option | Por defecto | Descripción | +| -------------- | ------------------------------ | ------------------------------------------------------------------------- | +| `format` | [link](#default-prompt-format) | Configure the format of the prompt. | +| `scan_timeout` | `30` | Tiempo de espera tras el que starship escanea archivos (en milisegundos). | ### Ejemplo ```toml # ~/.config/starship.toml -# Desactiva el salto de línea al comienzo del símbolo de sistema -add_newline = false -# Sobrescribe el orden por defecto de los módulos -prompt_order=["rust","line_break","package","line_break","character"] -# Starship espera 10 ms para comprobar los archivos del directorio actual. +# Disable the newline at the start of the prompt +format = "$all" + +# Use custom format +format = """ +[┌───────────────────>](bold green) +[│](bold green)$directory$rust$package +[└─>](bold green) """ + +# Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 ``` -### Ordenación por defecto +### Default Prompt Format -El `prompt_order` por defecto se usa para definir el orden en el que los módulos se muestran en la línea de comandos, en caso de que esté vacío o no existe `prompt_order`. El valor por defecto es el siguiente: +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. El valor por defecto es el siguiente: ```toml -prompt_order = [ - "username", - "hostname", - "kubernetes", - "directory", - "git_branch", - "git_commit", - "git_state", - "git_status", - "hg_branch", - "docker_context", - "package", - "dotnet", - "elixir", - "elm", - "erlang", - "golang", - "haskell", - "java", - "julia", - "nim", - "nodejs", - "ocaml", - "php", - "purescript", - "python", - "ruby", - "rust", - "terraform", - "zig", - "nix_shell", - "conda", - "memory_usage", - "aws", - "env_var", - "crystal", - "cmd_duration", - "custom", - "line_break", - "jobs", - "battery", - "time", - "character", -] +format = "\n$all" + +# Which is equivalent to +format = """ + +$username\ +$hostname\ +$kubernetes\ +$directory\ +$git_branch\ +$git_commit\ +$git_state\ +$git_status\ +$hg_branch\ +$docker_context\ +$package\ +$cmake\ +$dotnet\ +$elixir\ +$elm\ +$erlang\ +$golang\ +$helm\ +$java\ +$julia\ +$nim\ +$nodejs\ +$ocaml\ +$php\ +$purescript\ +$python\ +$ruby\ +$rust\ +$terraform\ +$zig\ +$nix_shell\ +$conda\ +$memory_usage\ +$aws\ +$env_var\ +$crystal\ +$cmd_duration\ +$custom\ +$line_break\ +$jobs\ +$battery\ +$time\ +$character""" ``` ## AWS @@ -147,41 +220,80 @@ Cuando uses [aws-vault](https://github.com/99designs/aws-vault) el perfil se obt ### Opciones -| Variable | Por defecto | Descripción | -| ----------------- | --------------- | ------------------------------------------------------------- | -| `symbol` | `"☁️ "` | El símbolo que se muestra antes del perfil de AWS. | -| `displayed_items` | `all` | Elige qué item mostrar. Valores: [`all`, `profile`, `region`] | -| `region_aliases` | | Tabla de alias de región para mostrar además del nombre AWS. | -| `style` | `"bold yellow"` | El estilo del módulo. | -| `disabled` | `false` | Desactiva el módulo AWS. | +| Option | Por defecto | Descripción | +| ---------------- | ---------------------------------------------------- | ------------------------------------------------------------ | +| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | The format for the module. | +| `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. | +| `disabled` | `false` | Desactiva el módulo AWS. | -### Ejemplo +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | ---------------- | ------------------------------------ | +| region | `ap-northeast-1` | The current AWS region | +| profile | `astronauts` | The current AWS profile | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Examples + +#### Display everything ```toml # ~/.config/starship.toml [aws] +format = "on [$symbol$profile(\\($region\\))]($style) " style = "bold blue" symbol = "🅰 " -displayed_items = "region" [aws.region_aliases] ap-southeast-2 = "au" us-east-1 = "va" ``` +#### Display region + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$region]($style) " +style = "bold blue" +symbol = "🅰 " +[aws.region_aliases] +ap-southeast-2 = "au" +us-east-1 = "va" +``` + +#### Display profile + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$profile]($style) " +style = "bold blue" +symbol = "🅰 " +``` + ## Battery El módulo `battery` muestra la cantidad de batería y si está cargando o no. El módulo es solo visible cuando la batería está por debajo del 10%. ### Opciones -| Variable | Por defecto | Descripción | -| -------------------- | ------------------------ | ------------------------------------------------- | -| `full_symbol` | `"•"` | Se muestra cuando la batería está cargada. | -| `charging_symbol` | `"⇡"` | Se muestra cuando la batería está cargando. | -| `discharging_symbol` | `"⇣"` | Se muestra cuando la batería se está descargando. | -| `display` | [link](#battery-display) | Define cuándo mostrar el indicador y el estilo. | -| `disabled` | `false` | Desactiva el módulo `battery`. | +| Option | Por defecto | Descripción | +| -------------------- | --------------------------------- | ------------------------------------------------- | +| `full_symbol` | `"•"` | Se muestra cuando la batería está cargada. | +| `charging_symbol` | `"⇡"` | Se muestra cuando la batería está cargando. | +| `discharging_symbol` | `"⇣"` | Se muestra cuando la batería se está descargando. | +| `format` | `"[$symbol$percentage]($style) "` | The format for the module. | +| `display` | [link](#battery-display) | Define cuándo mostrar el indicador y el estilo. | +| `disabled` | `false` | Desactiva el módulo `battery`. |
Hay otras opciones para algunos estados de la batería menos comunes. @@ -244,31 +356,85 @@ style = "bold yellow" El módulo `character` muestra un carater (normalmente una flecha) tras el texto que introduces en el terminal. -El carácter te dirá si el último comando funcionó o no. Se puede hacer de dos formas: cambiando el color (rojo/verde) o cambiando su forma (❯/✖). Esto último solo se puede hacer si `use_symbol_for_status` tiene como valor `true`. +El carácter te dirá si el último comando funcionó o no. It can do this in two ways: + +- changing color (`red`/`green`) +- changing shape (`❯`/`✖`) + +By default it only changes color. If you also want to change it's shape take a look at [this example](#with-custom-error-shape). ### Opciones -| Variable | Por defecto | Descripción | -| ----------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------- | -| `symbol` | `"❯"` | El símbolo usado antes de la entrada de texto en el símbolo del sistema. | -| `error_symbol` | `"✖"` | El símbolo usado antes de la entrada de texto si el comando anterior falló. | -| `use_symbol_for_status` | `false` | Indica el estado del error usando un símbolo. | -| `vicmd_symbol` | `"❮"` | El símbolo usado antes de la entrada de texto en el símbolo del sistema si el intérprete de comandos está en modo vim normal. | -| `style_success` | `"bold green"` | Estilo usado si el último comando se ejecutó con éxito. | -| `style_failure` | `"bold red"` | Estilo usado si el último comando falló. | -| `disabled` | `false` | Desactiva el módulo `character`. | +| Option | Por defecto | Descripción | +| ---------------- | ------------------- | -------------------------------------------------------------------------------- | +| `format` | `"$symbol "` | The format string used before the text input. | +| `success_symbol` | `"[❯](bold green)"` | The format string used before the text input if the previous command succeeded. | +| `error_symbol` | `"[❯](bold red)"` | The format string used before the text input if the previous command failed. | +| `vicmd_symbol` | `"[❮](bold green)"` | The format string used before the text input if the shell is in vim normal mode. | +| `disabled` | `false` | Desactiva el módulo `character`. | -### Ejemplo +### Variables + +| Variable | Ejemplo | Descripción | +| -------- | ------- | --------------------------------------------------------------------- | +| symbol | | A mirror of either `success_symbol`, `error_symbol` or `vicmd_symbol` | + +### Examples + +#### With custom error shape ```toml # ~/.config/starship.toml [character] -symbol = "➜" -error_symbol = "✗" -use_symbol_for_status = true +success_symbol = "[➜](bold green) " +error_symbol = "[✗](bold red) " ``` +#### Without custom error shape + +```toml +# ~/.config/starship.toml + +[character] +success_symbol = "[➜](bold green) " +error_symbol = "[➜](bold red) " +``` + +#### With custom vim shape + +```toml +# ~/.config/starship.toml + +[character] +vicmd_symbol = "[V](bold green) " +``` + +## CMake + +The `cmake` module shows the currently installed version of CMake if: + +- The current directory contains a `CMakeLists.txt` file + +### Opciones + +| Option | Por defecto | Descripción | +| ---------- | ---------------------------------- | -------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🛆 "` | The symbol used before the version of cmake. | +| `style` | `"bold blue"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `cmake` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | --------- | ------------------------------------ | +| version | `v3.17.3` | The version of cmake | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + ## Tiempo de ejecución El módulo `cmd_duration` muestra cuánto tiempo tardó el último comando en ejecutarse. El módulo se mostrará solo si el comando llevó dos segundos o más, o el valor de `min_time`, si existe. @@ -283,13 +449,22 @@ Los usuarios de bash que necesiten la funcionalidad preexec-like pueden usar el ### Opciones -| Variable | Por defecto | Descripción | -| ------------------- | --------------- | --------------------------------------------------------------------- | -| `min_time` | `2_000` | Duración mínima para mostrar el tiempo de ejecución (en milisegundos) | -| `show_milliseconds` | `false` | Muestra la duración con precisión en milisegundos. | -| `prefix` | `took` | Prefijo que se muestra antes del tiempo de ejecución. | -| `style` | `"bold yellow"` | El estilo del módulo. | -| `disabled` | `false` | Desactiva el módulo `cmd_duration`. | +| Option | Por defecto | Descripción | +| ------------------- | ----------------------------- | --------------------------------------------------------------------- | +| `min_time` | `2_000` | Duración mínima para mostrar el tiempo de ejecución (en milisegundos) | +| `show_milliseconds` | `false` | Muestra la duración con precisión en milisegundos. | +| `format` | `"took [$duration]($style) "` | The format for the module. | +| `style` | `"bold yellow"` | El estilo del módulo. | +| `disabled` | `false` | Desactiva el módulo `cmd_duration`. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | -------- | --------------------------------------- | +| duration | `16m40s` | The time it took to execute the command | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -298,7 +473,7 @@ Los usuarios de bash que necesiten la funcionalidad preexec-like pueden usar el [cmd_duration] min_time = 500 -prefix = "underwent " +format = "underwent [$duration](bold yellow)" ``` ## Conda @@ -313,12 +488,23 @@ Esto no modifica el propio símbolo de sistema de conda. En caso de querer supri ### Opciones -| Variable | Por defecto | Descripción | -| ------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `truncation_length` | `1` | El número de directorios a los que se debe truncar la variable de entorno, si el entorno fue creado usando `conda create -p [path]`. `0` significa sin truncamiento. Mirar también el módulo [`directory`](#directory). | -| `symbol` | `"C "` | El símbolo usado antes del nombre del entorno. | -| `style` | `"bold green"` | El estilo del módulo. | -| `disabled` | `false` | Desactiva el módulo `conda`. | +| Option | Por defecto | Descripción | +| ------------------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `truncation_length` | `1` | El número de directorios a los que se debe truncar la variable de entorno, si el entorno fue creado usando `conda create -p [path]`. `0` significa sin truncamiento. Mirar también el módulo [`directory`](#directory). | +| `symbol` | `"🅒 "` | El símbolo usado antes del nombre del entorno. | +| `style` | `"bold green"` | El estilo del módulo. | +| `format` | `"[$symbol$environment]($style) "` | The format for the module. | +| `disabled` | `false` | Desactiva el módulo `conda`. | + +### Variables + +| Variable | Ejemplo | Descripción | +| ----------- | ------------ | ------------------------------------ | +| environment | `astronauts` | The current conda environment | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -326,7 +512,7 @@ Esto no modifica el propio símbolo de sistema de conda. En caso de querer supri # ~/.config/starship.toml [conda] -style = "dimmed green" +format = "[$symbol$environment](dimmed green) " ``` ## Crystal @@ -338,11 +524,22 @@ El módulo `crystal` muestra la versión actual de Crystal. El módulo se muestr ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | ------------ | --------------------------------------------- | -| `symbol` | `"🔮 "` | Símbolo usado antes de la versión de Crystal. | -| `style` | `"bold red"` | El estilo del módulo. | -| `disabled` | `false` | Desactiva el módulo `crystal`. | +| Option | Por defecto | Descripción | +| ---------- | ---------------------------------- | --------------------------------------------- | +| `symbol` | `"🔮 "` | Símbolo usado antes de la versión de Crystal. | +| `style` | `"bold red"` | El estilo del módulo. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Desactiva el módulo `crystal`. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | --------- | ------------------------------------ | +| version | `v0.32.1` | The version of `crystal` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -350,8 +547,7 @@ El módulo `crystal` muestra la versión actual de Crystal. El módulo se muestr # ~/.config/starship.toml [crystal] -symbol = "✨ " -style = "bold blue" +format = "via [✨ $version](bold blue) " ``` ## Directory @@ -364,18 +560,20 @@ Por ejemplo, dado `~/Dev/Nix/nixpkgs/pkgs` donde `nixpkgs` es la raíz del repos ### Opciones -| Variable | Por defecto | Descripción | -| ------------------- | ------------- | ------------------------------------------------------------------------------ | -| `truncation_length` | `3` | El número de directorios padre a los que se debe truncar el directorio actual. | -| `truncate_to_repo` | `true` | Trunca o no hasta la raíz del repositorio git en el que estés. | -| `prefix` | `"in "` | Prefijo que se muestra inmediatamente antes del directorio. | -| `style` | `"bold cyan"` | El estilo del módulo. | -| `disabled` | `false` | Desactiva el módulo `directory`. | +| Variable | Por defecto | Descripción | +| ------------------------ | ----------------------------------------------- | ------------------------------------------------------------------------------ | +| `truncation_length` | `3` | El número de directorios padre a los que se debe truncar el directorio actual. | +| `truncate_to_repo` | `true` | Trunca o no hasta la raíz del repositorio git en el que estés. | +| `format` | `"[$path]($style)[$lock_symbol]($lock_style) "` | The format for the module. | +| `style` | `"bold cyan"` | El estilo del módulo. | +| `disabled` | `false` | Desactiva el módulo `directory`. | +| `read_only_symbol` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_symbol_style` | `"red"` | The style for the read only symbol. |
Este módulo tiene algunas opciones avanzadas de configuración que controlan cómo se muestra el directorio. -| Variable | Por defecto | Descripción | +| Advanced Option | Por defecto | Descripción | | --------------------------- | ----------- | ---------------------------------------------------------------------------------------- | | `substitutions` | | A table of substitutions to be made to the path. | | `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. | @@ -393,6 +591,15 @@ Por ejemplo, dado `~/Dev/Nix/nixpkgs/pkgs` donde `nixpkgs` es la raíz del repos
+### Variables + +| Variable | Ejemplo | Descripción | +| --------- | --------------------- | ----------------------------------- | +| path | `"D:/Projects"` | The current directory path | +| style\* | `"black bold dimmed"` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + ### Ejemplo ```toml @@ -408,12 +615,23 @@ El módulo `docker_context` muestra el [Docker context](https://docs.docker.com/ ### Opciones -| Variable | Por defecto | Descripción | -| ----------------- | ------------- | -------------------------------------------------------------------------------------------------- | -| `symbol` | `"🐳 "` | Símbolo usado antes de mostrar el Docker context. | -| `only_with_files` | `false` | Solo lo muestra cuando hay un archivo `docker-compose.yml` o `Dockerfile` en el directorio actual. | -| `style` | `"bold blue"` | El estilo del módulo. | -| `disabled` | `true` | Desactiva el módulo `docker_context`. | +| Option | Por defecto | Descripción | +| ----------------- | ---------------------------------- | -------------------------------------------------------------------------------------------------- | +| `format` | `"via [$symbol$context]($style) "` | The format for the module. | +| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context. | +| `style` | `"blue bold"` | El estilo del módulo. | +| `only_with_files` | `false` | Solo lo muestra cuando hay un archivo `docker-compose.yml` o `Dockerfile` en el directorio actual. | +| `disabled` | `true` | Desactiva el módulo `docker_context`. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | -------------- | ------------------------------------ | +| context | `test_context` | The current docker context | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -421,25 +639,51 @@ El módulo `docker_context` muestra el [Docker context](https://docs.docker.com/ # ~/.config/starship.toml [docker_context] -symbol = "🐋 " +format = "via [🐋 $context](blue bold)" ``` ## Dotnet El módulo `dotnet` muestra la versión usada de .NET Core SDK para el directorio actual. Si el SDK ha sido anclado en el directorio actual, se mostrará la versión fijada. De lo contrario, el módulo muestra la última versión instalada del SDK. -This module will only be shown in your prompt when one of the following files are present in the current directory: `global.json`, `project.json`, `*.sln`, `*.csproj`, `*.fsproj`, `*.xproj`. You'll also need the .NET Core command-line tools installed in order to use it correctly. +This module will only be shown in your prompt when one or more of the following files are present in the current directory: + +- `global.json` +- `project.json` +- `Directory.Build.props` +- `Directory.Build.targets` +- `Packages.props` +- `*.sln` +- `*.csproj` +- `*.fsproj` +- `*.xproj` + +You'll also need the .NET Core SDK installed in order to use it correctly. Internally, this module uses its own mechanism for version detection. Typically it is twice as fast as running `dotnet --version`, but it may show an incorrect version if your .NET project has an unusual directory layout. If accuracy is more important than speed, you can disable the mechanism by setting `heuristic = false` in the module options. +The module will also show the Target Framework Moniker () when there is a csproj file in the current directory. + ### Opciones -| Variable | Por defecto | Descripción | -| ----------- | ------------- | ----------------------------------------------------- | -| `symbol` | `"•NET "` | Símbolo usado antes de mostrar la versión de .NET | -| `heuristic` | `true` | Use faster version detection to keep starship snappy. | -| `style` | `"bold blue"` | El estilo del módulo. | -| `disabled` | `false` | Deshabilita el módulo `dotnet`. | +| Option | Por defecto | Descripción | +| ----------- | ---------------------------------------- | ----------------------------------------------------- | +| `format` | `"v[$symbol$version( 🎯 $tfm)]($style) "` | The format for the module. | +| `symbol` | `"•NET "` | Símbolo usado antes de mostrar la versión de .NET | +| `heuristic` | `true` | Use faster version detection to keep starship snappy. | +| `style` | `"bold blue"` | El estilo del módulo. | +| `disabled` | `false` | Deshabilita el módulo `dotnet`. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | ---------------- | ------------------------------------------------------------------ | +| version | `v3.1.201` | The version of `dotnet` sdk | +| tfm | `netstandard2.0` | The Target Framework Moniker that the current project is targeting | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -460,11 +704,23 @@ The `elixir` module shows the currently installed version of Elixir and Erlang/O ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | --------------- | --------------------------------------------------------------- | -| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. | -| `style` | `"bold purple"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `elixir` module. | +| Option | Por defecto | Descripción | +| ---------- | ------------------------------------------------------------- | --------------------------------------------------------------- | +| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. | +| `style` | `"bold purple"` | El estilo del módulo. | +| `format` | `"via [$symbol$version \\(OTP $otp_version\\)]($style) "` | The format for the module elixir. | +| `disabled` | `false` | Disables the `elixir` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| ----------- | ------- | ------------------------------------ | +| version | `v1.10` | The version of `elixir` | +| otp_version | | The otp version of `elixir` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -487,12 +743,22 @@ The `elm` module shows the currently installed version of Elm. El módulo se mue ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | ------------- | ----------------------------------------------------- | -| `symbol` | `"🌳 "` | The symbol used before displaying the version of Elm. | -| `style` | `"bold cyan"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `elm` module. | +| Option | Por defecto | Descripción | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🌳 "` | A format string representing the symbol of Elm. | +| `style` | `"cyan bold"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `elm` module. | +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | --------- | ------------------------------------ | +| version | `v0.19.1` | The version of `elm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -500,7 +766,7 @@ The `elm` module shows the currently installed version of Elm. El módulo se mue # ~/.config/starship.toml [elm] -symbol = " " +format = "via [ $version](cyan bold) " ``` ## Variable de entorno @@ -512,15 +778,23 @@ The `env_var` module displays the current value of a selected environment variab ### Opciones -| Variable | Por defecto | Descripción | -| ------------- | --------------------- | ---------------------------------------------------------------------------- | -| `symbol` | | The symbol used before displaying the variable value. | -| `variable` | | The environment variable to be displayed. | -| `por defecto` | | The default value to be displayed when the selected variable is not defined. | -| `prefix` | `""` | Prefix to display immediately before the variable value. | -| `suffix` | `""` | Suffix to display immediately after the variable value. | -| `style` | `"dimmed bold black"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `env_var` module. | +| Option | Por defecto | Descripción | +| ------------- | ------------------------------ | ---------------------------------------------------------------------------- | +| `symbol` | | The symbol used before displaying the variable value. | +| `variable` | | The environment variable to be displayed. | +| `por defecto` | | The default value to be displayed when the selected variable is not defined. | +| `format` | `"with [$env_value]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `env_var` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | ------------------------------------------- | ------------------------------------------ | +| env_value | `Windows NT` (if *variable* would be `$OS`) | The environment value of option `variable` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | `black bold dimmed` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -541,11 +815,22 @@ The `erlang` module shows the currently installed version of Erlang/OTP. El mód ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | ----------- | -------------------------------------------------------- | -| `symbol` | `"🖧 "` | The symbol used before displaying the version of Erlang. | -| `style` | `bold red` | The style for this module. | -| `disabled` | `false` | Disables the `erlang` module. | +| Option | Por defecto | Descripción | +| ---------- | ---------------------------------- | -------------------------------------------------------- | +| `symbol` | `"🖧 "` | The symbol used before displaying the version of erlang. | +| `style` | `"bold red"` | El estilo del módulo. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `erlang` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | --------- | ------------------------------------ | +| version | `v22.1.3` | The version of `erlang` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -553,7 +838,7 @@ The `erlang` module shows the currently installed version of Erlang/OTP. El mód # ~/.config/starship.toml [erlang] -symbol = "e " +format = "via [e $version](bold red) " ``` ## Git Branch @@ -562,13 +847,24 @@ The `git_branch` module shows the active branch of the repo in your current dire ### Opciones -| Variable | Por defecto | Descripción | -| ------------------- | --------------- | ------------------------------------------------------------------------------------- | -| `symbol` | `" "` | The symbol used before the branch name of the repo in your current directory. | -| `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes | -| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. You can use "" for no symbol | -| `style` | `"bold purple"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `git_branch` module. | +| Option | Por defecto | Descripción | +| ------------------- | -------------------------------- | ---------------------------------------------------------------------------------------- | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. Use `"$branch"` to refer to the current branch name. | +| `symbol` | `" "` | A format string representing the symbol of git branch. | +| `style` | `"bold purple"` | El estilo del módulo. | +| `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes. | +| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. You can use `""` for no symbol. | +| `disabled` | `false` | Disables the `git_branch` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| branch | `master` | The current branch name, falls back to `HEAD` if there's no current branch (e.g. git detached HEAD). | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -587,14 +883,22 @@ The `git_commit` module shows the current commit hash of the repo in your curren ### Opciones -| Variable | Por defecto | Descripción | -| -------------------- | -------------- | ----------------------------------------------------- | -| `commit_hash_length` | `7` | The length of the displayed git commit hash. | -| `prefix` | `"("` | Prefix to display immediately before git commit. | -| `suffix` | `")"` | Suffix to display immediately after git commit. | -| `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. | +| Option | Por defecto | Descripción | +| -------------------- | ------------------------------ | ----------------------------------------------------- | +| `commit_hash_length` | `7` | The length of the displayed git commit hash. | +| `format` | `"[\\($hash\\)]($style) "` | The format for the module. | +| `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. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | --------- | ----------------------------------- | +| hash | `b703eb3` | The current git commit hash | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -611,18 +915,29 @@ The `git_state` module will show in directories which are part of a git reposito ### Opciones -| Variable | Por defecto | Descripción | -| ------------------ | ------------------ | ---------------------------------------------------------------------------------------------------------------- | -| `rebase` | `"REBASING"` | The text displayed when a `rebase` is in progress. | -| `merge` | `"MERGING"` | The text displayed when a `merge` is in progress. | -| `revert` | `"REVERTING"` | The text displayed when a `revert` is in progress. | -| `cherry_pick` | `"CHERRY-PICKING"` | The text displayed when a `cherry-pick` is in progress. | -| `bisect` | `"BISECTING"` | The text displayed when a `bisect` is in progress. | -| `am` | `"AM"` | The text displayed when an `apply-mailbox` (`git am`) is in progress. | -| `am_or_rebase` | `"AM/REBASE"` | The text displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. | -| `progress_divider` | `"/"` | The symbol or text which will separate the current and total progress amounts. (e.g., `" of "`, for `"3 of 10"`) | -| `style` | `"bold yellow"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `git_state` module. | +| Option | 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. | +| `cherry_pick` | `"CHERRY-PICKING"` | A format string displayed when a `cherry-pick` is in progress. | +| `bisect` | `"BISECTING"` | A format string displayed when a `bisect` is in progress. | +| `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) "` | The format for the module. | +| `disabled` | `false` | Disables the `git_state` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| ---------------- | ---------- | ----------------------------------- | +| state | `REBASING` | The current state of the repo | +| progress_current | `1` | The current operation progress | +| progress_total | `2` | The total operation progress | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -630,8 +945,8 @@ The `git_state` module will show in directories which are part of a git reposito # ~/.config/starship.toml [git_state] -progress_divider = " of " -cherry_pick = "🍒 PICKING" +format = "[\\($state( $progress_current of $progress_total)\\)]($style) " +cherry_pick = "[🍒 PICKING](bold red)" ``` ## Git status @@ -640,37 +955,54 @@ The `git_status` module shows symbols representing the state of the repo in your ### Opciones -| Variable | Por defecto | Descripción | -| ------------------ | -------------------------- | ------------------------------------------------------- | -| `conflicted` | `"="` | This branch has merge conflicts. | -| `conflicted_count` | [link](#git-status-counts) | Show and style the number of conflicts. | -| `ahead` | `"⇡"` | This branch is ahead of the branch being tracked. | -| `behind` | `"⇣"` | This branch is behind of the branch being tracked. | -| `diverged` | `"⇕"` | This branch has diverged from the branch being tracked. | -| `untracked` | `"?"` | There are untracked files in the working directory. | -| `untracked_count` | [link](#git-status-counts) | Show and style the number of untracked files. | -| `stashed` | `"$"` | A stash exists for the local repository. | -| `stashed_count` | [link](#git-status-counts) | Show and style the number of stashes. | -| `modified` | `"!"` | There are file modifications in the working directory. | -| `modified_count` | [link](#git-status-counts) | Show and style the number of modified files. | -| `staged` | `"+"` | A new file has been added to the staging area. | -| `staged_count` | [link](#git-status-counts) | Show and style the number of files staged files. | -| `renamed` | `"»"` | A renamed file has been added to the staging area. | -| `renamed_count` | [link](#git-status-counts) | Show and style the number of renamed files. | -| `deleted` | `"✘"` | A file's deletion has been added to the staging area. | -| `deleted_count` | [link](#git-status-counts) | Show and style the number of deleted files. | -| `show_sync_count` | `false` | Show ahead/behind count of the branch being tracked. | -| `prefix` | `[` | Prefix to display immediately before git status. | -| `suffix` | `]` | Suffix to display immediately after git status. | -| `style` | `"bold red"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `git_status` module. | +| Option | Por defecto | Descripción | +| ----------------- | ----------------------------------------------- | ---------------------------------------------------- | +| `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` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `show_sync_count` | `false` | Show ahead/behind count of the branch being tracked. | +| `style` | `"bold red"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `git_status` module. | -#### Contadores de git status +### Variables -| Variable | Por defecto | Descripción | -| --------- | ----------- | ------------------------------------------------------ | -| `enabled` | `false` | Show the number of files | -| `style` | | Optionally style the count differently than the module | +The following variables can be used in `format`: + +| Variable | Descripción | +| -------------- | --------------------------------------------------------------------------------------------- | +| `all_status` | Shortcut for`$conflicted$stashed$deleted$renamed$modified$staged$untracked` | +| `ahead_behind` | Displays `diverged` `ahead` or `behind` format string based on the current status of the repo | +| `conflicted` | Displays `conflicted` when this branch has merge conflicts. | +| `untracked` | Displays `untracked` when there are untracked files in the working directory. | +| `stashed` | Displays `stashed` when a stash exists for the local repository. | +| `modified` | Displays `modified` when there are file modifications in the working directory. | +| `staged` | Displays `staged` when a new file has been added to the staging area. | +| `renamed` | Displays `renamed` when a renamed file has been added to the staging area. | +| `deleted` | Displays `deleted` when a file's deletion has been added to the staging area. | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +The following variables can be used in `diverged`: + +| Variable | Descripción | +| -------------- | ---------------------------------------------- | +| `ahead_count` | Number of commits ahead of the tracking branch | +| `behind_count` | Number of commits behind the tracking branch | + +The following variables can be used in `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` and `deleted`: + +| Variable | Descripción | +| -------- | ------------------------ | +| `count` | Show the number of files | ### Ejemplo @@ -685,10 +1017,7 @@ diverged = "😵" untracked = "🤷‍" stashed = "📦" modified = "📝" -staged.value = "++" -staged.style = "green" -staged_count.enabled = true -staged_count.style = "green" +staged = '[++\($count\)](green)' renamed = "👅" deleted = "🗑" ``` @@ -708,11 +1037,22 @@ The `golang` module shows the currently installed version of Golang. El módulo ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | ------------- | -------------------------------------------------------- | -| `symbol` | `"🐹 "` | The symbol used before displaying the version of Golang. | -| `style` | `"bold cyan"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `golang` module. | +| Option | Por defecto | Descripción | +| ---------- | ---------------------------------- | ---------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐹 "` | A format string representing the symbol of Go. | +| `style` | `"bold cyan"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `golang` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | --------- | ------------------------------------ | +| version | `v1.12.1` | The version of `go` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -720,30 +1060,42 @@ The `golang` module shows the currently installed version of Golang. El módulo # ~/.config/starship.toml [golang] -symbol = "🏎💨 " +format = "via [🏎💨 $version](bold cyan) " ``` -## Haskell -The `haskell` module shows the currently installed version of Haskell Stack version. El módulo se muestra si algunas de las siguientes condiciones se cumplen: +## Helm -- El directorio actual contiene un fichero `stack.yaml` +The `helm` module shows the currently installed version of Helm. El módulo se muestra si algunas de las siguientes condiciones se cumplen: + +- El directorio actual contiene un fichero `helmfile.yaml` +- The current directory contains a `Chart.yaml` file ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | ------------ | --------------------------------------------------------- | -| `symbol` | `"λ "` | The symbol used before displaying the version of Haskell. | -| `style` | `"bold red"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `haskell` module. | +| Option | Por defecto | Descripción | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⎈ "` | A format string representing the symbol of Helm. | +| `style` | `"bold white"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `helm` module. | +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | -------- | ------------------------------------ | +| version | `v3.1.1` | The version of `helm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo ```toml # ~/.config/starship.toml -[haskell] -symbol = " " +[helm] +format = "via [⎈ $version](bold white) " ``` ## Hostname @@ -752,14 +1104,23 @@ The `hostname` module shows the system hostname. ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | -| `ssh_only` | `true` | Only show hostname when connected to an SSH session. | -| `prefix` | `""` | Prefix to display immediately before the hostname. | -| `suffix` | `""` | Suffix to display immediately after the hostname. | -| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation | -| `style` | `"bold dimmed green"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `hostname` module. | +| Option | Por defecto | Descripción | +| ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `ssh_only` | `true` | Only show hostname when connected to an SSH session. | +| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation | +| `format` | `"on [$hostname]($style) "` | The format for the module. | +| `style` | `"bold dimmed green"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `hostname` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | ------- | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -768,8 +1129,7 @@ The `hostname` module shows the system hostname. [hostname] ssh_only = false -prefix = "⟪" -suffix = "⟫" +format = "on [$hostname](bold red) " trim_at = ".companyname.com" disabled = false ``` @@ -783,11 +1143,22 @@ The `java` module shows the currently installed version of Java. El módulo se m ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | -------------- | ------------------------------------------------------ | -| `symbol` | `"☕ "` | The symbol used before displaying the version of Java. | -| `style` | `"dimmed red"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `java` module. | +| Option | Por defecto | Descripción | +| ---------- | -------------------------------------- | ----------------------------------------------- | +| `format` | `"via [${symbol}${version}]($style) "` | The format for the module. | +| `symbol` | `"☕ "` | A format string representing the symbol of Java | +| `style` | `"red dimmed"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `java` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | ------- | ------------------------------------ | +| version | `v14` | The version of `java` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -804,12 +1175,23 @@ The `jobs` module shows the current number of jobs running. The module will be s ### Opciones -| Variable | Por defecto | Descripción | -| ----------- | ------------- | ----------------------------------------------------- | -| `symbol` | `"✦"` | The symbol used before displaying the number of jobs. | -| `threshold` | `1` | Show number of jobs if exceeded. | -| `style` | `"bold blue"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `jobs` module. | +| Option | Por defecto | Descripción | +| ----------- | ----------------------------- | ------------------------------------------------ | +| `threshold` | `1` | Show number of jobs if exceeded. | +| `format` | `"[$symbol$number]($style) "` | The format for the module. | +| `symbol` | `"✦"` | A format string representing the number of jobs. | +| `style` | `"bold blue"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `jobs` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | ------- | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -831,11 +1213,22 @@ The `julia` module shows the currently installed version of Julia. El módulo se ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | --------------- | ------------------------------------------------------- | -| `symbol` | `"ஃ "` | The symbol used before displaying the version of Julia. | -| `style` | `"bold purple"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `julia` module. | +| Option | Por defecto | Descripción | +| ---------- | ---------------------------------- | ------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"ஃ "` | A format string representing the symbol of Julia. | +| `style` | `"bold purple"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `julia` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | -------- | ------------------------------------ | +| version | `v1.4.0` | The version of `julia` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -845,6 +1238,7 @@ The `julia` module shows the currently installed version of Julia. El módulo se [julia] symbol = "∴ " ``` + ## Kubernetes Displays the current Kubernetes context name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`. @@ -857,12 +1251,25 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ### Opciones -| Variable | Por defecto | Descripción | -| ----------------- | ------------- | --------------------------------------------------- | -| `symbol` | `"☸ "` | The symbol used before displaying the Cluster info. | -| `context_aliases` | | Table of context aliases to display | -| `style` | `"bold blue"` | El estilo del módulo. | -| `disabled` | `true` | Disables the `kubernetes` module | +| Option | Por defecto | Descripción | +| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- | +| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. | +| `format` | `"on [$symbol$context( \\($namespace\\))]($style) "` | The format for the module. | +| `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. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | -------------------- | ---------------------------------------- | +| context | `starship-cluster` | The current kubernetes context | +| namespace | `starship-namespace` | If set, the current kubernetes namespace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -870,8 +1277,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y # ~/.config/starship.toml [kubernetes] -symbol = "⛵ " -style = "dimmed green" +format = "on [⛵ $context \\($namespace\\)](dimmed green) " disabled = false [kubernetes.context_aliases] "dev.local.cluster.k8s" = "dev" @@ -883,7 +1289,7 @@ The `line_break` module separates the prompt into two lines. ### Opciones -| Variable | Por defecto | Descripción | +| Option | Por defecto | Descripción | | ---------- | ----------- | ------------------------------------------------------------------ | | `disabled` | `false` | Disables the `line_break` module, making the prompt a single line. | @@ -910,15 +1316,26 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ### Opciones -| Variable | Por defecto | Descripción | -| ----------------- | --------------------- | ------------------------------------------------------------- | -| `show_percentage` | `false` | Display memory usage as a percentage of the available memory. | -| `show_swap` | `true` | Display swap usage if total swap is non-zero. | -| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. | -| `symbol` | `"🐏 "` | The symbol used before displaying the memory usage. | -| `separator` | `" | "` | The symbol or text that will seperate the ram and swap usage. | -| `style` | `"bold dimmed white"` | El estilo del módulo. | -| `disabled` | `true` | Disables the `memory_usage` module. | +| Option | Por defecto | Descripción | +| ----------- | --------------------------------------------- | -------------------------------------------------------- | +| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. | +| `format` | `"via $symbol [${ram}( | ${swap})]($style) "` | The format for the module. | +| `symbol` | `"🐏"` | The symbol used before displaying the memory usage. | +| `style` | `"bold dimmed white"` | El estilo del módulo. | +| `disabled` | `true` | Disables the `memory_usage` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| ------------- | ------------- | ------------------------------------------------------------------ | +| ram | `31GiB/65GiB` | The usage/total RAM of the current system memory. | +| ram_pct | `48%` | The percentage of the current system memory. | +| swap\** | `1GiB/4GiB` | The swap memory size of the current system swap memory file. | +| swap_pct\** | `77%` | The swap memory percentage of the current system swap memory file. | +| symbol | `🐏` | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string \*\*: The SWAP file information is only displayed if detected on the current system ### Ejemplo @@ -941,13 +1358,24 @@ The `hg_branch` module shows the active branch of the repo in your current direc ### Opciones -| Variable | Por defecto | Descripción | -| ------------------- | --------------- | -------------------------------------------------------------------------------------------- | -| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. | -| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes | -| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. | -| `style` | `"bold purple"` | El estilo del módulo. | -| `disabled` | `true` | Disables the `hg_branch` module. | +| Option | Por defecto | Descripción | +| ------------------- | -------------------------------- | -------------------------------------------------------------------------------------------- | +| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. | +| `style` | `"bold purple"` | El estilo del módulo. | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. | +| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes | +| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. | +| `disabled` | `true` | Disables the `hg_branch` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | -------- | ------------------------------------ | +| branch | `master` | The active mercurial branch | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -955,7 +1383,7 @@ The `hg_branch` module shows the active branch of the repo in your current direc # ~/.config/starship.toml [hg_branch] -symbol = "🌱 " +format = "on [🌱 $branch](bold purple)" truncation_length = 4 truncation_symbol = "" ``` @@ -963,18 +1391,30 @@ truncation_symbol = "" ## Nim The `nim` module shows the currently installed version of Nim. El módulo se muestra si algunas de las siguientes condiciones se cumplen: -- The current directory contains a `nim.cfg` file + +- El directorio actual contiene un fichero `nim.cfg` - The current directory contains a file with the `.nim` extension - The current directory contains a file with the `.nims` extension - The current directory contains a file with the `.nimble` extension ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | -| `style` | `"bold yellow"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `nim` module. | +| Option | Por defecto | Descripción | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module | +| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | +| `style` | `"bold yellow"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `nim` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | -------- | ------------------------------------ | +| version | `v1.2.0` | The version of `nimc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -992,14 +1432,25 @@ The `nix_shell` module shows the nix-shell environment. The module will be shown ### Opciones -| Variable | Por defecto | Descripción | -| ------------ | ------------- | ------------------------------------------------- | -| `use_name` | `false` | Display the name of the nix-shell. | -| `impure_msg` | `"impure"` | Customize the "impure" msg. | -| `pure_msg` | `"pure"` | Customize the "pure" msg. | -| `symbol` | `"❄️ "` | The symbol used before displaying the shell name. | -| `style` | `"bold blue"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `nix_shell` module. | +| Option | Por defecto | Descripción | +| ------------ | -------------------------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$state( \\($name\\))]($style) "` | The format for the module. | +| `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. | +| `pure_msg` | `"pure"` | A format string shown when the shell is pure. | +| `disabled` | `false` | Disables the `nix_shell` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | ------- | ------------------------------------ | +| state | `pure` | The state of the nix-shell | +| name | `lorri` | The name of the nix-shell | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -1008,28 +1459,39 @@ The `nix_shell` module shows the nix-shell environment. The module will be shown [nix_shell] disabled = true -use_name = true -impure_msg = "impure shell" -pure_msg = "pure shell" -symbol = "☃️ " +impure_msg = "[impure shell](bold red)" +pure_msg = "[pure shell](bold green)" +format = "via [☃️ $state( \\($name\\))](bold blue) " ``` ## NodeJS The `nodejs` module shows the currently installed version of NodeJS. El módulo se muestra si algunas de las siguientes condiciones se cumplen: -- The current directory contains a `package.json` file +- El directorio actual contiene un fichero `package.json` - The current directory contains a `.node-version` file - The current directory contains a `node_modules` directory -- The current directory contains a file with the `.js` extension +- The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension +- The current directory contains a file with the `.ts` extension ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | -------------- | -------------------------------------------------------- | -| `symbol` | `"⬢ "` | The symbol used before displaying the version of NodeJS. | -| `style` | `"bold green"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `nodejs` module. | +| Option | Por defecto | Descripción | +| ---------- | ---------------------------------- | -------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⬢ "` | A format string representing the symbol of NodeJS. | +| `style` | `"bold green"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `nodejs` module. | + +###  Variables + +| Variable | Ejemplo | Descripción | +| --------- | ---------- | ------------------------------------ | +| version | `v13.12.0` | The version of `node` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -1037,7 +1499,7 @@ The `nodejs` module shows the currently installed version of NodeJS. El módulo # ~/.config/starship.toml [nodejs] -symbol = "🤖 " +format = "via [🤖 $version](bold green) " ``` ## Versión del paquete @@ -1056,12 +1518,23 @@ The `package` module is shown when the current directory is the repository for a ### Opciones -| Variable | Por defecto | Descripción | -| ----------------- | ------------ | ---------------------------------------------------------- | -| `symbol` | `"📦 "` | The symbol used before displaying the version the package. | -| `style` | `"bold 208"` | El estilo del módulo. | -| `display_private` | `false` | Enable displaying version for packages marked as private. | -| `disabled` | `false` | Disables the `package` module. | +| Option | Por defecto | Descripción | +| ----------------- | ---------------------------------- | ---------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"📦 "` | The symbol used before displaying the version the package. | +| `style` | `"bold 208"` | El estilo del módulo. | +| `display_private` | `false` | Enable displaying version for packages marked as private. | +| `disabled` | `false` | Disables the `package` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | -------- | ------------------------------------ | +| version | `v1.0.0` | The version of your package | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -1069,7 +1542,7 @@ The `package` module is shown when the current directory is the repository for a # ~/.config/starship.toml [package] -symbol = "🎁 " +format = "via [🎁 $version](208 bold) " ``` ## OCaml @@ -1085,11 +1558,22 @@ The `ocaml` module shows the currently installed version of OCaml. El módulo se ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | --------------- | ------------------------------------------------------- | -| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | -| `style` | `"bold yellow"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `ocaml` module. | +| Option | Por defecto | Descripción | +| ---------- | ---------------------------------- | ------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format string for the module. | +| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | +| `style` | `"bold yellow"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `ocaml` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | --------- | ------------------------------------ | +| version | `v4.10.0` | The version of `ocaml` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -1097,24 +1581,35 @@ The `ocaml` module shows the currently installed version of OCaml. El módulo se # ~/.config/starship.toml [ocaml] -symbol = "🐪 " +format = "via [🐪 $version]($style) " ``` ## PHP The `php` module shows the currently installed version of PHP. El módulo se muestra si algunas de las siguientes condiciones se cumplen: -- The current directory contains a `composer.json` file +- El directorio actual contiene un fichero `composer.json` - The current directory contains a `.php-version` file - The current directory contains a `.php` file ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | ------------ | ----------------------------------------------------- | -| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. | -| `style` | `"bold 147"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `php` module. | +| Option | Por defecto | Descripción | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. | +| `style` | `"147 bold"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `php` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | -------- | ------------------------------------ | +| version | `v7.3.8` | The version of `php` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -1122,7 +1617,7 @@ The `php` module shows the currently installed version of PHP. El módulo se mue # ~/.config/starship.toml [php] -symbol = "🔹 " +format = "via [🔹 $version](147 bold) " ``` ## Python @@ -1145,14 +1640,23 @@ El módulo se muestra si algunas de las siguientes condiciones se cumplen: ### Opciones -| Variable | Por defecto | Descripción | -| -------------------- | --------------- | --------------------------------------------------------------------------- | -| `symbol` | `"🐍 "` | The symbol used before displaying the version of Python. | -| `pyenv_version_name` | `false` | Use pyenv to get Python version | -| `pyenv_prefix` | `"pyenv "` | Prefix before pyenv version display (default display is `pyenv MY_VERSION`) | -| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | -| `style` | `"bold yellow"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `python` module. | +| Option | Por defecto | Descripción | +| -------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${version}( \\($virtualenv\\))]($style) "` | The format for the module. | +| `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 | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `disabled` | `false` | Disables the `python` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| ---------- | --------------- | ------------------------------------ | +| version | `"v3.8.1"` | The version of `python` | +| symbol | `"🐍 "` | Mirrors the value of option `symbol` | +| style | `"yellow bold"` | Mirrors the value of option `style` | +| virtualenv | `"venv"` | The current `virtualenv` name |
This module has some advanced configuration options. @@ -1193,11 +1697,22 @@ The `ruby` module shows the currently installed version of Ruby. El módulo se m ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | ------------ | ------------------------------------------------------ | -| `symbol` | `"💎 "` | The symbol used before displaying the version of Ruby. | -| `style` | `"bold red"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `ruby` module. | +| Option | Por defecto | Descripción | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"💎 "` | A format string representing the symbol of Ruby. | +| `style` | `"bold red"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `ruby` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | -------- | ------------------------------------ | +| version | `v2.5.1` | The version of `ruby` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -1217,11 +1732,22 @@ The `rust` module shows the currently installed version of Rust. El módulo se m ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | ------------ | ------------------------------------------------------ | -| `symbol` | `"🦀 "` | The symbol used before displaying the version of Rust. | -| `style` | `"bold red"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `rust` module. | +| Option | Por defecto | Descripción | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🦀 "` | A format string representing the symbol of Rust | +| `style` | `"bold red"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `rust` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | ----------------- | ------------------------------------ | +| version | `v1.43.0-nightly` | The version of `rustc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -1229,7 +1755,7 @@ The `rust` module shows the currently installed version of Rust. El módulo se m # ~/.config/starship.toml [rust] -symbol = "⚙️ " +format = "via [⚙️ $version](red bold)" ``` ## Singularity @@ -1238,14 +1764,22 @@ The `singularity` module shows the current singularity image, if inside a contai ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | -------------------- | ------------------------------------------------ | -| `label` | `""` | Prefix before the image name display. | -| `prefix` | `"["` | Prefix to display immediately before image name. | -| `suffix` | `"]"` | Suffix to display immediately after image name. | -| `symbol` | `""` | The symbol used before the image name. | -| `style` | `"bold dimmed blue"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `singularity` module. | +| Option | Por defecto | Descripción | +| ---------- | ------------------------------------ | ------------------------------------------------ | +| `format` | `"[$symbol\\[$env\\]]($style) "` | The format for the module. | +| `symbol` | `""` | A format string displayed before the image name. | +| `style` | `"bold dimmed blue"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `singularity` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | ------------ | ------------------------------------ | +| env | `centos.img` | The current singularity image | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -1253,32 +1787,54 @@ The `singularity` module shows the current singularity image, if inside a contai # ~/.config/starship.toml [singularity] -symbol = "📦 " +format = "[📦 \\[$env\\]]($style) " ``` ## Terraform -The `terraform` module shows the currently selected terraform workspace and version. By default the terraform version is not shown, since this is slow on current versions of terraform when a lot of plugins are in use. El módulo se muestra si algunas de las siguientes condiciones se cumplen: +The `terraform` module shows the currently selected terraform workspace and version. By default the terraform version is not shown, since this is slow on current versions of terraform when a lot of plugins are in use. If you still want to enable it, [follow the example shown below](#with-version). El módulo se muestra si algunas de las siguientes condiciones se cumplen: - The current directory contains a `.terraform` folder - Current directory contains a file with the `.tf` extension ### Opciones -| Variable | Por defecto | Descripción | -| -------------- | ------------ | ----------------------------------------------------------- | -| `symbol` | `"💠 "` | The symbol used before displaying the terraform workspace. | -| `show_version` | `false` | Shows the terraform version. Very slow on large workspaces. | -| `style` | `"bold 105"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `terraform` module. | +| Option | Por defecto | Descripción | +| ---------- | ------------------------------------ | ----------------------------------------------------- | +| `format` | `"via [$symbol$workspace]($style) "` | The format string for the module. | +| `symbol` | `"💠 "` | A format string shown before the terraform workspace. | +| `style` | `"bold 105"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `terraform` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | ------------- | ------------------------------------ | +| version | `v0.12.24` | The version of `terraform` | +| workspace | `por defecto` | The current terraform workspace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo +#### With Version + ```toml # ~/.config/starship.toml [terraform] -symbol = "🏎💨 " +format = "[🏎💨 $version$workspace]($style) " +``` + +#### Without version + +```toml +# ~/.config/starship.toml + +[terraform] +format = "[🏎💨 $workspace]($style) " ``` ## Hora @@ -1293,16 +1849,26 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ### Opciones -| Variable | Por defecto | Descripción | -| ----------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------- | -| `use_12hr` | `false` | Activa el formato de 12 horas. | -| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. | -| `style` | `"bold yellow"` | El estilo del módulo de la hora. | -| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. | -| `disabled` | `true` | Disables the `time` module. | -| `time_range` | `"-"` | Establece el intervalo de tiempo durante el cual el módulo se mostrará. La hora debe ser especificada en formato de 24 horas | +| Option | Por defecto | Descripción | +| ----------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `format` | `"at [$time]($style) "` | The format string for the module. | +| `use_12hr` | `false` | Activa el formato de 12 horas | +| `time_format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. | +| `style` | `"bold yellow"` | El estilo del módulo de la hora | +| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. | +| `disabled` | `true` | Disables the `time` module. | +| `time_range` | `"-"` | Establece el intervalo de tiempo durante el cual el módulo se mostrará. La hora debe ser especificada en formato de 24 horas | -If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | ---------- | ----------------------------------- | +| hora | `13:08:10` | The current time. | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -1311,7 +1877,8 @@ If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it default [time] disabled = false -format = "🕙[ %T ]" +format = "🕙[\\[ $time \\]]($style) " +time_format = "%T" utc_time_offset = "-5" time_range = "10:00:00-14:00:00" ``` @@ -1327,12 +1894,20 @@ The `username` module shows active user's username. El módulo se muestra si alg ### Opciones -| Variable | Por defecto | Descripción | -| ------------- | --------------- | ------------------------------------- | -| `style_root` | `"bold red"` | The style used when the user is root. | -| `style_user` | `"bold yellow"` | The style used for non-root users. | -| `show_always` | `false` | Always shows the `username` module. | -| `disabled` | `false` | Disables the `username` module. | +| Option | Por defecto | Descripción | +| ------------- | ------------------------ | ------------------------------------- | +| `style_root` | `"bold red"` | The style used when the user is root. | +| `style_user` | `"bold yellow"` | The style used for non-root users. | +| `format` | `"via [$user]($style) "` | The format for the module. | +| `show_always` | `false` | Always shows the `username` module. | +| `disabled` | `false` | Disables the `username` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| -------- | ------------ | ------------------------------------------------------------------------------------------- | +| `style` | `"red bold"` | Mirrors the value of option `style_root` when root is logged in and `style_user` otherwise. | +| `user` | `"matchai"` | The currently logged-in user ID. | ### Ejemplo @@ -1340,10 +1915,13 @@ The `username` module shows active user's username. El módulo se muestra si alg # ~/.config/starship.toml [username] -disabled = true +style_user = "white bold" +style_root = "black bold" +format = "user: [$user]($style) " +disabled = false +show_always = true ``` - ## Zig The `zig` module shows the currently installed version of Zig. El módulo se muestra si algunas de las siguientes condiciones se cumplen: @@ -1352,11 +1930,22 @@ The `zig` module shows the currently installed version of Zig. El módulo se mue ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | -| `style` | `"bold yellow"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `zig` module. | +| Option | Por defecto | Descripción | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | +| `style` | `"bold yellow"` | El estilo del módulo. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `zig` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | -------- | ------------------------------------ | +| version | `v0.6.0` | The version of `zig` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -1372,6 +1961,7 @@ symbol = "⚡️ " The `custom` modules show the output of some arbitrary commands. These modules will be shown if any of the following conditions are met: + - The current directory contains a file whose name is in `files` - The current directory contains a directory whose name is in `directories` - The current directory contains a file whose extension is in `extensions` @@ -1391,24 +1981,34 @@ The order in which custom modules are shown can be individually set by setting ` ### Opciones -| Variable | Por defecto | Descripción | -| ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. | -| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | -| `shell` | | [See below](#custom-command-shell) | -| `descripción` | `""` | The description of the module that is shown when running `starship explain`. | -| `files` | `[]` | The files that will be searched in the working directory for a match. | -| `directories` | `[]` | The directories that will be searched in the working directory for a match. | -| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | -| `symbol` | `""` | The symbol used before displaying the command output. | -| `style` | `"bold green"` | El estilo del módulo. | -| `prefix` | `""` | Prefix to display immediately before the command output. | -| `suffix` | `""` | Suffix to display immediately after the command output. | -| `disabled` | `false` | Disables this `custom` module. | +| Option | Por defecto | Descripción | +| ------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `command` | | The command whose output should be printed. | +| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | +| `shell` | | [See below](#custom-command-shell) | +| `descripción` | `""` | The description of the module that is shown when running `starship explain`. | +| `files` | `[]` | The files that will be searched in the working directory for a match. | +| `directories` | `[]` | The directories that will be searched in the working directory for a match. | +| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | +| `symbol` | `""` | The symbol used before displaying the command output. | +| `style` | `"bold green"` | El estilo del módulo. | +| `format` | `"[$symbol$output]($style) "` | The format for the module. | +| `disabled` | `false` | Disables this `custom` module. | + +### Variables + +| Variable | Descripción | +| --------- | -------------------------------------- | +| output | The output of shell command in `shell` | +| symbol | Mirrors the value of option `symbol` | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string #### Custom command shell `shell` accepts a non-empty list of strings, where: + - The first string is the path to the shell to use to execute the command. - Other following arguments are passed to the shell. @@ -1459,11 +2059,22 @@ The `purescript` module shows the currently installed version of PureScript vers ### Opciones -| Variable | Por defecto | Descripción | -| ---------- | -------------- | ------------------------------------------------------------ | -| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | -| `style` | `"bold white"` | El estilo del módulo. | -| `disabled` | `false` | Disables the `purescript` module. | +| Option | Por defecto | Descripción | +| ---------- | ---------------------------------- | ------------------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | +| `style` | `"bold white"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `purescript` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | -------- | ------------------------------------ | +| version | `0.13.5` | The version of `purescript` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Ejemplo @@ -1471,5 +2082,5 @@ The `purescript` module shows the currently installed version of PureScript vers # ~/.config/starship.toml [purescript] -symbol = "<=> " +format = "via [$symbol$version](bold white)" ``` diff --git a/docs/es-ES/faq/README.md b/docs/es-ES/faq/README.md index 1f9944dc..88dc38aa 100644 --- a/docs/es-ES/faq/README.md +++ b/docs/es-ES/faq/README.md @@ -5,9 +5,9 @@ - **Emulador de terminal**: [iTerm2](https://iterm2.com/) - **Tema**: Mínimo - **Esquema de color**: [Snazzy](https://github.com/sindresorhus/iterm2-snazzy) - - **Font**: [Fira Code](https://github.com/tonsky/FiraCode) + - **Font**: [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads) - **Interfaz de línea de comandos**: [Fish Shell](https://fishshell.com/) - - **Configuración**: [archivos de configuración de matchai](https://github.com/matchai/dotfiles/blob/master/.config/fish/config.fish) + - **Configuración**: [archivos de configuración de matchai](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish) - **Prompt**: [Starship](https://starship.rs/) ## ¿`prompt_order` y `.disabled` hacen lo mismo? @@ -46,7 +46,7 @@ El símbolo de sistema usará tanto contexto como le proveas, pero no hay parám ## ¿Cómo lanzo Starship en distribuciones Linux con versiones antiguas de glibc? -Si obtienes un error como "*version 'GLIBC_2.18' not found (required by starship)*" al usar el binario precompilado (por ejemplo, en CentOS 6 o 7), puedes usar el binario compilado con `musl` en vez de `glibc`: +If you get an error like "_version 'GLIBC_2.18' not found (required by starship)_" when using the prebuilt binary (for example, on CentOS 6 or 7), you can use a binary compiled with `musl` instead of `glibc`: ```sh curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux-musl @@ -56,13 +56,13 @@ curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux- 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: - - 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 [powerline-patched font](https://github.com/powerline/fonts). +- 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/). To test your system, run the following commands in a terminal: -``` +```sh echo -e "\xf0\x9f\x90\x8d" echo -e "\xee\x82\xa0" ``` @@ -70,3 +70,19 @@ 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). 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) + +## How do I uninstall Starship? + +Starship is just as easy to uninstall as it is to install in the first place. + +1. Remove any lines in your shell config (e.g. `~/.bashrc`) used to initialize Starship. +1. Delete the Starship binary. + +If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. + +If Starship was installed using the `curl | bash` script, the following command will delete the binary: + +```sh +# Locate and delete the starship binary +rm "$(which starship)" +``` diff --git a/docs/es-ES/guide/README.md b/docs/es-ES/guide/README.md index c0c5b979..309fd46b 100644 --- a/docs/es-ES/guide/README.md +++ b/docs/es-ES/guide/README.md @@ -121,7 +121,7 @@ ### Prerequisitos -- Una [fuente Powerline](https://github.com/powerline/fonts) instalado y activada en tu terminal (por ejemplo, prueba con [Fira Code](https://github.com/tonsky/FiraCode)). +- A [Nerd Font](https://www.nerdfonts.com/) installed and enabled in your terminal (for example, try the [Fira Code Nerd Font](https://www.nerdfonts.com/font-downloads)). ### Comenzando @@ -224,7 +224,7 @@ Si quiere ayudar a colaborar a starship, por favor mira a nuestra [Guía de Cola ### Desarrolladores -Este proyecto existe gracias a todas las personas que han ayudado. [[Contribuir](CONTRIBUTING.md)]. +Este proyecto existe gracias a todas las personas que han ayudado. [[Contribuir](https://github.com/starship/starship/blob/master/CONTRIBUTING.md)]. ### Financiadores diff --git a/docs/fr-FR/advanced-config/README.md b/docs/fr-FR/advanced-config/README.md index 95b6df04..0c8eba70 100644 --- a/docs/fr-FR/advanced-config/README.md +++ b/docs/fr-FR/advanced-config/README.md @@ -57,11 +57,20 @@ Dans `zsh`, ajoutez ceci au tableau `precmd_functions` : précmd_functions+=(set_titre_gagnant) ``` -Si vous aimez le résultat, ajoutez ces lignes à votre fichier de configuration de shell (`~/.bashrc` ou `~/.zsrhc`) pour le rendre permanent. +Si vous aimez le résultat, ajoutez ces lignes à votre fichier de configuration shell (`~/.bashrc` ou `~/.zshrc`) pour le rendre permanent. + +Par exemple, si vous voulez afficher votre répertoire actuel dans votre titre d'onglets de terminal, ajoutez le snippet suivant à votre `~/.bashrc` ou `~/.zshrc`: + +```bash +function set_win_title(){ + echo -ne "\033]0; $(basename $PWD) \007" +} +starship_precmd_user_func="set_win_title" +``` ## Chaînes de style -Les chaînes de style sont une liste de mots, séparés par des espaces blancs. Les mots ne sont pas sensibles à la casse (` bold ` et ` boLd ` sont considérés comme la même string). Chaque mot peut être l'un des suivants : +Les chaînes de style sont une liste de mots, séparés par des espaces. Les mots ne sont pas sensibles à la casse (c'est-à-dire `gras` et `GrAs` sont considérés comme le même mot). Chaque mot peut être l'un des suivants : - `bold` - `underline` @@ -71,7 +80,7 @@ Les chaînes de style sont une liste de mots, séparés par des espaces blancs. - `` - `none` -où `` est un spécificateur de couleur (discuté ci-dessous). `fg:` et `` font actuellement la même chose , bien que cela puisse changer dans le futur. L'ordre des mots dans le string n'a pas d'importance. +où `` est un spécificateur de couleur (discuté ci-dessous). `fg:` et `` font actuellement la même chose, même si cela peut changer plus tard. L'ordre des mots dans le string n'a pas d'importance. Le jeton ` none ` remplace tous les autres jetons d'une string, de sorte que, par exemple, ` fg: red none fg: blue ` créera toujours une string sans style. Il peut devenir une erreur d'utiliser `none` en conjonction avec d'autres jetons dans le futur. diff --git a/docs/fr-FR/config/README.md b/docs/fr-FR/config/README.md index 73d57d50..017ba43f 100644 --- a/docs/fr-FR/config/README.md +++ b/docs/fr-FR/config/README.md @@ -15,24 +15,26 @@ mkdir -p ~/.config && touch ~/.config/starship.toml Toute la configuration de starship est effectuée dans ce fichier [TOML](https://github.com/toml-lang/toml) : ```toml -# N'écrivez pas une nouvelle ligne au début de la console +# Don't print a new line at the start of the prompt add_newline = false -# Remplacez le symbole "❯" dans la console avec "➜" -[character] # Le nom du module que nous configurons est "character" -symbol = "➜" # Le segment "symbol" est mis comme "➜" +# Replace the "❯" symbol in the prompt with "➜" +[character] # The name of the module we are configuring is "character" +success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green" -# Désactivez le module package, le cachant complètement de la console +# Disable the package module, hiding it from the prompt completely [package] disabled = true ``` Vous pouvez changer l'emplacement du fichier de configuration `starship.toml` grâce à la variable d'environnement `STARSHIP_CONFIG`: + ```sh export STARSHIP_CONFIG=~/.starship ``` De manière équivalente, pour Powershell (Windows), ajoutez la ligne suivante à votre `$PROFILE`: + ```ps1 $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` @@ -41,16 +43,39 @@ $ENV:STARSHIP_CONFIG = "$HOME\.starship" **Module**: Un composant dans l'invite donnant des informations basées sur des informations contextuelles à propos de votre Système d'Exploitation. Par exemple, le module "nodejs" montre la version de NodeJS qui est actuellement installée sur votre ordinateur, si votre répertoire actuel est un projet NodeJS. -**Segment**: Sous-composants plus petits qui composent un module. Par exemple, le segment "symbol" du module "nodejs" contient le caractère qui est affiché avant le numéro de version (⬢ par défaut). +**Variable**: Smaller sub-components that contains information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of NodeJS. -Voici la représentation du module node. Dans l'exemple suivant, "symbol" et "version" sont des segments dans celui-ci. Chaque module a également un préfixe et un suffixe qui sont la couleur par défaut du terminal. +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. -``` -[prefix] [symbol] [version] [suffix] - "via " "⬢" "v10.4.1" "" -``` +### Format Strings -### Chaînes de style +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. + +#### Variable + +A variable contains a `$` symbol followed by the name of the variable. The name of a variable only contains letters, numbers and `_`. + +For example: + +- `$version` is a format string with a variable named `version`. +- `$git_branch$git_commit` is a format string with two variables named `git_branch` and `git_commit`. +- `$git_branch $git_commit` has the two variables separated with a space. + +#### Text Group + +A text group is made up of two different parts. + +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. + +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used style the first part. + +For example: + +- `[on](red bold)` will print a string `on` with bold text colored red. +- `[⬢ $version](bold green)` will print a symbol `⬢` followed by the content of variable `version`, with bold text colored green. +- `[a [b](red) c](green)` will print `a b c` with `b` red, and `a` and `c` green. + +#### Chaînes de style La plupart des modules de Starship vous permettent de configurer leurs styles d'affichage. Cela se fait avec une entrée (généralement appelée `style`) qui est une chaîne de caractères spécifiant la configuration. Voici quelques exemples de chaînes de style avec ce qu'elles font. Pour plus de détails sur la syntaxe complète, consultez le [guide de configuration avancé](/advanced-config/). @@ -63,17 +88,56 @@ La plupart des modules de Starship vous permettent de configurer leurs styles d' Notez que ce style sera contrôlé par votre émulateur de terminal. Par exemple, certains émulateurs de terminal éclairciront les couleurs au lieu de mettre le texte en gras, et certains thèmes de couleurs utilisent les mêmes valeurs pour les couleurs normales et claires. De plus, pour obtenir du texte italique, votre terminal doit prendre en charge l'italique. +#### Conditional Format Strings + +A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. + +For example: + +- `(@$region)` will show nothing if the variable `region` is `None`, otherwise `@` followed by the value of region. +- `(some text)` will always show nothing since there are no variables wrapped in the braces. +- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. + +#### Escapable characters + +The following symbols have special usage in a format string. If you want to print the following symbols, you have to escape them with a backslash (`\`). + +- $ +- \\ +- [ +- ] +- ( +- ) + +Note that `toml` has [its own escape syntax](https://github.com/toml-lang/toml#user-content-string). It is recommended to use a literal string (`''`) in your config. If you want to use a basic string (`""`), pay attention to escape the backslash `\`. + +For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: + +```toml +# with basic string +format = "\n\\$" + +# with multiline basic string +format = """ + +\\$""" + +# with literal string +format = ''' + +\$''' +``` + ## Invite Voici la liste des options de configuration de l'invite en lui-même. ### Options -| Variable | Default | Description | -| -------------- | ----------------------------- | ------------------------------------------------------------------------- | -| `add_newline` | `true` | Ajouter une nouvelle ligne avant le début de l'invite de commande. | -| `prompt_order` | [lien](#default-prompt-order) | Configurer l'ordre dans lequel les modules s'affichent. | -| `scan_timeout` | `30` | Délai d'attente pour que starship scanne les fichiers (en millisecondes). | +| Option | Default | Description | +| -------------- | ------------------------------ | ------------------------------------------------------------------------- | +| `format` | [lien](#default-prompt-format) | Configure the format of the prompt. | +| `scan_timeout` | `30` | Délai d'attente pour que starship scanne les fichiers (en millisecondes). | ### Exemple @@ -81,62 +145,71 @@ Voici la liste des options de configuration de l'invite en lui-même. # ~/.config/starship.toml # Disable the newline at the start of the prompt -add_newline = false -# Overwrite a default_prompt_order and use custom prompt_order -prompt_order=["rust","line_break","package","line_break","character"] +format = "$all" + +# Use custom format +format = """ +[┌───────────────────>](bold green) +[│](bold green)$directory$rust$package +[└─>](bold green) """ + # Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 ``` -### Ordre par défaut des modules +### Default Prompt Format -La valeur par défaut `prompt_order` est utilisée pour définir l'ordre selon lequel les modules sont affichés dans l'invite si aucun `prompt_order` n'est fourni ou s'il est vide. La valeur par défaut est la suivante : +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. La valeur par défaut est la suivante : ```toml -prompt_order = [ - "username", - "hostname", - "kubernetes", - "directory", - "git_branch", - "git_commit", - "git_state", - "git_status", - "hg_branch", - "docker_context", - "package", - "dotnet", - "elixir", - "elm", - "erlang", - "golang", - "haskell", - "java", - "julia", - "nim", - "nodejs", - "ocaml", - "php", - "purescript", - "python", - "ruby", - "rust", - "terraform", - "zig", - "nix_shell", - "conda", - "memory_usage", - "aws", - "env_var", - "crystal", - "cmd_duration", - "custom", - "line_break", - "jobs", - "battery", - "time", - "character", -] +format = "\n$all" + +# Which is equivalent to +format = """ + +$username\ +$hostname\ +$kubernetes\ +$directory\ +$git_branch\ +$git_commit\ +$git_state\ +$git_status\ +$hg_branch\ +$docker_context\ +$package\ +$cmake\ +$dotnet\ +$elixir\ +$elm\ +$erlang\ +$golang\ +$helm\ +$java\ +$julia\ +$nim\ +$nodejs\ +$ocaml\ +$php\ +$purescript\ +$python\ +$ruby\ +$rust\ +$terraform\ +$zig\ +$nix_shell\ +$conda\ +$memory_usage\ +$aws\ +$env_var\ +$crystal\ +$cmd_duration\ +$custom\ +$line_break\ +$jobs\ +$battery\ +$time\ +$character""" ``` ## AWS @@ -147,41 +220,80 @@ Quand [aws-vault](https://github.com/99designs/aws-vault) est utilisé, la valeu ### Options -| Variable | Default | Description | -| ----------------- | --------------- | --------------------------------------------------------------------------- | -| `symbol` | `"☁️ "` | The symbol used before displaying the current AWS profile. | -| `displayed_items` | `all` | Choose which item to display. Possible values: [`all`, `profile`, `region`] | -| `region_aliases` | | Table of region aliases to display in addition to the AWS name. | -| `style` | `"bold yellow"` | Le style du module. | -| `disabled` | `false` | Désactive le module `AWS`. | +| Option | Default | Description | +| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- | +| `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"` | Le style du module. | +| `disabled` | `false` | Désactive le module `AWS`. | -### Exemple +### Variables + +| Variable | Exemple | Description | +| --------- | ---------------- | ------------------------------------ | +| region | `ap-northeast-1` | The current AWS region | +| profile | `astronauts` | The current AWS profile | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Examples + +#### Display everything ```toml # ~/.config/starship.toml [aws] +format = "on [$symbol$profile(\\($region\\))]($style) " style = "bold blue" symbol = "🅰 " -displayed_items = "region" [aws.region_aliases] ap-southeast-2 = "au" us-east-1 = "va" ``` +#### Display region + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$region]($style) " +style = "bold blue" +symbol = "🅰 " +[aws.region_aliases] +ap-southeast-2 = "au" +us-east-1 = "va" +``` + +#### Display profile + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$profile]($style) " +style = "bold blue" +symbol = "🅰 " +``` + ## Battery The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%. ### Options -| Variable | Default | Description | -| -------------------- | ------------------------ | --------------------------------------------------- | -| `full_symbol` | `"•"` | Le symbole affiché lorsque la batterie est pleine. | -| `charging_symbol` | `"⇡"` | Le symbole affiché lorsque la batterie se charge. | -| `discharging_symbol` | `"⇣"` | Le symbole affiché lorsque la batterie se décharge. | -| `display` | [lien](#battery-display) | Affiche le seuil et le style du module. | -| `disabled` | `false` | Désactive le module `battery`. | +| Option | Default | Description | +| -------------------- | --------------------------------- | --------------------------------------------------- | +| `full_symbol` | `"•"` | Le symbole affiché lorsque la batterie est pleine. | +| `charging_symbol` | `"⇡"` | Le symbole affiché lorsque la batterie se charge. | +| `discharging_symbol` | `"⇣"` | Le symbole affiché lorsque la batterie se décharge. | +| `format` | `"[$symbol$percentage]($style) "` | The format for the module. | +| `display` | [lien](#battery-display) | Affiche le seuil et le style du module. | +| `disabled` | `false` | Désactive le module `battery`. |
There are also options for some uncommon battery states. @@ -244,31 +356,85 @@ style = "bold yellow" The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal. -The character will tell you whether the last command was successful or not. It can do this in two ways: by changing color (red/green) or by changing its shape (❯/✖). The latter will only be done if `use_symbol_for_status` is set to `true`. +The character will tell you whether the last command was successful or not. It can do this in two ways: + +- changing color (`red`/`green`) +- changing shape (`❯`/`✖`) + +By default it only changes color. If you also want to change it's shape take a look at [this example](#with-custom-error-shape). ### Options -| Variable | Default | Description | -| ----------------------- | -------------- | ----------------------------------------------------------------------------------- | -| `symbol` | `"❯"` | The symbol used before the text input in the prompt. | -| `error_symbol` | `"✖"` | The symbol used before text input if the previous command failed. | -| `use_symbol_for_status` | `false` | Indicate error status by changing the symbol. | -| `vicmd_symbol` | `"❮"` | The symbol used before the text input in the prompt if shell is in vim normal mode. | -| `style_success` | `"bold green"` | The style used if the last command was successful. | -| `style_failure` | `"bold green"` | The style used if the last command failed. | -| `disabled` | `false` | Disables the `character` module. | +| Option | Default | Description | +| ---------------- | ------------------- | -------------------------------------------------------------------------------- | +| `format` | `"$symbol "` | The format string used before the text input. | +| `success_symbol` | `"[❯](bold green)"` | The format string used before the text input if the previous command succeeded. | +| `error_symbol` | `"[❯](bold red)"` | The format string used before the text input if the previous command failed. | +| `vicmd_symbol` | `"[❮](bold green)"` | The format string used before the text input if the shell is in vim normal mode. | +| `disabled` | `false` | Disables the `character` module. | -### Exemple +### Variables + +| Variable | Exemple | Description | +| -------- | ------- | --------------------------------------------------------------------- | +| symbol | | A mirror of either `success_symbol`, `error_symbol` or `vicmd_symbol` | + +### Examples + +#### With custom error shape ```toml # ~/.config/starship.toml [character] -symbol = "➜" -error_symbol = "✗" -use_symbol_for_status = true +success_symbol = "[➜](bold green) " +error_symbol = "[✗](bold red) " ``` +#### Without custom error shape + +```toml +# ~/.config/starship.toml + +[character] +success_symbol = "[➜](bold green) " +error_symbol = "[➜](bold red) " +``` + +#### With custom vim shape + +```toml +# ~/.config/starship.toml + +[character] +vicmd_symbol = "[V](bold green) " +``` + +## CMake + +The `cmake` module shows the currently installed version of CMake if: + +- The current directory contains a `CMakeLists.txt` file + +### Options + +| Option | Default | Description | +| ---------- | ---------------------------------- | -------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🛆 "` | The symbol used before the version of cmake. | +| `style` | `"bold blue"` | Le style du module. | +| `disabled` | `false` | Disables the `cmake` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | --------- | ------------------------------------ | +| version | `v3.17.3` | The version of cmake | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + ## Command Duration The `cmd_duration` module shows how long the last command took to execute. The module will be shown only if the command took longer than two seconds, or the `min_time` config value, if it exists. @@ -283,13 +449,22 @@ Bash users who need preexec-like functionality can use [rcaloras's bash_preexec ### Options -| Variable | Default | Description | -| ------------------- | --------------- | ---------------------------------------------------------- | -| `min_time` | `2_000` | Shortest duration to show time for (in milliseconds). | -| `show_milliseconds` | `false` | Show milliseconds in addition to seconds for the duration. | -| `prefix` | `took` | Prefix to display immediately before the command duration. | -| `style` | `"bold yellow"` | Le style du module. | -| `disabled` | `false` | Disables the `cmd_duration` module. | +| Option | Default | Description | +| ------------------- | ----------------------------- | ---------------------------------------------------------- | +| `min_time` | `2_000` | Shortest duration to show time for (in milliseconds). | +| `show_milliseconds` | `false` | Show milliseconds in addition to seconds for the duration. | +| `format` | `"took [$duration]($style) "` | The format for the module. | +| `style` | `"bold yellow"` | Le style du module. | +| `disabled` | `false` | Disables the `cmd_duration` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | -------- | --------------------------------------- | +| duration | `16m40s` | The time it took to execute the command | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -298,7 +473,7 @@ Bash users who need preexec-like functionality can use [rcaloras's bash_preexec [cmd_duration] min_time = 500 -prefix = "underwent " +format = "underwent [$duration](bold yellow)" ``` ## Conda @@ -313,12 +488,23 @@ This does not suppress conda's own prompt modifier, you may want to run `conda c ### Options -| Variable | Default | Description | -| ------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `truncation_length` | `1` | The number of directories the environment path should be truncated to, if the environment was created via `conda create -p [path]`. `0` means no truncation. Also see the [`directory`](#directory) module. | -| `symbol` | `"C "` | The symbol used before the environment name. | -| `style` | `"bold green"` | Le style du module. | -| `disabled` | `false` | Disables the `conda` module. | +| Option | Default | Description | +| ------------------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `truncation_length` | `1` | The number of directories the environment path should be truncated to, if the environment was created via `conda create -p [path]`. `0` means no truncation. Also see the [`directory`](#directory) module. | +| `symbol` | `"🅒 "` | The symbol used before the environment name. | +| `style` | `"bold green"` | Le style du module. | +| `format` | `"[$symbol$environment]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `conda` module. | + +### Variables + +| Variable | Exemple | Description | +| ----------- | ------------ | ------------------------------------ | +| environment | `astronauts` | The current conda environment | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -326,7 +512,7 @@ This does not suppress conda's own prompt modifier, you may want to run `conda c # ~/.config/starship.toml [conda] -style = "dimmed green" +format = "[$symbol$environment](dimmed green) " ``` ## Crystal @@ -338,11 +524,22 @@ The `crystal` module shows the currently installed version of Crystal. Le module ### Options -| Variable | Default | Description | -| ---------- | -------------- | --------------------------------------------------------- | -| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. | -| `style` | `"bold green"` | Le style du module. | -| `disabled` | `false` | Disables the `crystal` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | --------------------------------------------------------- | +| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. | +| `style` | `"bold green"` | Le style du module. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `crystal` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | --------- | ------------------------------------ | +| version | `v0.32.1` | The version of `crystal` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -350,8 +547,7 @@ The `crystal` module shows the currently installed version of Crystal. Le module # ~/.config/starship.toml [crystal] -symbol = "✨ " -style = "bold blue" +format = "via [✨ $version](bold blue) " ``` ## Directory @@ -364,18 +560,20 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an ### Options -| Variable | 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. | -| `prefix` | `"in "` | Prefix to display immediately before the directory. | -| `style` | `"bold cyan"` | Le style du module. | -| `disabled` | `false` | Disables the `directory` module. | +| Variable | Default | Description | +| ------------------------ | ----------------------------------------------- | -------------------------------------------------------------------------------- | +| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | +| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | +| `format` | `"[$path]($style)[$lock_symbol]($lock_style) "` | The format for the module. | +| `style` | `"bold cyan"` | Le style du module. | +| `disabled` | `false` | Disables the `directory` module. | +| `read_only_symbol` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_symbol_style` | `"red"` | The style for the read only symbol. |
This module has a few advanced configuration options that control how the directory is displayed. -| Variable | Default | Description | +| Advanced Option | Default | Description | | --------------------------- | ------- | ---------------------------------------------------------------------------------------- | | `substitutions` | | A table of substitutions to be made to the path. | | `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. | @@ -393,6 +591,15 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
+### Variables + +| Variable | Exemple | Description | +| --------- | --------------------- | ----------------------------------- | +| path | `"D:/Projects"` | The current directory path | +| style\* | `"black bold dimmed"` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + ### Exemple ```toml @@ -408,12 +615,23 @@ The `docker_context` module shows the currently active [Docker context](https:// ### Options -| Variable | Default | Description | -| ----------------- | ------------- | --------------------------------------------------------------------------------------- | -| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context . | -| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. | -| `style` | `"bold blue"` | Le style du module. | -| `disabled` | `true` | Disables the `docker_context` module. | +| Option | Default | Description | +| ----------------- | ---------------------------------- | --------------------------------------------------------------------------------------- | +| `format` | `"via [$symbol$context]($style) "` | The format for the module. | +| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context. | +| `style` | `"blue bold"` | Le style du module. | +| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. | +| `disabled` | `true` | Disables the `docker_context` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | -------------- | ------------------------------------ | +| context | `test_context` | The current docker context | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -421,25 +639,51 @@ The `docker_context` module shows the currently active [Docker context](https:// # ~/.config/starship.toml [docker_context] -symbol = "🐋 " +format = "via [🐋 $context](blue bold)" ``` ## Dotnet The `dotnet` module shows the relevant version of the .NET Core SDK for the current directory. If the SDK has been pinned in the current directory, the pinned version is shown. Otherwise the module shows the latest installed version of the SDK. -This module will only be shown in your prompt when one of the following files are present in the current directory: `global.json`, `project.json`, `*.sln`, `*.csproj`, `*.fsproj`, `*.xproj`. You'll also need the .NET Core command-line tools installed in order to use it correctly. +This module will only be shown in your prompt when one or more of the following files are present in the current directory: + +- `global.json` +- `project.json` +- `Directory.Build.props` +- `Directory.Build.targets` +- `Packages.props` +- `*.sln` +- `*.csproj` +- `*.fsproj` +- `*.xproj` + +You'll also need the .NET Core SDK installed in order to use it correctly. Internally, this module uses its own mechanism for version detection. Typically it is twice as fast as running `dotnet --version`, but it may show an incorrect version if your .NET project has an unusual directory layout. If accuracy is more important than speed, you can disable the mechanism by setting `heuristic = false` in the module options. +The module will also show the Target Framework Moniker () when there is a csproj file in the current directory. + ### Options -| Variable | Default | Description | -| ----------- | ------------- | -------------------------------------------------------- | -| `symbol` | `"•NET "` | The symbol used before displaying the version of dotnet. | -| `heuristic` | `true` | Use faster version detection to keep starship snappy. | -| `style` | `"bold blue"` | Le style du module. | -| `disabled` | `false` | Disables the `dotnet` module. | +| Option | Default | Description | +| ----------- | ---------------------------------------- | -------------------------------------------------------- | +| `format` | `"v[$symbol$version( 🎯 $tfm)]($style) "` | The format for the module. | +| `symbol` | `"•NET "` | The symbol used before displaying the version of dotnet. | +| `heuristic` | `true` | Use faster version detection to keep starship snappy. | +| `style` | `"bold blue"` | Le style du module. | +| `disabled` | `false` | Disables the `dotnet` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | ---------------- | ------------------------------------------------------------------ | +| version | `v3.1.201` | The version of `dotnet` sdk | +| tfm | `netstandard2.0` | The Target Framework Moniker that the current project is targeting | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -460,11 +704,23 @@ The `elixir` module shows the currently installed version of Elixir and Erlang/O ### Options -| Variable | Default | Description | -| ---------- | --------------- | --------------------------------------------------------------- | -| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. | -| `style` | `"bold purple"` | Le style du module. | -| `disabled` | `false` | Disables the `elixir` module. | +| 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. | +| `disabled` | `false` | Disables the `elixir` module. | + +### Variables + +| Variable | Exemple | Description | +| ----------- | ------- | ------------------------------------ | +| version | `v1.10` | The version of `elixir` | +| otp_version | | The otp version of `elixir` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -487,12 +743,22 @@ The `elm` module shows the currently installed version of Elm. Le module est aff ### Options -| Variable | Default | Description | -| ---------- | ------------- | ----------------------------------------------------- | -| `symbol` | `"🌳 "` | The symbol used before displaying the version of Elm. | -| `style` | `"bold cyan"` | Le style du module. | -| `disabled` | `false` | Disables the `elm` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🌳 "` | A format string representing the symbol of Elm. | +| `style` | `"cyan bold"` | Le style du module. | +| `disabled` | `false` | Disables the `elm` module. | +### Variables + +| Variable | Exemple | Description | +| --------- | --------- | ------------------------------------ | +| version | `v0.19.1` | The version of `elm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -500,7 +766,7 @@ The `elm` module shows the currently installed version of Elm. Le module est aff # ~/.config/starship.toml [elm] -symbol = " " +format = "via [ $version](cyan bold) " ``` ## Environment Variable @@ -512,15 +778,23 @@ The `env_var` module displays the current value of a selected environment variab ### Options -| Variable | Default | Description | -| ---------- | --------------------- | ---------------------------------------------------------------------------- | -| `symbol` | | The symbol used before displaying the variable value. | -| `variable` | | The environment variable to be displayed. | -| `default` | | The default value to be displayed when the selected variable is not defined. | -| `prefix` | `""` | Prefix to display immediately before the variable value. | -| `suffix` | `""` | Suffix to display immediately after the variable value. | -| `style` | `"dimmed bold black"` | Le style du module. | -| `disabled` | `false` | Disables the `env_var` module. | +| Option | Default | Description | +| ---------- | ------------------------------ | ---------------------------------------------------------------------------- | +| `symbol` | | The symbol used before displaying the variable value. | +| `variable` | | The environment variable to be displayed. | +| `default` | | The default value to be displayed when the selected variable is not defined. | +| `format` | `"with [$env_value]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `env_var` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | ------------------------------------------- | ------------------------------------------ | +| env_value | `Windows NT` (if *variable* would be `$OS`) | The environment value of option `variable` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | `black bold dimmed` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -541,11 +815,22 @@ The `erlang` module shows the currently installed version of Erlang/OTP. Le modu ### Options -| Variable | Default | Description | -| ---------- | ------------ | -------------------------------------------------------- | -| `symbol` | `"🖧 "` | The symbol used before displaying the version of Erlang. | -| `style` | `bold green` | The style for this module. | -| `disabled` | `false` | Disables the `erlang` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | -------------------------------------------------------- | +| `symbol` | `"🖧 "` | The symbol used before displaying the version of erlang. | +| `style` | `"bold green"` | Le style du module. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `erlang` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | --------- | ------------------------------------ | +| version | `v22.1.3` | The version of `erlang` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -553,7 +838,7 @@ The `erlang` module shows the currently installed version of Erlang/OTP. Le modu # ~/.config/starship.toml [erlang] -symbol = "e " +format = "via [e $version](bold red) " ``` ## Git Branch @@ -562,13 +847,24 @@ The `git_branch` module shows the active branch of the repo in your current dire ### Options -| Variable | Default | Description | -| ------------------- | --------------- | ------------------------------------------------------------------------------------- | -| `symbol` | `" "` | The symbol used before the branch name of the repo in your current directory. | -| `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes | -| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. You can use "" for no symbol | -| `style` | `"bold purple"` | Le style du module. | -| `disabled` | `false` | Disables the `git_branch` module. | +| Option | Default | Description | +| ------------------- | -------------------------------- | ---------------------------------------------------------------------------------------- | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. Use `"$branch"` to refer to the current branch name. | +| `symbol` | `" "` | A format string representing the symbol of git branch. | +| `style` | `"bold purple"` | Le style du module. | +| `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes. | +| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. You can use `""` for no symbol. | +| `disabled` | `false` | Disables the `git_branch` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| branch | `master` | The current branch name, falls back to `HEAD` if there's no current branch (e.g. git detached HEAD). | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -587,14 +883,22 @@ The `git_commit` module shows the current commit hash of the repo in your curren ### Options -| Variable | Default | Description | -| -------------------- | -------------- | ----------------------------------------------------- | -| `commit_hash_length` | `7` | The length of the displayed git commit hash. | -| `prefix` | `"("` | Prefix to display immediately before git commit. | -| `suffix` | `")"` | Suffix to display immediately after git commit. | -| `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. | +| Option | Default | Description | +| -------------------- | ------------------------------ | ----------------------------------------------------- | +| `commit_hash_length` | `7` | The length of the displayed git commit hash. | +| `format` | `"[\\($hash\\)]($style) "` | The format for the 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. | + +### Variables + +| Variable | Exemple | Description | +| --------- | --------- | ----------------------------------- | +| hash | `b703eb3` | The current git commit hash | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -611,18 +915,29 @@ The `git_state` module will show in directories which are part of a git reposito ### Options -| Variable | Default | Description | -| ------------------ | ------------------ | ---------------------------------------------------------------------------------------------------------------- | -| `rebase` | `"REBASING"` | The text displayed when a `rebase` is in progress. | -| `merge` | `"MERGING"` | The text displayed when a `merge` is in progress. | -| `revert` | `"REVERTING"` | The text displayed when a `revert` is in progress. | -| `cherry_pick` | `"CHERRY-PICKING"` | The text displayed when a `cherry-pick` is in progress. | -| `bisect` | `"BISECTING"` | The text displayed when a `bisect` is in progress. | -| `am` | `"AM"` | The text displayed when an `apply-mailbox` (`git am`) is in progress. | -| `am_or_rebase` | `"AM/REBASE"` | The text displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. | -| `progress_divider` | `"/"` | The symbol or text which will separate the current and total progress amounts. (e.g., `" of "`, for `"3 of 10"`) | -| `style` | `"bold yellow"` | Le style du module. | -| `disabled` | `false` | Disables the `git_state` module. | +| 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. | +| `cherry_pick` | `"CHERRY-PICKING"` | A format string displayed when a `cherry-pick` is in progress. | +| `bisect` | `"BISECTING"` | A format string displayed when a `bisect` is in progress. | +| `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) "` | The format for the module. | +| `disabled` | `false` | Disables the `git_state` module. | + +### Variables + +| Variable | Exemple | Description | +| ---------------- | ---------- | ----------------------------------- | +| state | `REBASING` | The current state of the repo | +| progress_current | `1` | The current operation progress | +| progress_total | `2` | The total operation progress | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -630,8 +945,8 @@ The `git_state` module will show in directories which are part of a git reposito # ~/.config/starship.toml [git_state] -progress_divider = " of " -cherry_pick = "🍒 PICKING" +format = "[\\($state( $progress_current of $progress_total)\\)]($style) " +cherry_pick = "[🍒 PICKING](bold red)" ``` ## Git Status @@ -640,37 +955,54 @@ The `git_status` module shows symbols representing the state of the repo in your ### Options -| Variable | Default | Description | -| ------------------ | -------------------------- | ------------------------------------------------------- | -| `conflicted` | `"="` | This branch has merge conflicts. | -| `conflicted_count` | [lien](#git-status-counts) | Show and style the number of conflicts. | -| `ahead` | `"⇡"` | This branch is ahead of the branch being tracked. | -| `behind` | `"⇣"` | This branch is behind of the branch being tracked. | -| `diverged` | `"⇕"` | This branch has diverged from the branch being tracked. | -| `untracked` | `"?"` | There are untracked files in the working directory. | -| `untracked_count` | [lien](#git-status-counts) | Show and style the number of untracked files. | -| `stashed` | `"$"` | A stash exists for the local repository. | -| `stashed_count` | [lien](#git-status-counts) | Show and style the number of stashes. | -| `modified` | `"!"` | There are file modifications in the working directory. | -| `modified_count` | [lien](#git-status-counts) | Show and style the number of modified files. | -| `staged` | `"+"` | A new file has been added to the staging area. | -| `staged_count` | [lien](#git-status-counts) | Show and style the number of files staged files. | -| `renamed` | `"»"` | A renamed file has been added to the staging area. | -| `renamed_count` | [lien](#git-status-counts) | Show and style the number of renamed files. | -| `deleted` | `"✘"` | A file's deletion has been added to the staging area. | -| `deleted_count` | [lien](#git-status-counts) | Show and style the number of deleted files. | -| `show_sync_count` | `false` | Show ahead/behind count of the branch being tracked. | -| `prefix` | `[` | Prefix to display immediately before git status. | -| `suffix` | `]` | Suffix to display immediately after git status. | -| `style` | `"bold green"` | Le style du module. | -| `disabled` | `false` | Disables the `git_status` module. | +| Option | Default | Description | +| ----------------- | ----------------------------------------------- | ---------------------------------------------------- | +| `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` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `show_sync_count` | `false` | Show ahead/behind count of the branch being tracked. | +| `style` | `"bold green"` | Le style du module. | +| `disabled` | `false` | Disables the `git_status` module. | -#### Git Status Counts +### Variables -| Variable | Default | Description | -| --------- | ------- | ------------------------------------------------------ | -| `enabled` | `false` | Show the number of files | -| `style` | | Optionally style the count differently than the module | +The following variables can be used in `format`: + +| Variable | Description | +| -------------- | --------------------------------------------------------------------------------------------- | +| `all_status` | Shortcut for`$conflicted$stashed$deleted$renamed$modified$staged$untracked` | +| `ahead_behind` | Displays `diverged` `ahead` or `behind` format string based on the current status of the repo | +| `conflicted` | Displays `conflicted` when this branch has merge conflicts. | +| `untracked` | Displays `untracked` when there are untracked files in the working directory. | +| `stashed` | Displays `stashed` when a stash exists for the local repository. | +| `modified` | Displays `modified` when there are file modifications in the working directory. | +| `staged` | Displays `staged` when a new file has been added to the staging area. | +| `renamed` | Displays `renamed` when a renamed file has been added to the staging area. | +| `deleted` | Displays `deleted` when a file's deletion has been added to the staging area. | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +The following variables can be used in `diverged`: + +| Variable | Description | +| -------------- | ---------------------------------------------- | +| `ahead_count` | Number of commits ahead of the tracking branch | +| `behind_count` | Number of commits behind the tracking branch | + +The following variables can be used in `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` and `deleted`: + +| Variable | Description | +| -------- | ------------------------ | +| `count` | Show the number of files | ### Exemple @@ -685,10 +1017,7 @@ diverged = "😵" untracked = "🤷‍" stashed = "📦" modified = "📝" -staged.value = "++" -staged.style = "green" -staged_count.enabled = true -staged_count.style = "green" +staged = '[++\($count\)](green)' renamed = "👅" deleted = "🗑" ``` @@ -708,11 +1037,22 @@ The `golang` module shows the currently installed version of Golang. Le module e ### Options -| Variable | Default | Description | -| ---------- | ------------- | -------------------------------------------------------- | -| `symbol` | `"🐹 "` | The symbol used before displaying the version of Golang. | -| `style` | `"bold cyan"` | Le style du module. | -| `disabled` | `false` | Disables the `golang` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ---------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐹 "` | A format string representing the symbol of Go. | +| `style` | `"bold cyan"` | Le style du module. | +| `disabled` | `false` | Disables the `golang` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | --------- | ------------------------------------ | +| version | `v1.12.1` | The version of `go` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -720,30 +1060,42 @@ The `golang` module shows the currently installed version of Golang. Le module e # ~/.config/starship.toml [golang] -symbol = "🏎💨 " +format = "via [🏎💨 $version](bold cyan) " ``` -## Haskell -The `haskell` module shows the currently installed version of Haskell Stack version. Le module est affiché si l'une des ces conditions est remplie : +## Helm -- The current directory contains a `stack.yaml` file +The `helm` module shows the currently installed version of Helm. Le module est affiché si l'une des ces conditions est remplie : + +- The current directory contains a `helmfile.yaml` file +- The current directory contains a `Chart.yaml` file ### Options -| Variable | Default | Description | -| ---------- | -------------- | --------------------------------------------------------- | -| `symbol` | `"λ "` | The symbol used before displaying the version of Haskell. | -| `style` | `"bold green"` | Le style du module. | -| `disabled` | `false` | Disables the `haskell` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⎈ "` | A format string representing the symbol of Helm. | +| `style` | `"bold white"` | Le style du module. | +| `disabled` | `false` | Disables the `helm` module. | +### Variables + +| Variable | Exemple | Description | +| --------- | -------- | ------------------------------------ | +| version | `v3.1.1` | The version of `helm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple ```toml # ~/.config/starship.toml -[haskell] -symbol = " " +[helm] +format = "via [⎈ $version](bold white) " ``` ## Hostname @@ -752,14 +1104,23 @@ The `hostname` module shows the system hostname. ### Options -| Variable | Default | Description | -| ---------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | -| `ssh_only` | `true` | Only show hostname when connected to an SSH session. | -| `prefix` | `""` | Prefix to display immediately before the hostname. | -| `suffix` | `""` | Suffix to display immediately after the hostname. | -| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation | -| `style` | `"bold dimmed green"` | Le style du module. | -| `disabled` | `false` | Disables the `hostname` module. | +| Option | Default | Description | +| ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `ssh_only` | `true` | Only show hostname when connected to an SSH session. | +| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation | +| `format` | `"on [$hostname]($style) "` | The format for the module. | +| `style` | `"bold dimmed green"` | Le style du module. | +| `disabled` | `false` | Disables the `hostname` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | ------- | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -768,8 +1129,7 @@ The `hostname` module shows the system hostname. [hostname] ssh_only = false -prefix = "⟪" -suffix = "⟫" +format = "on [$hostname](bold red) " trim_at = ".companyname.com" disabled = false ``` @@ -783,11 +1143,22 @@ The `java` module shows the currently installed version of Java. Le module est a ### Options -| Variable | Default | Description | -| ---------- | -------------- | ------------------------------------------------------ | -| `symbol` | `"☕ "` | The symbol used before displaying the version of Java. | -| `style` | `"dimmed red"` | Le style du module. | -| `disabled` | `false` | Disables the `java` module. | +| Option | Default | Description | +| ---------- | -------------------------------------- | ----------------------------------------------- | +| `format` | `"via [${symbol}${version}]($style) "` | The format for the module. | +| `symbol` | `"☕ "` | A format string representing the symbol of Java | +| `style` | `"red dimmed"` | Le style du module. | +| `disabled` | `false` | Disables the `java` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | ------- | ------------------------------------ | +| version | `v14` | The version of `java` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -804,12 +1175,23 @@ The `jobs` module shows the current number of jobs running. The module will be s ### Options -| Variable | Default | Description | -| ----------- | ------------- | ----------------------------------------------------- | -| `symbol` | `"✦"` | The symbol used before displaying the number of jobs. | -| `threshold` | `1` | Show number of jobs if exceeded. | -| `style` | `"bold blue"` | Le style du module. | -| `disabled` | `false` | Disables the `jobs` module. | +| Option | Default | Description | +| ----------- | ----------------------------- | ------------------------------------------------ | +| `threshold` | `1` | Show number of jobs if exceeded. | +| `format` | `"[$symbol$number]($style) "` | The format for the module. | +| `symbol` | `"✦"` | A format string representing the number of jobs. | +| `style` | `"bold blue"` | Le style du module. | +| `disabled` | `false` | Disables the `jobs` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | ------- | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -831,11 +1213,22 @@ The `julia` module shows the currently installed version of Julia. Le module est ### Options -| Variable | Default | Description | -| ---------- | --------------- | ------------------------------------------------------- | -| `symbol` | `"ஃ "` | The symbol used before displaying the version of Julia. | -| `style` | `"bold purple"` | Le style du module. | -| `disabled` | `false` | Disables the `julia` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"ஃ "` | A format string representing the symbol of Julia. | +| `style` | `"bold purple"` | Le style du module. | +| `disabled` | `false` | Disables the `julia` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | -------- | ------------------------------------ | +| version | `v1.4.0` | The version of `julia` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -845,6 +1238,7 @@ The `julia` module shows the currently installed version of Julia. Le module est [julia] symbol = "∴ " ``` + ## Kubernetes Displays the current Kubernetes context name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`. @@ -857,12 +1251,25 @@ Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur ### Options -| Variable | Default | Description | -| ----------------- | ------------- | --------------------------------------------------- | -| `symbol` | `"☸ "` | The symbol used before displaying the Cluster info. | -| `context_aliases` | | Table of context aliases to display | -| `style` | `"bold blue"` | Le style du module. | -| `disabled` | `true` | Disables the `kubernetes` module | +| Option | Default | Description | +| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- | +| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. | +| `format` | `"on [$symbol$context( \\($namespace\\))]($style) "` | The format for the 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. | + +### Variables + +| Variable | Exemple | Description | +| --------- | -------------------- | ---------------------------------------- | +| context | `starship-cluster` | The current kubernetes context | +| namespace | `starship-namespace` | If set, the current kubernetes namespace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -870,8 +1277,7 @@ Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur # ~/.config/starship.toml [kubernetes] -symbol = "⛵ " -style = "dimmed green" +format = "on [⛵ $context \\($namespace\\)](dimmed green) " disabled = false [kubernetes.context_aliases] "dev.local.cluster.k8s" = "dev" @@ -883,7 +1289,7 @@ The `line_break` module separates the prompt into two lines. ### Options -| Variable | Default | Description | +| Option | Default | Description | | ---------- | ------- | ------------------------------------------------------------------ | | `disabled` | `false` | Disables the `line_break` module, making the prompt a single line. | @@ -910,15 +1316,26 @@ Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur ### Options -| Variable | Default | Description | -| ----------------- | --------------------- | ------------------------------------------------------------- | -| `show_percentage` | `false` | Display memory usage as a percentage of the available memory. | -| `show_swap` | `true` | Display swap usage if total swap is non-zero. | -| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. | -| `symbol` | `"🐏 "` | The symbol used before displaying the memory usage. | -| `separator` | `" | "` | The symbol or text that will seperate the ram and swap usage. | -| `style` | `"bold dimmed white"` | Le style du module. | -| `disabled` | `true` | Disables the `memory_usage` module. | +| Option | Default | Description | +| ----------- | --------------------------------------------- | -------------------------------------------------------- | +| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. | +| `format` | `"via $symbol [${ram}( | ${swap})]($style) "` | The format for the module. | +| `symbol` | `"🐏"` | The symbol used before displaying the memory usage. | +| `style` | `"bold dimmed white"` | Le style du module. | +| `disabled` | `true` | Disables the `memory_usage` module. | + +### Variables + +| Variable | Exemple | Description | +| ------------- | ------------- | ------------------------------------------------------------------ | +| ram | `31GiB/65GiB` | The usage/total RAM of the current system memory. | +| ram_pct | `48%` | The percentage of the current system memory. | +| swap\** | `1GiB/4GiB` | The swap memory size of the current system swap memory file. | +| swap_pct\** | `77%` | The swap memory percentage of the current system swap memory file. | +| symbol | `🐏` | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string \*\*: The SWAP file information is only displayed if detected on the current system ### Exemple @@ -941,13 +1358,24 @@ The `hg_branch` module shows the active branch of the repo in your current direc ### Options -| Variable | Default | Description | -| ------------------- | --------------- | -------------------------------------------------------------------------------------------- | -| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. | -| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes | -| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. | -| `style` | `"bold purple"` | Le style du module. | -| `disabled` | `true` | Disables the `hg_branch` module. | +| Option | Default | Description | +| ------------------- | -------------------------------- | -------------------------------------------------------------------------------------------- | +| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. | +| `style` | `"bold purple"` | Le style du module. | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. | +| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes | +| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. | +| `disabled` | `true` | Disables the `hg_branch` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | -------- | ------------------------------------ | +| branch | `master` | The active mercurial branch | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -955,7 +1383,7 @@ The `hg_branch` module shows the active branch of the repo in your current direc # ~/.config/starship.toml [hg_branch] -symbol = "🌱 " +format = "on [🌱 $branch](bold purple)" truncation_length = 4 truncation_symbol = "" ``` @@ -963,6 +1391,7 @@ truncation_symbol = "" ## Nim The `nim` module shows the currently installed version of Nim. Le module est affiché si l'une des ces conditions est remplie : + - The current directory contains a `nim.cfg` file - The current directory contains a file with the `.nim` extension - The current directory contains a file with the `.nims` extension @@ -970,11 +1399,22 @@ The `nim` module shows the currently installed version of Nim. Le module est aff ### Options -| Variable | Default | Description | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | -| `style` | `"bold yellow"` | Le style du module. | -| `disabled` | `false` | Disables the `nim` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module | +| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | +| `style` | `"bold yellow"` | Le style du module. | +| `disabled` | `false` | Disables the `nim` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | -------- | ------------------------------------ | +| version | `v1.2.0` | The version of `nimc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -992,14 +1432,25 @@ The `nix_shell` module shows the nix-shell environment. The module will be shown ### Options -| Variable | Default | Description | -| ------------ | ------------- | ------------------------------------------------- | -| `use_name` | `false` | Display the name of the nix-shell. | -| `impure_msg` | `"impure"` | Customize the "impure" msg. | -| `pure_msg` | `"pure"` | Customize the "pure" msg. | -| `symbol` | `"❄️ "` | The symbol used before displaying the shell name. | -| `style` | `"bold blue"` | Le style du module. | -| `disabled` | `false` | Disables the `nix_shell` module. | +| Option | Default | Description | +| ------------ | -------------------------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$state( \\($name\\))]($style) "` | The format for the 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. | +| `pure_msg` | `"pure"` | A format string shown when the shell is pure. | +| `disabled` | `false` | Disables the `nix_shell` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | ------- | ------------------------------------ | +| state | `pure` | The state of the nix-shell | +| name | `lorri` | The name of the nix-shell | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -1008,10 +1459,9 @@ The `nix_shell` module shows the nix-shell environment. The module will be shown [nix_shell] disabled = true -use_name = true -impure_msg = "impure shell" -pure_msg = "pure shell" -symbol = "☃️ " +impure_msg = "[impure shell](bold red)" +pure_msg = "[pure shell](bold green)" +format = "via [☃️ $state( \\($name\\))](bold blue) " ``` ## NodeJS @@ -1021,15 +1471,27 @@ The `nodejs` module shows the currently installed version of NodeJS. Le module e - The current directory contains a `package.json` file - The current directory contains a `.node-version` file - The current directory contains a `node_modules` directory -- The current directory contains a file with the `.js` extension +- The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension +- The current directory contains a file with the `.ts` extension ### Options -| Variable | Default | Description | -| ---------- | -------------- | -------------------------------------------------------- | -| `symbol` | `"⬢ "` | The symbol used before displaying the version of NodeJS. | -| `style` | `"bold green"` | Le style du module. | -| `disabled` | `false` | Disables the `nodejs` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | -------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⬢ "` | A format string representing the symbol of NodeJS. | +| `style` | `"bold green"` | Le style du module. | +| `disabled` | `false` | Disables the `nodejs` module. | + +###  Variables + +| Variable | Exemple | Description | +| --------- | ---------- | ------------------------------------ | +| version | `v13.12.0` | The version of `node` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -1037,7 +1499,7 @@ The `nodejs` module shows the currently installed version of NodeJS. Le module e # ~/.config/starship.toml [nodejs] -symbol = "🤖 " +format = "via [🤖 $version](bold green) " ``` ## Package Version @@ -1056,12 +1518,23 @@ The `package` module is shown when the current directory is the repository for a ### Options -| Variable | Default | Description | -| ----------------- | ------------ | ---------------------------------------------------------- | -| `symbol` | `"📦 "` | The symbol used before displaying the version the package. | -| `style` | `"bold 208"` | Le style du module. | -| `display_private` | `false` | Enable displaying version for packages marked as private. | -| `disabled` | `false` | Disables the `package` module. | +| Option | Default | Description | +| ----------------- | ---------------------------------- | ---------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"📦 "` | The symbol used before displaying the version the package. | +| `style` | `"bold 208"` | Le style du module. | +| `display_private` | `false` | Enable displaying version for packages marked as private. | +| `disabled` | `false` | Disables the `package` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | -------- | ------------------------------------ | +| version | `v1.0.0` | The version of your package | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -1069,7 +1542,7 @@ The `package` module is shown when the current directory is the repository for a # ~/.config/starship.toml [package] -symbol = "🎁 " +format = "via [🎁 $version](208 bold) " ``` ## OCaml @@ -1085,11 +1558,22 @@ The `ocaml` module shows the currently installed version of OCaml. Le module est ### Options -| Variable | Default | Description | -| ---------- | --------------- | ------------------------------------------------------- | -| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | -| `style` | `"bold yellow"` | Le style du module. | -| `disabled` | `false` | Disables the `ocaml` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format string for the module. | +| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | +| `style` | `"bold yellow"` | Le style du module. | +| `disabled` | `false` | Disables the `ocaml` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | --------- | ------------------------------------ | +| version | `v4.10.0` | The version of `ocaml` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -1097,7 +1581,7 @@ The `ocaml` module shows the currently installed version of OCaml. Le module est # ~/.config/starship.toml [ocaml] -symbol = "🐪 " +format = "via [🐪 $version]($style) " ``` ## PHP @@ -1110,11 +1594,22 @@ The `php` module shows the currently installed version of PHP. Le module est aff ### Options -| Variable | Default | Description | -| ---------- | ------------ | ----------------------------------------------------- | -| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. | -| `style` | `"bold 147"` | Le style du module. | -| `disabled` | `false` | Disables the `php` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. | +| `style` | `"147 bold"` | Le style du module. | +| `disabled` | `false` | Disables the `php` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | -------- | ------------------------------------ | +| version | `v7.3.8` | The version of `php` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -1122,7 +1617,7 @@ The `php` module shows the currently installed version of PHP. Le module est aff # ~/.config/starship.toml [php] -symbol = "🔹 " +format = "via [🔹 $version](147 bold) " ``` ## Python @@ -1145,19 +1640,28 @@ Le module est affiché si l'une des ces conditions est remplie : ### Options -| Variable | Défault | Description | -| -------------------- | --------------- | --------------------------------------------------------------------------- | -| `symbol` | `"🐍 "` | The symbol used before displaying the version of Python. | -| `pyenv_version_name` | `false` | Use pyenv to get Python version | -| `pyenv_prefix` | `"pyenv "` | Prefix before pyenv version display (default display is `pyenv MY_VERSION`) | -| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | -| `style` | `"bold yellow"` | Le style du module. | -| `disabled` | `false` | Disables the `python` module. | +| Option | Default | Description | +| -------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${version}( \\($virtualenv\\))]($style) "` | The format for the 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 | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `disabled` | `false` | Disables the `python` module. | + +### Variables + +| Variable | Exemple | Description | +| ---------- | --------------- | ------------------------------------ | +| version | `"v3.8.1"` | The version of `python` | +| symbol | `"🐍 "` | Mirrors the value of option `symbol` | +| style | `"yellow bold"` | Mirrors the value of option `style` | +| virtualenv | `"venv"` | The current `virtualenv` name |
This module has some advanced configuration options. -| Variable | Défaut | Description | +| Variable | Default | Description | | --------------- | -------- | ----------------------------------------------------------------------------- | | `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. | @@ -1193,11 +1697,22 @@ The `ruby` module shows the currently installed version of Ruby. Le module est a ### Options -| Variable | Default | Description | -| ---------- | -------------- | ------------------------------------------------------ | -| `symbol` | `"💎 "` | The symbol used before displaying the version of Ruby. | -| `style` | `"bold green"` | Le style du module. | -| `disabled` | `false` | Disables the `ruby` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"💎 "` | A format string representing the symbol of Ruby. | +| `style` | `"bold green"` | Le style du module. | +| `disabled` | `false` | Disables the `ruby` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | -------- | ------------------------------------ | +| version | `v2.5.1` | The version of `ruby` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -1217,11 +1732,22 @@ The `rust` module shows the currently installed version of Rust. Le module est a ### Options -| Variable | Default | Description | -| ---------- | -------------- | ------------------------------------------------------ | -| `symbol` | `"🦀 "` | The symbol used before displaying the version of Rust. | -| `style` | `"bold green"` | Le style du module. | -| `disabled` | `false` | Disables the `rust` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🦀 "` | A format string representing the symbol of Rust | +| `style` | `"bold green"` | Le style du module. | +| `disabled` | `false` | Disables the `rust` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | ----------------- | ------------------------------------ | +| version | `v1.43.0-nightly` | The version of `rustc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -1229,7 +1755,7 @@ The `rust` module shows the currently installed version of Rust. Le module est a # ~/.config/starship.toml [rust] -symbol = "⚙️ " +format = "via [⚙️ $version](red bold)" ``` ## Singularity @@ -1238,14 +1764,22 @@ The `singularity` module shows the current singularity image, if inside a contai ### Options -| Variable | Default | Description | -| ---------- | -------------------- | ------------------------------------------------ | -| `label` | `""` | Prefix before the image name display. | -| `prefix` | `"["` | Prefix to display immediately before image name. | -| `suffix` | `"]"` | Suffix to display immediately after image name. | -| `symbol` | `""` | The symbol used before the image name. | -| `style` | `"bold dimmed blue"` | Le style du module. | -| `disabled` | `false` | Disables the `singularity` module. | +| Option | Default | Description | +| ---------- | ------------------------------------ | ------------------------------------------------ | +| `format` | `"[$symbol\\[$env\\]]($style) "` | The format for the module. | +| `symbol` | `""` | A format string displayed before the image name. | +| `style` | `"bold dimmed blue"` | Le style du module. | +| `disabled` | `false` | Disables the `singularity` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | ------------ | ------------------------------------ | +| env | `centos.img` | The current singularity image | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -1253,32 +1787,54 @@ The `singularity` module shows the current singularity image, if inside a contai # ~/.config/starship.toml [singularity] -symbol = "📦 " +format = "[📦 \\[$env\\]]($style) " ``` ## Terraform -The `terraform` module shows the currently selected terraform workspace and version. By default the terraform version is not shown, since this is slow on current versions of terraform when a lot of plugins are in use. Le module est affiché si l'une des ces conditions est remplie : +The `terraform` module shows the currently selected terraform workspace and version. By default the terraform version is not shown, since this is slow on current versions of terraform when a lot of plugins are in use. If you still want to enable it, [follow the example shown below](#with-version). Le module est affiché si l'une des ces conditions est remplie : - The current directory contains a `.terraform` folder - Current directory contains a file with the `.tf` extension ### Options -| Variable | Default | Description | -| -------------- | ------------ | ----------------------------------------------------------- | -| `symbol` | `"💠 "` | The symbol used before displaying the terraform workspace. | -| `show_version` | `false` | Shows the terraform version. Very slow on large workspaces. | -| `style` | `"bold 105"` | Le style du module. | -| `disabled` | `false` | Disables the `terraform` module. | +| Option | Default | Description | +| ---------- | ------------------------------------ | ----------------------------------------------------- | +| `format` | `"via [$symbol$workspace]($style) "` | The format string for the module. | +| `symbol` | `"💠 "` | A format string shown before the terraform workspace. | +| `style` | `"bold 105"` | Le style du module. | +| `disabled` | `false` | Disables the `terraform` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | ---------- | ------------------------------------ | +| version | `v0.12.24` | The version of `terraform` | +| workspace | `default` | The current terraform workspace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple +#### With Version + ```toml # ~/.config/starship.toml [terraform] -symbol = "🏎💨 " +format = "[🏎💨 $version$workspace]($style) " +``` + +#### Without version + +```toml +# ~/.config/starship.toml + +[terraform] +format = "[🏎💨 $workspace]($style) " ``` ## Temps @@ -1293,16 +1849,26 @@ Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur ### Options -| Variable | Default | Description | -| ----------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -| `use_12hr` | `false` | Activer le format 12h. | -| `format` | voir plus bas | Le [format chrono](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) utilisé pour formater l'heure. | -| `style` | `"bold yellow"` | Le style utilisé par le module. | -| `utc_time_offset` | `"local"` | Définir le décalage horaire UTC à utiliser. Intervalle de -24 < x < 24. Accepte des nombres décimaux pour s'adapter aux décalages de 30/45 minutes. | -| `disabled` | `true` | Désactiver le module `time`. | -| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | +| Option | Default | Description | +| ----------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `format` | `"at [$time]($style) "` | The format string for the module. | +| `use_12hr` | `false` | Activer le format 12h | +| `time_format` | voir plus bas | Le [format chrono](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) utilisé pour formater l'heure. | +| `style` | `"bold yellow"` | Le style utilisé par le module | +| `utc_time_offset` | `"local"` | Définir le décalage horaire UTC à utiliser. Range from -24 < x < 24. Accepte des nombres décimaux pour s'adapter aux décalages de 30/45 minutes. | +| `disabled` | `true` | Désactiver le module `time`. | +| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | -Si `use_12hr` a pour valeur `true`, le `format` par défaut est `"%r"`. Sinon, il est défini comme `"%T"`. Définir manuellement le `format` passera outre la valeur de `user_12hr`. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Sinon, il est défini comme `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. + +### Variables + +| Variable | Exemple | Description | +| --------- | ---------- | ----------------------------------- | +| temps | `13:08:10` | The current time. | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -1311,7 +1877,8 @@ Si `use_12hr` a pour valeur `true`, le `format` par défaut est `"%r"`. Sinon, i [time] disabled = false -format = "🕙[ %T ]" +format = "🕙[\\[ $time \\]]($style) " +time_format = "%T" utc_time_offset = "-5" time_range = "10:00:00-14:00:00" ``` @@ -1327,12 +1894,20 @@ Le module `username` affiche le nom d'utilisateur de l'utilisateur actif. Le mod ### Options -| Variable | Default | Description | -| ------------- | --------------- | ------------------------------------------------ | -| `style_root` | `"bold green"` | Le style utilisé quand l'utilisateur est root. | -| `style_user` | `"bold yellow"` | Le style utilisé pour les utilisateurs non-root. | -| `show_always` | `false` | Toujours afficher le module `username`. | -| `disabled` | `false` | Désactiver le module `username`. | +| Option | Default | Description | +| ------------- | ------------------------ | ------------------------------------------------ | +| `style_root` | `"bold green"` | Le style utilisé quand l'utilisateur est root. | +| `style_user` | `"bold yellow"` | Le style utilisé pour les utilisateurs non-root. | +| `format` | `"via [$user]($style) "` | The format for the module. | +| `show_always` | `false` | Toujours afficher le module `username`. | +| `disabled` | `false` | Désactiver le module `username`. | + +### Variables + +| Variable | Exemple | Description | +| -------- | ------------ | ------------------------------------------------------------------------------------------- | +| `style` | `"red bold"` | Mirrors the value of option `style_root` when root is logged in and `style_user` otherwise. | +| `user` | `"matchai"` | The currently logged-in user ID. | ### Exemple @@ -1340,10 +1915,13 @@ Le module `username` affiche le nom d'utilisateur de l'utilisateur actif. Le mod # ~/.config/starship.toml [username] -disabled = true +style_user = "white bold" +style_root = "black bold" +format = "user: [$user]($style) " +disabled = false +show_always = true ``` - ## Zig The `zig` module shows the currently installed version of Zig. Le module est affiché si l'une des ces conditions est remplie : @@ -1352,11 +1930,22 @@ The `zig` module shows the currently installed version of Zig. Le module est aff ### Options -| Variable | Default | Description | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | -| `style` | `"bold yellow"` | Le style du module. | -| `disabled` | `false` | Disables the `zig` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | +| `style` | `"bold yellow"` | Le style du module. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `zig` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | -------- | ------------------------------------ | +| version | `v0.6.0` | The version of `zig` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -1372,6 +1961,7 @@ symbol = "⚡️ " The `custom` modules show the output of some arbitrary commands. These modules will be shown if any of the following conditions are met: + - The current directory contains a file whose name is in `files` - The current directory contains a directory whose name is in `directories` - The current directory contains a file whose extension is in `extensions` @@ -1391,24 +1981,34 @@ The order in which custom modules are shown can be individually set by setting ` ### Options -| Variable | Default | Description | -| ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. | -| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | -| `shell` | | [See below](#custom-command-shell) | -| `description` | `""` | The description of the module that is shown when running `starship explain`. | -| `files` | `[]` | The files that will be searched in the working directory for a match. | -| `directories` | `[]` | The directories that will be searched in the working directory for a match. | -| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | -| `symbol` | `""` | The symbol used before displaying the command output. | -| `style` | `"bold green"` | Le style du module. | -| `prefix` | `""` | Prefix to display immediately before the command output. | -| `suffix` | `""` | Suffix to display immediately after the command output. | -| `disabled` | `false` | Disables this `custom` module. | +| Option | Default | Description | +| ------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `command` | | The command whose output should be printed. | +| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | +| `shell` | | [See below](#custom-command-shell) | +| `description` | `""` | The description of the module that is shown when running `starship explain`. | +| `files` | `[]` | The files that will be searched in the working directory for a match. | +| `directories` | `[]` | The directories that will be searched in the working directory for a match. | +| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | +| `symbol` | `""` | The symbol used before displaying the command output. | +| `style` | `"bold green"` | Le style du module. | +| `format` | `"[$symbol$output]($style) "` | The format for the module. | +| `disabled` | `false` | Disables this `custom` module. | + +### Variables + +| Variable | Description | +| --------- | -------------------------------------- | +| output | The output of shell command in `shell` | +| symbol | Mirrors the value of option `symbol` | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string #### Custom command shell `shell` accepts a non-empty list of strings, where: + - The first string is the path to the shell to use to execute the command. - Other following arguments are passed to the shell. @@ -1459,11 +2059,22 @@ Le module `purescript` affiche la version courante de Purescript installée. Le ### Options -| Variable | Default | Description | -| ---------- | -------------- | ------------------------------------------------------------- | -| `symbol` | `"<=> "` | Le symbole utilisé avant d'afficher la version de PureScript. | -| `style` | `"bold white"` | Le style du module. | -| `disabled` | `false` | Désactive le module `purescript`. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ------------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"<=> "` | Le symbole utilisé avant d'afficher la version de PureScript. | +| `style` | `"bold white"` | Le style du module. | +| `disabled` | `false` | Désactive le module `purescript`. | + +### Variables + +| Variable | Exemple | Description | +| --------- | -------- | ------------------------------------ | +| version | `0.13.5` | The version of `purescript` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Exemple @@ -1471,5 +2082,5 @@ Le module `purescript` affiche la version courante de Purescript installée. Le # ~/.config/starship.toml [purescript] -symbol = "<=> " +format = "via [$symbol$version](bold white)" ``` diff --git a/docs/fr-FR/faq/README.md b/docs/fr-FR/faq/README.md index 0f20d30b..2888edeb 100644 --- a/docs/fr-FR/faq/README.md +++ b/docs/fr-FR/faq/README.md @@ -5,9 +5,9 @@ - **Émulateur de terminal**: [iTerm2](https://iterm2.com/) - **Thème** : Minimal - **Palette de couleurs**: [Snazzy](https://github.com/sindresorhus/iterm2-snazzy) - - **Police d'écriture**: [Fira Code](https://github.com/tonsky/FiraCode) + - **Font**: [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads) - **Shell** : [Fish Shell](https://fishshell.com/) - - **Configuration**: [Dotfiles de matchai](https://github.com/matchai/dotfiles/blob/master/.config/fish/config.fish) + - **Configuration**: [Dotfiles de matchai](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish) - **Invite de commande**: [Starship](https://starship.rs/) ## Est-ce que `prompt_order` et `.disabled` font la même chose ? @@ -46,7 +46,7 @@ L'invite de commande utilisera toutes les données contextuelles fournies, mais ## How do I run Starship on Linux distributions with older versions of glibc? -If you get an error like "*version 'GLIBC_2.18' not found (required by starship)*" when using the prebuilt binary (for example, on CentOS 6 or 7), you can use a binary compiled with `musl` instead of `glibc`: +If you get an error like "_version 'GLIBC_2.18' not found (required by starship)_" when using the prebuilt binary (for example, on CentOS 6 or 7), you can use a binary compiled with `musl` instead of `glibc`: ```sh curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux-musl @@ -56,13 +56,13 @@ curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux- 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: - - 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 [powerline-patched font](https://github.com/powerline/fonts). +- 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/). To test your system, run the following commands in a terminal: -``` +```sh echo -e "\xf0\x9f\x90\x8d" echo -e "\xee\x82\xa0" ``` @@ -70,3 +70,19 @@ 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). 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) + +## How do I uninstall Starship? + +Starship is just as easy to uninstall as it is to install in the first place. + +1. Remove any lines in your shell config (e.g. `~/.bashrc`) used to initialize Starship. +1. Delete the Starship binary. + +If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. + +If Starship was installed using the `curl | bash` script, the following command will delete the binary: + +```sh +# Locate and delete the starship binary +rm "$(which starship)" +``` diff --git a/docs/fr-FR/guide/README.md b/docs/fr-FR/guide/README.md index 84b2d832..ddced0f0 100644 --- a/docs/fr-FR/guide/README.md +++ b/docs/fr-FR/guide/README.md @@ -2,14 +2,14 @@ Starship – Shell prompt multiplatformes + alt="Starship – Prompt Shell multi-platformes" />

GitHub Actions état du workflow + alt="Statut du workflow actions GitHub" /> Statut de l'empaquetage
-### Financial Contributors +### Contributeurs financiers -Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/starship/contribute)] +Devenez un contributeur financier et aidez-nous à soutenir notre communauté. [[Contribuer](https://opencollective.com/starship/contribute)] -#### Individuals +#### Particuliers -#### Organizations +#### Organisations -Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/starship/contribute)] +Soutenez ce projet avec votre organisation. Votre logo apparaîtra ici avec un lien vers votre site Web. [[Contribuer](https://opencollective.com/starship/contribute)] diff --git a/docs/ja-JP/advanced-config/README.md b/docs/ja-JP/advanced-config/README.md index ba287c65..51f1f857 100644 --- a/docs/ja-JP/advanced-config/README.md +++ b/docs/ja-JP/advanced-config/README.md @@ -57,7 +57,16 @@ starship_precmd_user_func="set_win_title" precmd_functions+=(set_win_title) ``` -もし結果に満足したら、永続化のためそれぞれの行を (`~/.bashrc` もしくは `~/.zsrhc`) に追加してください。 +If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. + +For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: + +```bash +function set_win_title(){ + echo -ne "\033]0; $(basename $PWD) \007" +} +starship_precmd_user_func="set_win_title" +``` ## スタイルの設定 diff --git a/docs/ja-JP/config/README.md b/docs/ja-JP/config/README.md index 1aab35a2..86ea429a 100644 --- a/docs/ja-JP/config/README.md +++ b/docs/ja-JP/config/README.md @@ -19,8 +19,8 @@ Starshipのすべての設定は、この[TOML](https://github.com/toml-lang/tom add_newline = false # Replace the "❯" symbol in the prompt with "➜" -[character] # The name of the module we are configuring is "character" -symbol = "➜" # The "symbol" segment is being set to "➜" +[character] # The name of the module we are configuring is "character" +success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green" # Disable the package module, hiding it from the prompt completely [package] @@ -28,11 +28,13 @@ disabled = true ``` `STARSHIP_CONFIG` 環境変数を使用して、デフォルトの`starship.toml` ファイルの場所を変更できます。 + ```sh export STARSHIP_CONFIG=~/.starship ``` PowerShell (Windows) で同様に `$PROFILE`にこの行を追加します。 + ```ps1 $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` @@ -41,16 +43,39 @@ $ENV:STARSHIP_CONFIG = "$HOME\.starship" **モジュール**: OSのコンテキスト情報に基づいて情報を提供するプロンプト内のコンポーネントです。 たとえば、現在のディレクトリがNodeJSプロジェクトである場合、「nodejs」モジュールは、現在コンピューターにインストールされているNodeJSのバージョンを表示します。 -**セグメント**: モジュールを構成する小さなサブコンポーネントです。 たとえば、「nodejs」モジュールの「symbol」セグメントには、バージョン番号の前に表示される文字が含まれています(デフォルト: ⬢)。 +**Variable**: Smaller sub-components that contains information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of NodeJS. -以下はNode モジュールの表現です。 次の例では、「シンボル」と「バージョン」はその中のセグメントです。 すべてのモジュールには、デフォルトの端末色であるprefixとsuffixもあります。 +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. -``` -[prefix] [symbol] [version] [suffix] - "via " "⬢" "v10.4.1" "" -``` +### Format Strings -### スタイルの設定 +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. + +#### 変数 + +A variable contains a `$` symbol followed by the name of the variable. The name of a variable only contains letters, numbers and `_`. + +For example: + +- `$version` is a format string with a variable named `version`. +- `$git_branch$git_commit` is a format string with two variables named `git_branch` and `git_commit`. +- `$git_branch $git_commit` has the two variables separated with a space. + +#### Text Group + +A text group is made up of two different parts. + +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. + +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used style the first part. + +For example: + +- `[on](red bold)` will print a string `on` with bold text colored red. +- `[⬢ $version](bold green)` will print a symbol `⬢` followed by the content of variable `version`, with bold text colored green. +- `[a [b](red) c](green)` will print `a b c` with `b` red, and `a` and `c` green. + +#### スタイルの設定 Starshipのほとんどのモジュールでは、表示スタイルを設定できます。 これは、設定を指定する文字列であるエントリ(`style`)で行われます。 スタイル文字列の例とその機能を次に示します。 完全な構文の詳細については、詳細は [高度な設定](/advanced-config/)を参照してください 。 @@ -63,17 +88,56 @@ Starshipのほとんどのモジュールでは、表示スタイルを設定で スタイリングがどのように見えるかは、端末エミュレータによって制御されることに注意してください。 たとえば、一部の端末エミュレータはテキストを太字にする代わりに色を明るくします。また、一部のカラーテーマは通常の色と明るい色と同じ値を使用します。 また、斜体のテキストを取得するには、端末で斜体をサポートする必要があります。 +#### Conditional Format Strings + +A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. + +For example: + +- `(@$region)` will show nothing if the variable `region` is `None`, otherwise `@` followed by the value of region. +- `(some text)` will always show nothing since there are no variables wrapped in the braces. +- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. + +#### Escapable characters + +The following symbols have special usage in a format string. If you want to print the following symbols, you have to escape them with a backslash (`\`). + +- $ +- \\ +- [ +- ] +- ( +- ) + +Note that `toml` has [its own escape syntax](https://github.com/toml-lang/toml#user-content-string). It is recommended to use a literal string (`''`) in your config. If you want to use a basic string (`""`), pay attention to escape the backslash `\`. + +For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: + +```toml +# with basic string +format = "\n\\$" + +# with multiline basic string +format = """ + +\\$""" + +# with literal string +format = ''' + +\$''' +``` + ## プロンプト これは、プロンプト全体のオプションのリストです。 ### オプション -| 変数 | デフォルト | 説明 | -| -------------- | ----------------------- | ---------------------------------------- | -| `add_newline` | `true` | プロンプトの開始前に新しい行を追加します。 | -| `prompt_order` | [link](#デフォルトのプロンプト表示順) | プロンプトモジュールを出力する順序を設定します。 | -| `scan_timeout` | `30` | ファイルをスキャンする際のタイムアウト時間 (milliseconds) です。 | +| Option | デフォルト | 説明 | +| -------------- | ------------------------------ | ---------------------------------------- | +| `format` | [link](#default-prompt-format) | Configure the format of the prompt. | +| `scan_timeout` | `30` | ファイルをスキャンする際のタイムアウト時間 (milliseconds) です。 | ### 設定例 @@ -81,62 +145,71 @@ Starshipのほとんどのモジュールでは、表示スタイルを設定で # ~/.config/starship.toml # Disable the newline at the start of the prompt -add_newline = false -# Overwrite a default_prompt_order and use custom prompt_order -prompt_order=["rust","line_break","package","line_break","character"] +format = "$all" + +# Use custom format +format = """ +[┌───────────────────>](bold green) +[│](bold green)$directory$rust$package +[└─>](bold green) """ + # Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 ``` -### デフォルトのプロンプト表示順 +### Default Prompt Format -デフォルトの`prompt_order`は、空の場合、または`prompt_order`が指定されていない場合に、プロンプトにモジュールが表示される順序を定義するために使用されます。 デフォルトは次のとおりです。 +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. デフォルトは次のとおりです。 ```toml -prompt_order = [ - "username", - "hostname", - "kubernetes", - "directory", - "git_branch", - "git_commit", - "git_state", - "git_status", - "hg_branch", - "docker_context", - "package", - "dotnet", - "elixir", - "elm", - "erlang", - "golang", - "haskell", - "java", - "julia", - "nim", - "nodejs", - "ocaml", - "php", - "purescript", - "python", - "ruby", - "rust", - "terraform", - "zig", - "nix_shell", - "conda", - "memory_usage", - "aws", - "env_var", - "crystal", - "cmd_duration", - "custom", - "line_break", - "jobs", - "battery", - "time", - "character", -] +format = "\n$all" + +# Which is equivalent to +format = """ + +$username\ +$hostname\ +$kubernetes\ +$directory\ +$git_branch\ +$git_commit\ +$git_state\ +$git_status\ +$hg_branch\ +$docker_context\ +$package\ +$cmake\ +$dotnet\ +$elixir\ +$elm\ +$erlang\ +$golang\ +$helm\ +$java\ +$julia\ +$nim\ +$nodejs\ +$ocaml\ +$php\ +$purescript\ +$python\ +$ruby\ +$rust\ +$terraform\ +$zig\ +$nix_shell\ +$conda\ +$memory_usage\ +$aws\ +$env_var\ +$crystal\ +$cmd_duration\ +$custom\ +$line_break\ +$jobs\ +$battery\ +$time\ +$character""" ``` ## AWS @@ -147,41 +220,80 @@ prompt_order = [ ### オプション -| 変数 | デフォルト | 説明 | -| ----------------- | --------------- | -------------------------------------------------------- | -| `symbol` | `"☁️ "` | 現在のAWSプロファイルを表示する前に表示される記号です。 | -| `displayed_items` | `all` | 表示するアイテムを選択します。 指定可能な値は以下です。[`all`, `profile`, `region`] | -| `region_aliases` | | AWS名に加えて表示するリージョンのエイリアスです。 | -| `style` | `"bold yellow"` | モジュールのスタイルです。 | -| `disabled` | `false` | `aws`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ---------------- | ---------------------------------------------------- | ----------------------------- | +| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | The format for the module. | +| `symbol` | `"☁️ "` | 現在のAWSプロファイルを表示する前に表示される記号です。 | +| `region_aliases` | | AWS名に加えて表示するリージョンのエイリアスです。 | +| `style` | `"bold yellow"` | モジュールのスタイルです。 | +| `disabled` | `false` | `aws`モジュールを無効にします。 | -### 設定例 +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | ---------------- | ------------------------------------ | +| region | `ap-northeast-1` | The current AWS region | +| profile | `astronauts` | The current AWS profile | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Examples + +#### Display everything ```toml # ~/.config/starship.toml [aws] +format = "on [$symbol$profile(\\($region\\))]($style) " style = "bold blue" symbol = "🅰 " -displayed_items = "region" [aws.region_aliases] ap-southeast-2 = "au" us-east-1 = "va" ``` +#### Display region + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$region]($style) " +style = "bold blue" +symbol = "🅰 " +[aws.region_aliases] +ap-southeast-2 = "au" +us-east-1 = "va" +``` + +#### Display profile + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$profile]($style) " +style = "bold blue" +symbol = "🅰 " +``` + ## バッテリー `battery`モジュールは、デバイスのバッテリー残量と現在の充電状態を示します。 モジュールは、デバイスのバッテリー残量が10%未満の場合にのみ表示されます。 ### オプション -| 変数 | デフォルト | 説明 | -| -------------------- | ----------------- | ------------------------- | -| `full_symbol` | `"•"` | バッテリーが満タンのときに表示される記号です。 | -| `charging_symbol` | `"⇡"` | バッテリーの充電中に表示される記号です。 | -| `discharging_symbol` | `"⇣"` | バッテリーが放電しているときに表示される記号です。 | -| `display` | [link](#バッテリーの表示) | モジュールの閾値とスタイルを表示します。 | -| `disabled` | `false` | `battery`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| -------------------- | --------------------------------- | -------------------------- | +| `full_symbol` | `"•"` | バッテリーが満タンのときに表示される記号です。 | +| `charging_symbol` | `"⇡"` | バッテリーの充電中に表示される記号です。 | +| `discharging_symbol` | `"⇣"` | バッテリーが放電しているときに表示される記号です。 | +| `format` | `"[$symbol$percentage]($style) "` | The format for the module. | +| `display` | [link](#battery-display) | モジュールの閾値とスタイルを表示します。 | +| `disabled` | `false` | `battery`モジュールを無効にします。 |

いくつかのまれなバッテリー状態のオプションもあります。 @@ -244,31 +356,85 @@ style = "bold yellow" `character`モジュールは、端末でテキストが入力される場所の横に文字(通常は矢印)を表示します。 -文字は、最後のコマンドが成功したかどうかを示します。 これは、色の変更(赤/緑)またはその形状の変更(❯/✖) の2つの方法で行うことができます。 後者は`use_symbol_for_status`に`true`設定されている場合にのみ行われます。 +文字は、最後のコマンドが成功したかどうかを示します。 It can do this in two ways: + +- changing color (`red`/`green`) +- changing shape (`❯`/`✖`) + +By default it only changes color. If you also want to change it's shape take a look at [this example](#with-custom-error-shape). ### オプション -| 変数 | デフォルト | 説明 | -| ----------------------- | -------------- | -------------------------------------------- | -| `symbol` | `"❯"` | プロンプトでテキストを入力する前に使用される記号です。 | -| `error_symbol` | `"✖"` | 前のコマンドが失敗した場合にテキスト入力の前に使用される記号です。 | -| `use_symbol_for_status` | `false` | シンボルを変更してエラーステータスを示します。 | -| `vicmd_symbol` | `"❮"` | シェルがvimの通常モードである場合、プロンプトのテキスト入力の前に使用される記号です。 | -| `style_success` | `"bold green"` | 最後のコマンドが成功した場合に使用されるスタイルです。 | -| `style_failure` | `"bold red"` | 最後のコマンドが失敗した場合に使用されるスタイルです。 | -| `disabled` | `false` | `character`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ---------------- | ------------------- | -------------------------------------------------------------------------------- | +| `format` | `"$symbol "` | The format string used before the text input. | +| `success_symbol` | `"[❯](bold green)"` | The format string used before the text input if the previous command succeeded. | +| `error_symbol` | `"[❯](bold red)"` | The format string used before the text input if the previous command failed. | +| `vicmd_symbol` | `"[❮](bold green)"` | The format string used before the text input if the shell is in vim normal mode. | +| `disabled` | `false` | `character`モジュールを無効にします。 | -### 設定例 +### Variables + +| 変数 | 設定例 | 説明 | +| ------ | --- | --------------------------------------------------------------------- | +| symbol | | A mirror of either `success_symbol`, `error_symbol` or `vicmd_symbol` | + +### Examples + +#### With custom error shape ```toml # ~/.config/starship.toml [character] -symbol = "➜" -error_symbol = "✗" -use_symbol_for_status = true +success_symbol = "[➜](bold green) " +error_symbol = "[✗](bold red) " ``` +#### Without custom error shape + +```toml +# ~/.config/starship.toml + +[character] +success_symbol = "[➜](bold green) " +error_symbol = "[➜](bold red) " +``` + +#### With custom vim shape + +```toml +# ~/.config/starship.toml + +[character] +vicmd_symbol = "[V](bold green) " +``` + +## CMake + +The `cmake` module shows the currently installed version of CMake if: + +- The current directory contains a `CMakeLists.txt` file + +### オプション + +| Option | デフォルト | 説明 | +| ---------- | ---------------------------------- | -------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🛆 "` | The symbol used before the version of cmake. | +| `style` | `"bold blue"` | モジュールのスタイルです。 | +| `disabled` | `false` | Disables the `cmake` module. | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | --------- | ------------------------------------ | +| version | `v3.17.3` | The version of cmake | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + ## コマンド実行時間 `cmd_duration`モジュールは、最後のコマンドの実行にかかった時間を示します。 モジュールが表示されるのは、コマンドが2秒以上かかった場合、または`min_time`値が存在する場合のみです。 @@ -283,13 +449,22 @@ preexecのような機能を必要とするBashユーザーは、 [rcalorasのba ### オプション -| 変数 | デフォルト | 説明 | -| ------------------- | --------------- | --------------------------- | -| `min_time` | `2_000` | 実行時間を表示する最短期間(ミリ秒単位)です。 | -| `show_milliseconds` | `false` | 実行時間の秒に加えてミリ秒を表示します。 | -| `prefix` | `took` | コマンド実行時間の直前に表示する文字列です。 | -| `style` | `"bold yellow"` | モジュールのスタイルです。 | -| `disabled` | `false` | `cmd_duration`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ------------------- | ----------------------------- | --------------------------- | +| `min_time` | `2_000` | 実行時間を表示する最短期間(ミリ秒単位)です。 | +| `show_milliseconds` | `false` | 実行時間の秒に加えてミリ秒を表示します。 | +| `format` | `"took [$duration]($style) "` | The format for the module. | +| `style` | `"bold yellow"` | モジュールのスタイルです。 | +| `disabled` | `false` | `cmd_duration`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | -------- | --------------------------------------- | +| duration | `16m40s` | The time it took to execute the command | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -298,7 +473,7 @@ preexecのような機能を必要とするBashユーザーは、 [rcalorasのba [cmd_duration] min_time = 500 -prefix = "underwent " +format = "underwent [$duration](bold yellow)" ``` ## Conda @@ -313,12 +488,23 @@ Note: これはconda自身の プロンプト修飾子 を抑制しません。` ### オプション -| 変数 | デフォルト | 説明 | -| ------------------- | -------------- | ---------------------------------------------------------------------------------------------------------------- | -| `truncation_length` | `1` | 環境が`conda create -p [path]`で作成された場合、環境パスが切り捨てられるディレクトリ数。 `0`は切り捨てがないことを意味します。 [`directory`](#directory)もご覧ください。 | -| `symbol` | `"C "` | 環境名の直前に使用されるシンボルです。 | -| `style` | `"bold green"` | モジュールのスタイルです。 | -| `disabled` | `false` | `conda`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ------------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `truncation_length` | `1` | 環境が`conda create -p [path]`で作成された場合、環境パスが切り捨てられるディレクトリ数。 `0`は切り捨てがないことを意味します。 [`directory`](#directory)もご覧ください。 | +| `symbol` | `"🅒 "` | 環境名の直前に使用されるシンボルです。 | +| `style` | `"bold green"` | モジュールのスタイルです。 | +| `format` | `"[$symbol$environment]($style) "` | The format for the module. | +| `disabled` | `false` | `conda`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| ----------- | ------------ | ------------------------------------ | +| environment | `astronauts` | The current conda environment | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -326,7 +512,7 @@ Note: これはconda自身の プロンプト修飾子 を抑制しません。` # ~/.config/starship.toml [conda] -style = "dimmed green" +format = "[$symbol$environment](dimmed green) " ``` ## Crystal @@ -338,11 +524,22 @@ style = "dimmed green" ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | ------------ | ------------------------------ | -| `symbol` | `"🔮 "` | Crystalのバージョンを表示する前に使用される記号です。 | -| `style` | `"bold red"` | モジュールのスタイルです。 | -| `disabled` | `false` | `crystal`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ---------- | ---------------------------------- | ------------------------------ | +| `symbol` | `"🔮 "` | Crystalのバージョンを表示する前に使用される記号です。 | +| `style` | `"bold red"` | モジュールのスタイルです。 | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | `crystal`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | --------- | ------------------------------------ | +| version | `v0.32.1` | The version of `crystal` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -350,8 +547,7 @@ style = "dimmed green" # ~/.config/starship.toml [crystal] -symbol = "✨ " -style = "bold blue" +format = "via [✨ $version](bold blue) " ``` ## ディレクトリ @@ -364,18 +560,20 @@ fishスタイルのpwdオプションを使用すると、切り捨てられた ### オプション -| 変数 | デフォルト | 説明 | -| ------------------- | ------------- | ----------------------------- | -| `truncation_length` | `3` | 現在のディレクトリを切り捨てる親フォルダーの数です。 | -| `truncate_to_repo` | `true` | 現在いるgitリポジトリのルートに切り捨てるかどうかです。 | -| `prefix` | `"in "` | ディレクトリ名の直前に表示するprefixです。 | -| `style` | `"bold cyan"` | モジュールのスタイルです。 | -| `disabled` | `false` | `directory`モジュールを無効にします。 | +| 変数 | デフォルト | 説明 | +| ------------------------ | ----------------------------------------------- | ----------------------------------------------------- | +| `truncation_length` | `3` | 現在のディレクトリを切り捨てる親フォルダーの数です。 | +| `truncate_to_repo` | `true` | 現在いるgitリポジトリのルートに切り捨てるかどうかです。 | +| `format` | `"[$path]($style)[$lock_symbol]($lock_style) "` | The format for the module. | +| `style` | `"bold cyan"` | モジュールのスタイルです。 | +| `disabled` | `false` | `directory`モジュールを無効にします。 | +| `read_only_symbol` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_symbol_style` | `"red"` | The style for the read only symbol. |
このモジュールは、どのようにディレクトリを表示するかについての高度なオプションをいくつか持っています。 -| 変数 | デフォルト | 説明 | +| Advanced Option | デフォルト | 説明 | | --------------------------- | ------ | ------------------------------------------------ | | `substitutions` | | A table of substitutions to be made to the path. | | `fish_style_pwd_dir_length` | `0` | fish shellのpwdパスロジックを適用するときに使用する文字数です。 | @@ -393,6 +591,15 @@ fishスタイルのpwdオプションを使用すると、切り捨てられた
+### Variables + +| 変数 | 設定例 | 説明 | +| --------- | --------------------- | ----------------------------------- | +| path | `"D:/Projects"` | The current directory path | +| style\* | `"black bold dimmed"` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + ### 設定例 ```toml @@ -408,12 +615,23 @@ truncation_length = 8 ### オプション -| 変数 | デフォルト | 説明 | -| ----------------- | ------------- | --------------------------------------------------------------------------------------- | -| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context . | -| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. | -| `style` | `"bold blue"` | モジュールのスタイルです。 | -| `disabled` | `true` | `docker_context`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ----------------- | ---------------------------------- | --------------------------------------------------------------------------------------- | +| `format` | `"via [$symbol$context]($style) "` | The format for the module. | +| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context. | +| `style` | `"blue bold"` | モジュールのスタイルです。 | +| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. | +| `disabled` | `true` | `docker_context`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | -------------- | ------------------------------------ | +| context | `test_context` | The current docker context | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -421,25 +639,51 @@ truncation_length = 8 # ~/.config/starship.toml [docker_context] -symbol = "🐋 " +format = "via [🐋 $context](blue bold)" ``` ## Dotnet `dotnet` モジュールはカレントディレクトリに関係する.NET Core SDKのバージョンを表示します。 もし SDKは現在のディレクトリに固定されているのであれば、その固定されたバージョンが表示されます。 それ以外の場合、モジュール SDKの最新のインストールバージョンを示します。 -このモジュールは、カレントディレクトリに次のファイルのいずれかが存在する場合にのみプロンプトに表示されます。: `global.json`, `project.json`, `*.sln`, `*.csproj`, `*.fsproj`, `*.xproj` 正しく使用するには、.NET Coreコマンドラインツールもインストールする必要があります。 +This module will only be shown in your prompt when one or more of the following files are present in the current directory: + +- `global.json` +- `project.json` +- `Directory.Build.props` +- `Directory.Build.targets` +- `Packages.props` +- `*.sln` +- `*.csproj` +- `*.fsproj` +- `*.xproj` + +You'll also need the .NET Core SDK installed in order to use it correctly. 内部的に、このモジュールは自身のバージョン検知のメカニズムを利用します。 `dotnet --version` を実行するより2倍速く実行できますが、.NET project一般的でないディレクトリlayoutの場合は間違ったバージョンが示されてしまうことがあります。 速度よりも精度が重要な場合は、次の方法でメカニズムを無効にできます。 モジュールオプションで`heuristic = false `を設定します。 +The module will also show the Target Framework Moniker () when there is a csproj file in the current directory. + ### オプション -| 変数 | デフォルト | 説明 | -| ----------- | ------------- | ------------------------------------ | -| `symbol` | `•NET "` | dotnetのバージョンを表示する前に使用される記号です。 | -| `heuristic` | `true` | より高速なバージョン検出を使用して、starshipの動作を維持します。 | -| `style` | `"bold blue"` | モジュールのスタイルです。 | -| `disabled` | `false` | `dotnet`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ----------- | ---------------------------------------- | ------------------------------------ | +| `format` | `"v[$symbol$version( 🎯 $tfm)]($style) "` | The format for the module. | +| `symbol` | `•NET "` | dotnetのバージョンを表示する前に使用される記号です。 | +| `heuristic` | `true` | より高速なバージョン検出を使用して、starshipの動作を維持します。 | +| `style` | `"bold blue"` | モジュールのスタイルです。 | +| `disabled` | `false` | `dotnet`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | ---------------- | ------------------------------------------------------------------ | +| version | `v3.1.201` | The version of `dotnet` sdk | +| tfm | `netstandard2.0` | The Target Framework Moniker that the current project is targeting | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -460,11 +704,23 @@ 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"` | モジュールのスタイルです。 | -| `disabled` | `false` | Disables the `elixir` module. | +| 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. | +| `disabled` | `false` | Disables the `elixir` module. | + +### Variables + +| 変数 | 設定例 | 説明 | +| ----------- | ------- | ------------------------------------ | +| version | `v1.10` | The version of `elixir` | +| otp_version | | The otp version of `elixir` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -487,12 +743,22 @@ symbol = "🔮 " ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | ------------- | -------------------------- | -| `symbol` | `"🌳 "` | Elmのバージョンを表示する前に使用される記号です。 | -| `style` | `"bold cyan"` | モジュールのスタイルです。 | -| `disabled` | `false` | `elm`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🌳 "` | A format string representing the symbol of Elm. | +| `style` | `"cyan bold"` | モジュールのスタイルです。 | +| `disabled` | `false` | `elm`モジュールを無効にします。 | +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | --------- | ------------------------------------ | +| version | `v0.19.1` | The version of `elm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -500,7 +766,7 @@ symbol = "🔮 " # ~/.config/starship.toml [elm] -symbol = " " +format = "via [ $version](cyan bold) " ``` ## 環境変数 @@ -512,15 +778,23 @@ symbol = " " ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | --------------------- | ------------------------------------- | -| `symbol` | | 環境変数を表示する前に使用される記号です。 | -| `variable` | | 表示される環境変数です。 | -| `default` | | 上のvariableが定義されていない場合に表示されるデフォルトの値です。 | -| `prefix` | `""` | 変数の直前に表示するprefixです。 | -| `suffix` | `""` | 変数の直後に表示するsuffixです。 | -| `style` | `"dimmed bold black"` | モジュールのスタイルです。 | -| `disabled` | `false` | `env_var`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ---------- | ------------------------------ | ------------------------------------- | +| `symbol` | | 環境変数を表示する前に使用される記号です。 | +| `variable` | | 表示される環境変数です。 | +| `default` | | 上のvariableが定義されていない場合に表示されるデフォルトの値です。 | +| `format` | `"with [$env_value]($style) "` | The format for the module. | +| `disabled` | `false` | `env_var`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | ------------------------------------------- | ------------------------------------------ | +| env_value | `Windows NT` (if *variable* would be `$OS`) | The environment value of option `variable` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | `black bold dimmed` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -541,11 +815,22 @@ The `erlang` module shows the currently installed version of Erlang/OTP. 次の ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | ---------- | -------------------------------------------------------- | -| `symbol` | `"🖧 "` | The symbol used before displaying the version of Erlang. | -| `style` | `bold red` | The style for this module. | -| `disabled` | `false` | Disables the `erlang` module. | +| Option | デフォルト | 説明 | +| ---------- | ---------------------------------- | -------------------------------------------------------- | +| `symbol` | `"🖧 "` | The symbol used before displaying the version of erlang. | +| `style` | `"bold red"` | モジュールのスタイルです。 | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `erlang` module. | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | --------- | ------------------------------------ | +| version | `v22.1.3` | The version of `erlang` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -553,7 +838,7 @@ The `erlang` module shows the currently installed version of Erlang/OTP. 次の # ~/.config/starship.toml [erlang] -symbol = "e " +format = "via [e $version](bold red) " ``` ## Git ブランチ @@ -562,13 +847,24 @@ symbol = "e " ### オプション -| 変数 | デフォルト | 説明 | -| ------------------- | --------------- | ------------------------------------------- | -| `symbol` | `" "` | 現在のディレクトリのリポジトリのブランチ名の前に使用されるシンボルです。 | -| `truncation_length` | `2^63 - 1` | gitブランチをX書記素に切り捨てます。 | -| `truncation_symbol` | `"…"` | ブランチ名切り捨てられていることを示すための記号です。 記号なしに「」も使用できます。 | -| `style` | `"bold purple"` | モジュールのスタイルです。 | -| `disabled` | `false` | `git_branch`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ------------------- | -------------------------------- | -------------------------------------------------------------------------------- | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. Use `"$branch"` to refer to the current branch name. | +| `symbol` | `" "` | A format string representing the symbol of git branch. | +| `style` | `"bold purple"` | モジュールのスタイルです。 | +| `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes. | +| `truncation_symbol` | `"…"` | ブランチ名切り捨てられていることを示すための記号です。 You can use `""` for no symbol. | +| `disabled` | `false` | `git_branch`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| branch | `master` | The current branch name, falls back to `HEAD` if there's no current branch (e.g. git detached HEAD). | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -587,14 +883,22 @@ truncation_symbol = "" ### オプション -| 変数 | デフォルト | 説明 | -| -------------------- | -------------- | -------------------------------------- | -| `commit_hash_length` | `7` | 表示されるgitコミットハッシュの長さです。 | -| `prefix` | `"("` | このモジュールの先頭に表示される文字列です。 | -| `suffix` | `")"` | このモジュールの末尾に表示される文字列です。 | -| `style` | `"bold green"` | モジュールのスタイルです。 | -| `only_detached` | `true` | 切り離されたHEAD状態のときのみgit commit hashを表示します | -| `disabled` | `false` | `git_commit`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| -------------------- | ------------------------------ | -------------------------------------- | +| `commit_hash_length` | `7` | 表示されるgitコミットハッシュの長さです。 | +| `format` | `"[\\($hash\\)]($style) "` | The format for the module. | +| `style` | `"bold green"` | モジュールのスタイルです。 | +| `only_detached` | `true` | 切り離されたHEAD状態のときのみgit commit hashを表示します | +| `disabled` | `false` | `git_commit`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | --------- | ----------------------------------- | +| hash | `b703eb3` | The current git commit hash | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -611,18 +915,29 @@ truncation_length = 4 ### オプション -| 変数 | デフォルト | 説明 | -| ------------------ | ------------------ | -------------------------------------------------------- | -| `rebase` | `"REBASING"` | `rebase`進行中に表示されるテキストです。 | -| `merge` | `"MERGING"` | `merge`進行中に表示されるテキストです。 | -| `revert` | `"REVERTING"` | `revert`進行中に表示されるテキストです。 | -| `cherry_pick` | `"CHERRY-PICKING"` | `cherry-pick`進行中に表示されるテキストです。 | -| `bisect` | `"BISECTING"` | `disect`進行中に表示されるテキストです。 | -| `am` | `"AM"` | `apply-mailbox` (`git am`) の進行中に表示されるテキストです。 | -| `am_or_rebase` | `"AM/REBASE"` | あいまいな`apply-mailbox`または`rebase`が進行中のときに表示されるテキストです。 | -| `progress_divider` | `"/"` | 現在の進行量と合計進行量を分ける記号またはテキストです。 (例: `" of "` 、 `"3 of 10"`) | -| `style` | `"bold yellow"` | モジュールのスタイルです。 | -| `disabled` | `false` | `git_state`モジュールを無効にします。 | +| 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. | +| `cherry_pick` | `"CHERRY-PICKING"` | A format string displayed when a `cherry-pick` is in progress. | +| `bisect` | `"BISECTING"` | A format string displayed when a `bisect` is in progress. | +| `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. | +| `disabled` | `false` | `git_state`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| ---------------- | ---------- | ----------------------------------- | +| state | `REBASING` | The current state of the repo | +| progress_current | `1` | The current operation progress | +| progress_total | `2` | The total operation progress | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -630,8 +945,8 @@ truncation_length = 4 # ~/.config/starship.toml [git_state] -progress_divider = " of " -cherry_pick = "🍒 PICKING" +format = "[\\($state( $progress_current of $progress_total)\\)]($style) " +cherry_pick = "[🍒 PICKING](bold red)" ``` ## Git の状態 @@ -640,37 +955,54 @@ cherry_pick = "🍒 PICKING" ### オプション -| 変数 | デフォルト | 説明 | -| ------------------ | -------------------------- | ------------------------------- | -| `conflicted` | `"="` | このブランチにはマージの競合があります。 | -| `conflicted_count` | [link](#git-status-counts) | 競合の数の表示およびスタイル設定します。 | -| `ahead` | `"⇡"` | このブランチは、追跡されるブランチよりも先にあります。 | -| `behind` | `"⇣"` | このブランチは、追跡されているブランチの背後にあります。 | -| `diverged` | `"⇕"` | このブランチは、追跡されているブランチから分岐しています。 | -| `untracked` | `"?"` | 作業ディレクトリに追跡されていないファイルがあります。 | -| `untracked_count` | [link](#git-status-counts) | 追跡されていないファイルの数を表示およびスタイル設定します。 | -| `stashed` | `"$"` | ローカルリポジトリ用のスタッシュが存在します。 | -| `stashed_count` | [link](#git-status-counts) | スタッシュの数の表示およびスタイル設定します。 | -| `modified` | `"!"` | 作業ディレクトリにファイルの変更があります。 | -| `modified_count` | [link](#git-status-counts) | 変更されたファイルの数を表示およびスタイル設定します。 | -| `staged` | `"+"` | 新しいファイルがステージング領域に追加されました。 | -| `staged_count` | [link](#git-status-counts) | ステージングされたファイルの数を表示およびスタイル設定します。 | -| `renamed` | `"»"` | 名前が変更されたファイルがステージング領域に追加されました。 | -| `renamed_count` | [link](#git-status-counts) | 名前を変更したファイルの数を表示およびスタイル設定します。 | -| `deleted` | `"✘"` | ファイルの削除がステージング領域に追加されました。 | -| `deleted_count` | [link](#git-status-counts) | 削除されたファイルの数を表示およびスタイルします。 | -| `show_sync_count` | `false` | 追跡されているブランチの先行/後方カウントを表示します。 | -| `prefix` | `[` | このモジュールの先頭に表示される文字列です。 | -| `suffix` | `]` | このモジュールの末尾に表示される文字列です。 | -| `style` | `"bold red"` | モジュールのスタイルです。 | -| `disabled` | `false` | `git_status`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ----------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | "([\[$all_status$ahead_behind\]]($style) )" | The default format for `git_status` | +| `conflicted` | `"="` | このブランチにはマージの競合があります。 | +| `ahead` | `"⇡"` | The format of `ahead` | +| `behind` | `"⇣"` | The format of `behind` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `show_sync_count` | `false` | 追跡されているブランチの先行/後方カウントを表示します。 | +| `style` | `"bold red"` | モジュールのスタイルです。 | +| `disabled` | `false` | `git_status`モジュールを無効にします。 | -#### Git Statusのカウント +### Variables -| 変数 | デフォルト | 説明 | -| --------- | ------- | --------------------------------- | -| `enabled` | `false` | ファイルの数を表示します。 | -| `style` | | オプションで、モジュールとは異なるカウントのスタイルを設定します。 | +The following variables can be used in `format`: + +| 変数 | 説明 | +| -------------- | --------------------------------------------------------------------------------------------- | +| `all_status` | Shortcut for`$conflicted$stashed$deleted$renamed$modified$staged$untracked` | +| `ahead_behind` | Displays `diverged` `ahead` or `behind` format string based on the current status of the repo | +| `conflicted` | Displays `conflicted` when this branch has merge conflicts. | +| `untracked` | Displays `untracked` when there are untracked files in the working directory. | +| `stashed` | Displays `stashed` when a stash exists for the local repository. | +| `modified` | Displays `modified` when there are file modifications in the working directory. | +| `staged` | Displays `staged` when a new file has been added to the staging area. | +| `renamed` | Displays `renamed` when a renamed file has been added to the staging area. | +| `deleted` | Displays `deleted` when a file's deletion has been added to the staging area. | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +The following variables can be used in `diverged`: + +| 変数 | 説明 | +| -------------- | ---------------------------------------------- | +| `ahead_count` | Number of commits ahead of the tracking branch | +| `behind_count` | Number of commits behind the tracking branch | + +The following variables can be used in `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` and `deleted`: + +| 変数 | 説明 | +| ------- | ------------- | +| `count` | ファイルの数を表示します。 | ### 設定例 @@ -685,10 +1017,7 @@ diverged = "😵" untracked = "🤷‍" stashed = "📦" modified = "📝" -staged.value = "++" -staged.style = "green" -staged_count.enabled = true -staged_count.style = "green" +staged = '[++\($count\)](green)' renamed = "👅" deleted = "🗑" ``` @@ -708,11 +1037,22 @@ deleted = "🗑" ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | ------------- | ----------------------------- | -| `symbol` | `"🐹 "` | Golangのバージョンを表示する前に使用される記号です。 | -| `style` | `"bold cyan"` | モジュールのスタイルです。 | -| `disabled` | `false` | `golang`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ---------- | ---------------------------------- | ---------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐹 "` | A format string representing the symbol of Go. | +| `style` | `"bold cyan"` | モジュールのスタイルです。 | +| `disabled` | `false` | `golang`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | --------- | ------------------------------------ | +| version | `v1.12.1` | The version of `go` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -720,30 +1060,42 @@ deleted = "🗑" # ~/.config/starship.toml [golang] -symbol = "🏎💨 " +format = "via [🏎💨 $version](bold cyan) " ``` -## Haskell -The `haskell` module shows the currently installed version of Haskell Stack version. 次の条件のいずれかが満たされると、モジュールが表示されます。 +## Helm -- カレントディレクトリに`stack.yaml`ファイルが含まれている +The `helm` module shows the currently installed version of Helm. 次の条件のいずれかが満たされると、モジュールが表示されます。 + +- カレントディレクトリに`helmfile.yaml`ファイルが含まれている +- The current directory contains a `Chart.yaml` file ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | ------------ | --------------------------------------------------------- | -| `symbol` | `"λ "` | The symbol used before displaying the version of Haskell. | -| `style` | `"bold red"` | モジュールのスタイルです。 | -| `disabled` | `false` | Disables the `haskell` module. | +| Option | デフォルト | 説明 | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⎈ "` | A format string representing the symbol of Helm. | +| `style` | `"bold white"` | モジュールのスタイルです。 | +| `disabled` | `false` | Disables the `helm` module. | +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | -------- | ------------------------------------ | +| version | `v3.1.1` | The version of `helm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 ```toml # ~/.config/starship.toml -[haskell] -symbol = " " +[helm] +format = "via [⎈ $version](bold white) " ``` ## ホスト名 @@ -752,14 +1104,23 @@ symbol = " " ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | --------------------- | --------------------------------------------------------------------------- | -| `ssh_only` | `true` | SSHセッションに接続されている場合にのみホスト名を表示します。 | -| `prefix` | `""` | ホスト名の直前に表示するprefixです。 | -| `suffix` | `""` | ホスト名の直後に表示するsuffixです。 | -| `trim_at` | `"."` | この文字が最初にマッチするまでをホスト名と認識します。 `"."`は最初の. までをホスト名として認識します。 `""`を指定した場合トリムしません。 | -| `style` | `"bold dimmed green"` | モジュールのスタイルです。 | -| `disabled` | `false` | `hostname`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ---------- | --------------------------- | --------------------------------------------------------------------------- | +| `ssh_only` | `true` | SSHセッションに接続されている場合にのみホスト名を表示します。 | +| `trim_at` | `"."` | この文字が最初にマッチするまでをホスト名と認識します。 `"."`は最初の. までをホスト名として認識します。 `""`を指定した場合トリムしません。 | +| `format` | `"on [$hostname]($style) "` | The format for the module. | +| `style` | `"bold dimmed green"` | モジュールのスタイルです。 | +| `disabled` | `false` | `hostname`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | --- | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -768,8 +1129,7 @@ symbol = " " [hostname] ssh_only = false -prefix = "⟪" -suffix = "⟫" +format = "on [$hostname](bold red) " trim_at = ".companyname.com" disabled = false ``` @@ -783,11 +1143,22 @@ disabled = false ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | -------------- | --------------------------- | -| `symbol` | `"☕ "` | Javaのバージョンを表示する前に使用される記号です。 | -| `style` | `"dimmed red"` | モジュールのスタイルです。 | -| `disabled` | `false` | `java`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ---------- | -------------------------------------- | ----------------------------------------------- | +| `format` | `"via [${symbol}${version}]($style) "` | The format for the module. | +| `symbol` | `"☕ "` | A format string representing the symbol of Java | +| `style` | `"red dimmed"` | モジュールのスタイルです。 | +| `disabled` | `false` | `java`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | ----- | ------------------------------------ | +| version | `v14` | The version of `java` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -804,12 +1175,23 @@ symbol = "🌟 " ### オプション -| 変数 | デフォルト | 説明 | -| ----------- | ------------- | ---------------------- | -| `symbol` | `"✦"` | ジョブの数を表示する前に使用される記号です。 | -| `threshold` | `1` | 超過した場合、ジョブの数を表示します。 | -| `style` | `"bold blue"` | モジュールのスタイルです。 | -| `disabled` | `false` | `jobs`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ----------- | ----------------------------- | ------------------------------------------------ | +| `threshold` | `1` | 超過した場合、ジョブの数を表示します。 | +| `format` | `"[$symbol$number]($style) "` | The format for the module. | +| `symbol` | `"✦"` | A format string representing the number of jobs. | +| `style` | `"bold blue"` | モジュールのスタイルです。 | +| `disabled` | `false` | `jobs`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | --- | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -831,11 +1213,22 @@ threshold = 4 ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | --------------- | ---------------------------- | -| `symbol` | `"ஃ "` | Juliaのバージョンを表示する前に使用される記号です。 | -| `style` | `"bold purple"` | モジュールのスタイルです。 | -| `disabled` | `false` | `julia`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ---------- | ---------------------------------- | ------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"ஃ "` | A format string representing the symbol of Julia. | +| `style` | `"bold purple"` | モジュールのスタイルです。 | +| `disabled` | `false` | `julia`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | -------- | ------------------------------------ | +| version | `v1.4.0` | The version of `julia` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -845,9 +1238,10 @@ threshold = 4 [julia] symbol = "∴ " ``` + ## Kubernetes -現在のKubernetesコンテキスト名と、設定されている場合は、kubeconfigファイルに基づいてネームスペースを表示します。 ネームスペースはkubconfigで設定されている必要があります。それは `kubectl config set-context starship-cluster --namespace astronaut` のようなコマンドで設定することができます。 `$KUBECONFIG` 環境変数が設定されている場合、モジュールはそれを使用します `~/.kube/config` は使用しません。 +Displays the current Kubernetes context name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`. ::: tip @@ -857,12 +1251,25 @@ symbol = "∴ " ### オプション -| 変数 | デフォルト | 説明 | -| ----------------- | ------------- | ----------------------------------- | -| `symbol` | `"☸ "` | クラスタ情報を表示する前に使用される記号です。 | -| `context_aliases` | | Table of context aliases to display | -| `style` | `"bold blue"` | モジュールのスタイルです。 | -| `disabled` | `true` | `Kubernetes`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- | +| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. | +| `format` | `"on [$symbol$context( \\($namespace\\))]($style) "` | 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. | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | -------------------- | ---------------------------------------- | +| context | `starship-cluster` | The current kubernetes context | +| namespace | `starship-namespace` | If set, the current kubernetes namespace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -870,8 +1277,7 @@ symbol = "∴ " # ~/.config/starship.toml [kubernetes] -symbol = "⛵ " -style = "dimmed green" +format = "on [⛵ $context \\($namespace\\)](dimmed green) " disabled = false [kubernetes.context_aliases] "dev.local.cluster.k8s" = "dev" @@ -883,7 +1289,7 @@ disabled = false ### オプション -| 変数 | デフォルト | 説明 | +| Option | デフォルト | 説明 | | ---------- | ------- | ------------------------------------- | | `disabled` | `false` | `line_break`モジュールを無効にして、プロンプトを1行にします。 | @@ -911,15 +1317,26 @@ disabled = true ### オプション -| 変数 | デフォルト | 説明 | -| ----------------- | --------------------- | ----------------------------- | -| `show_percentage` | `false` | メモリ使用量を割合で表示します。 | -| `show_swap` | `true` | 合計スワップがゼロ以外の場合、スワップ使用量を表示します。 | -| `threshold` | `75` | この閾値を超えない限り、メモリ使用率は表示されません。 | -| `symbol` | `"🐏 "` | メモリ使用率を表示する前に使用される記号です。 | -| `separator` | `" | "` | RAMとスワップの使用を分離する記号またはテキストです。 | -| `style` | `"bold dimmed white"` | モジュールのスタイルです。 | -| `disabled` | `true` | `memory_usage`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ----------- | --------------------------------------------- | --------------------------- | +| `threshold` | `75` | この閾値を超えない限り、メモリ使用率は表示されません。 | +| `format` | `"via $symbol [${ram}( | ${swap})]($style) "` | The format for the module. | +| `symbol` | `"🐏"` | メモリ使用率を表示する前に使用される記号です。 | +| `style` | `"bold dimmed white"` | モジュールのスタイルです。 | +| `disabled` | `true` | `memory_usage`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| ------------- | ------------- | ------------------------------------------------------------------ | +| ram | `31GiB/65GiB` | The usage/total RAM of the current system memory. | +| ram_pct | `48%` | The percentage of the current system memory. | +| swap\** | `1GiB/4GiB` | The swap memory size of the current system swap memory file. | +| swap_pct\** | `77%` | The swap memory percentage of the current system swap memory file. | +| symbol | `🐏` | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string \*\*: The SWAP file information is only displayed if detected on the current system ### 設定例 @@ -942,13 +1359,24 @@ style = "bold dimmed green" ### オプション -| 変数 | デフォルト | 説明 | -| ------------------- | --------------- | -------------------------------------------------------------------------------------------- | -| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. | -| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes | -| `truncation_symbol` | `"…"` | ブランチ名切り捨てられていることを示すための記号です。 | -| `style` | `"bold purple"` | モジュールのスタイルです。 | -| `disabled` | `true` | Disables the `hg_branch` module. | +| Option | デフォルト | 説明 | +| ------------------- | -------------------------------- | -------------------------------------------------------------------------------------------- | +| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. | +| `style` | `"bold purple"` | モジュールのスタイルです。 | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. | +| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes | +| `truncation_symbol` | `"…"` | ブランチ名切り捨てられていることを示すための記号です。 | +| `disabled` | `true` | Disables the `hg_branch` module. | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | -------- | ------------------------------------ | +| branch | `master` | The active mercurial branch | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -956,7 +1384,7 @@ style = "bold dimmed green" # ~/.config/starship.toml [hg_branch] -symbol = "🌱 " +format = "on [🌱 $branch](bold purple)" truncation_length = 4 truncation_symbol = "" ``` @@ -964,18 +1392,30 @@ truncation_symbol = "" ## Nim The `nim` module shows the currently installed version of Nim. 次の条件のいずれかが満たされると、モジュールが表示されます。 -- The current directory contains a `nim.cfg` file + +- カレントディレクトリに`nim.cfg`ファイルが含まれている - The current directory contains a file with the `.nim` extension - The current directory contains a file with the `.nims` extension - The current directory contains a file with the `.nimble` extension ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | -| `style` | `"bold yellow"` | モジュールのスタイルです。 | -| `disabled` | `false` | Disables the `nim` module. | +| Option | デフォルト | 説明 | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module | +| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | +| `style` | `"bold yellow"` | モジュールのスタイルです。 | +| `disabled` | `false` | Disables the `nim` module. | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | -------- | ------------------------------------ | +| version | `v1.2.0` | The version of `nimc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -993,14 +1433,25 @@ symbol = "🎣 " ### オプション -| 変数 | デフォルト | 説明 | -| ------------ | ------------- | ------------------------------------------------- | -| `use_name` | `false` | nix-shellの名前を表示します。 | -| `impure_msg` | `"impure"` | impureメッセージをカスタマイズします。 | -| `pure_msg` | `"pure"` | pureメッセージをカスタマイズします。 | -| `symbol` | `"❄️ "` | The symbol used before displaying the shell name. | -| `style` | `"bold blue"` | モジュールのスタイルです。 | -| `disabled` | `false` | `nix_shell`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ------------ | -------------------------------------------------- | ----------------------------------------------------- | +| `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. | +| `pure_msg` | `"pure"` | A format string shown when the shell is pure. | +| `disabled` | `false` | `nix_shell`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | ------- | ------------------------------------ | +| state | `pure` | The state of the nix-shell | +| name | `lorri` | The name of the nix-shell | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -1009,10 +1460,9 @@ symbol = "🎣 " [nix_shell] disabled = true -use_name = true -impure_msg = "impure shell" -pure_msg = "pure shell" -symbol = "☃️ " +impure_msg = "[impure shell](bold red)" +pure_msg = "[pure shell](bold green)" +format = "via [☃️ $state( \\($name\\))](bold blue) " ``` ## NodeJS @@ -1022,15 +1472,27 @@ symbol = "☃️ " - カレントディレクトリに`package.json`ファイルが含まれている - The current directory contains a `.node-version` file - カレントディレクトリに`node_modules`ディレクトリが含まれている -- カレントディレクトリに`.js`の拡張子のファイルが含まれている +- The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension +- The current directory contains a file with the `.ts` extension ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | -------------- | ----------------------------- | -| `symbol` | `"⬢ "` | NodeJSのバージョンを表示する前に使用される記号です。 | -| `style` | `"bold green"` | モジュールのスタイルです。 | -| `disabled` | `false` | `nodejs`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ---------- | ---------------------------------- | -------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⬢ "` | A format string representing the symbol of NodeJS. | +| `style` | `"bold green"` | モジュールのスタイルです。 | +| `disabled` | `false` | `nodejs`モジュールを無効にします。 | + +###  Variables + +| 変数 | 設定例 | 説明 | +| --------- | ---------- | ------------------------------------ | +| version | `v13.12.0` | The version of `node` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -1038,7 +1500,7 @@ symbol = "☃️ " # ~/.config/starship.toml [nodejs] -symbol = "🤖 " +format = "via [🤖 $version](bold green) " ``` ## パッケージのバージョン @@ -1057,12 +1519,23 @@ symbol = "🤖 " ### オプション -| 変数 | デフォルト | 説明 | -| ----------------- | ------------ | --------------------------------------------------------- | -| `symbol` | `"📦 "` | パッケージのバージョンを表示する前に使用される記号です。 | -| `style` | `"bold 208"` | モジュールのスタイルです。 | -| `display_private` | `false` | Enable displaying version for packages marked as private. | -| `disabled` | `false` | `package`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ----------------- | ---------------------------------- | --------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"📦 "` | パッケージのバージョンを表示する前に使用される記号です。 | +| `style` | `"bold 208"` | モジュールのスタイルです。 | +| `display_private` | `false` | Enable displaying version for packages marked as private. | +| `disabled` | `false` | `package` モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | -------- | ------------------------------------ | +| version | `v1.0.0` | The version of your package | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -1070,7 +1543,7 @@ symbol = "🤖 " # ~/.config/starship.toml [package] -symbol = "🎁 " +format = "via [🎁 $version](208 bold) " ``` ## OCaml @@ -1086,11 +1559,22 @@ The `ocaml` module shows the currently installed version of OCaml. 次の条件 ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | --------------- | ------------------------------------------------------- | -| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | -| `style` | `"bold yellow"` | モジュールのスタイルです。 | -| `disabled` | `false` | Disables the `ocaml` module. | +| Option | デフォルト | 説明 | +| ---------- | ---------------------------------- | ------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format string for the module. | +| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | +| `style` | `"bold yellow"` | モジュールのスタイルです。 | +| `disabled` | `false` | Disables the `ocaml` module. | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | --------- | ------------------------------------ | +| version | `v4.10.0` | The version of `ocaml` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -1098,24 +1582,35 @@ The `ocaml` module shows the currently installed version of OCaml. 次の条件 # ~/.config/starship.toml [ocaml] -symbol = "🐪 " +format = "via [🐪 $version]($style) " ``` ## PHP `php`モジュールは、現在インストールされているPHPのバージョンを示します。 次の条件のいずれかが満たされると、モジュールが表示されます。 -- The current directory contains a `composer.json` file +- カレントディレクトリに`composer.json`ファイルが含まれている - The current directory contains a `.php-version` file - カレントディレクトリに`.php`の拡張子のファイルが含まれている ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | ------------ | -------------------------- | -| `symbol` | `"🐘 "` | PHPのバージョンを表示する前に使用される記号です。 | -| `style` | `"bold 147"` | モジュールのスタイルです。 | -| `disabled` | `false` | `php`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ---------- | ---------------------------------- | -------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐘 "` | PHPのバージョンを表示する前に使用される記号です。 | +| `style` | `"147 bold"` | モジュールのスタイルです。 | +| `disabled` | `false` | `php`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | -------- | ------------------------------------ | +| version | `v7.3.8` | The version of `php` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -1123,7 +1618,7 @@ symbol = "🐪 " # ~/.config/starship.toml [php] -symbol = "🔹 " +format = "via [🔹 $version](147 bold) " ``` ## Python @@ -1146,14 +1641,23 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name ### オプション -| 変数 | デフォルト | 説明 | -| -------------------- | --------------- | -------------------------------------------------------------------------- | -| `symbol` | `"🐍 "` | Pythonのバージョンを表示する前に使用される記号です。 | -| `pyenv_version_name` | `false` | pyenvを使用してPythonバージョンを取得します | -| `pyenv_prefix` | `"pyenv "` | pyenvバージョン表示の前のprefix (デフォルトの表示は`pyenv MY_VERSION`) です | -| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | -| `style` | `"bold yellow"` | モジュールのスタイルです。 | -| `disabled` | `false` | `python`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| -------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${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バージョンを取得します | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `disabled` | `false` | `python`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| ---------- | --------------- | ------------------------------------ | +| version | `"v3.8.1"` | The version of `python` | +| symbol | `"🐍 "` | Mirrors the value of option `symbol` | +| style | `"yellow bold"` | Mirrors the value of option `style` | +| virtualenv | `"venv"` | The current `virtualenv` name |
This module has some advanced configuration options. @@ -1194,11 +1698,22 @@ pyenv_prefix = "foo " ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | ------------ | --------------------------- | -| `symbol` | `"💎 "` | Rubyのバージョンを表示する前に使用される記号です。 | -| `style` | `"bold red"` | モジュールのスタイルです。 | -| `disabled` | `false` | `ruby`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"💎 "` | A format string representing the symbol of Ruby. | +| `style` | `"bold red"` | モジュールのスタイルです。 | +| `disabled` | `false` | `ruby`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | -------- | ------------------------------------ | +| version | `v2.5.1` | The version of `ruby` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -1218,11 +1733,22 @@ symbol = "🔺 " ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | ------------ | --------------------------- | -| `symbol` | `"🦀 "` | Rustのバージョンを表示する前に使用される記号です。 | -| `style` | `"bold red"` | モジュールのスタイルです。 | -| `disabled` | `false` | `rust`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🦀 "` | A format string representing the symbol of Rust | +| `style` | `"bold red"` | モジュールのスタイルです。 | +| `disabled` | `false` | `rust`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | ----------------- | ------------------------------------ | +| version | `v1.43.0-nightly` | The version of `rustc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -1230,7 +1756,7 @@ symbol = "🔺 " # ~/.config/starship.toml [rust] -symbol = "⚙️ " +format = "via [⚙️ $version](red bold)" ``` ## Singularity @@ -1239,14 +1765,22 @@ The `singularity` module shows the current singularity image, if inside a contai ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | -------------------- | ------------------------------------------------ | -| `label` | `""` | Prefix before the image name display. | -| `prefix` | `"["` | Prefix to display immediately before image name. | -| `suffix` | `"]"` | Suffix to display immediately after image name. | -| `symbol` | `""` | The symbol used before the image name. | -| `style` | `"bold dimmed blue"` | モジュールのスタイルです。 | -| `disabled` | `false` | Disables the `singularity` module. | +| Option | デフォルト | 説明 | +| ---------- | ------------------------------------ | ------------------------------------------------ | +| `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. | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | ------------ | ------------------------------------ | +| env | `centos.img` | The current singularity image | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -1254,32 +1788,54 @@ The `singularity` module shows the current singularity image, if inside a contai # ~/.config/starship.toml [singularity] -symbol = "📦 " +format = "[📦 \\[$env\\]]($style) " ``` ## Terraform -`terraform`モジュールには、現在選択されているterraformワークスペースとバージョンが表示されます。 デフォルトでは、Terraformのバージョンは表示されません。これは、多くのプラグインが使用されている場合、Terraformの現在のバージョンでは遅いためです。 次の条件のいずれかが満たされると、モジュールが表示されます。 +`terraform`モジュールには、現在選択されているterraformワークスペースとバージョンが表示されます。 デフォルトでは、Terraformのバージョンは表示されません。これは、多くのプラグインが使用されている場合、Terraformの現在のバージョンでは遅いためです。 If you still want to enable it, [follow the example shown below](#with-version). 次の条件のいずれかが満たされると、モジュールが表示されます。 - カレントディレクトリに`.terraform`フォルダが含まれている - カレントディレクトリに`.tf`の拡張子のファイルが含まれている ### オプション -| 変数 | デフォルト | 説明 | -| -------------- | ------------ | --------------------------------------------- | -| `symbol` | `"💠 "` | Terraform ワークスペースを表示する前に使用される記号です。 | -| `show_version` | `false` | Terraformのバージョンを表示します。 大きなワークスペースでは非常に遅くなります。 | -| `style` | `"bold 105"` | モジュールのスタイルです。 | -| `disabled` | `false` | `terraform`モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ---------- | ------------------------------------ | ----------------------------------------------------- | +| `format` | `"via [$symbol$workspace]($style) "` | The format string for the module. | +| `symbol` | `"💠 "` | A format string shown before the terraform workspace. | +| `style` | `"bold 105"` | モジュールのスタイルです。 | +| `disabled` | `false` | `terraform`モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | ---------- | ------------------------------------ | +| version | `v0.12.24` | The version of `terraform` | +| workspace | `default` | The current terraform workspace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 +#### With Version + ```toml # ~/.config/starship.toml [terraform] -symbol = "🏎💨 " +format = "[🏎💨 $version$workspace]($style) " +``` + +#### Without version + +```toml +# ~/.config/starship.toml + +[terraform] +format = "[🏎💨 $workspace]($style) " ``` ## 時刻 @@ -1294,16 +1850,26 @@ symbol = "🏎💨 " ### オプション -| 変数 | デフォルト | 説明 | -| ----------------- | --------------- | ----------------------------------------------------------------------------------------------------- | -| `use_12hr` | `false` | Enables 12 hour formatting. | -| `format` | この表の下を参照してください | 時刻のフォーマットに使用される[クロノフォーマット文字列](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) です。 | -| `style` | `"bold yellow"` | The style for the module time. | -| `utc_time_offset` | `"local"` | 使用するUTCオフセットを設定します。 -24から24までの間で設定可能です。 フロートが30/45分のタイムゾーンオフセットに対応できるようにします。 | -| `disabled` | `true` | `time`モジュールを無効にします。 | -| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | +| Option | デフォルト | 説明 | +| ----------------- | ----------------------- | ----------------------------------------------------------------------------------------------------- | +| `format` | `"at [$time]($style) "` | The format string for the module. | +| `use_12hr` | `false` | 12時間のフォーマットを有効にします。 | +| `time_format` | この表の下を参照してください | 時刻のフォーマットに使用される[クロノフォーマット文字列](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) です。 | +| `style` | `"bold yellow"` | モジュールのスタイルです。 | +| `utc_time_offset` | `"local"` | 使用するUTCオフセットを設定します。 Range from -24 < x < 24. フロートが30/45分のタイムゾーンオフセットに対応できるようにします。 | +| `disabled` | `true` | `time`モジュールを無効にします。 | +| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | -`use_12hr` が `true` の場合、`format` のデフォルトは `"%r"` です。 それ以外の場合、デフォルトは`"%T"`です。 `format`を手動で設定すると、`use_12hr`の設定が上書きされます。 +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. それ以外の場合、デフォルトは`"%T"`です。 Manually setting `time_format` will override the `use_12hr` setting. + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | ---------- | ----------------------------------- | +| 時刻 | `13:08:10` | The current time. | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -1312,7 +1878,8 @@ symbol = "🏎💨 " [time] disabled = false -format = "🕙[ %T ]" +format = "🕙[\\[ $time \\]]($style) " +time_format = "%T" utc_time_offset = "-5" time_range = "10:00:00-14:00:00" ``` @@ -1328,12 +1895,20 @@ time_range = "10:00:00-14:00:00" ### オプション -| 変数 | デフォルト | 説明 | -| ------------- | --------------- | ------------------------- | -| `style_root` | `"bold red"` | ユーザーがrootのときに使用されるスタイルです。 | -| `style_user` | `"bold yellow"` | 非rootユーザーに使用されるスタイルです。 | -| `show_always` | `false` | `username` モジュールを常に表示します。 | -| `disabled` | `false` | `username` モジュールを無効にします。 | +| Option | デフォルト | 説明 | +| ------------- | ------------------------ | -------------------------- | +| `style_root` | `"bold red"` | ユーザーがrootのときに使用されるスタイルです。 | +| `style_user` | `"bold yellow"` | 非rootユーザーに使用されるスタイルです。 | +| `format` | `"via [$user]($style) "` | The format for the module. | +| `show_always` | `false` | `username` モジュールを常に表示します。 | +| `disabled` | `false` | `username` モジュールを無効にします。 | + +### Variables + +| 変数 | 設定例 | 説明 | +| ------- | ------------ | ------------------------------------------------------------------------------------------- | +| `style` | `"red bold"` | Mirrors the value of option `style_root` when root is logged in and `style_user` otherwise. | +| `user` | `"matchai"` | The currently logged-in user ID. | ### 設定例 @@ -1341,10 +1916,13 @@ time_range = "10:00:00-14:00:00" # ~/.config/starship.toml [username] -disabled = true +style_user = "white bold" +style_root = "black bold" +format = "user: [$user]($style) " +disabled = false +show_always = true ``` - ## Zig The `zig` module shows the currently installed version of Zig. 次の条件のいずれかが満たされると、モジュールが表示されます。 @@ -1353,11 +1931,22 @@ The `zig` module shows the currently installed version of Zig. 次の条件の ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | -| `style` | `"bold yellow"` | モジュールのスタイルです。 | -| `disabled` | `false` | Disables the `zig` module. | +| Option | デフォルト | 説明 | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | +| `style` | `"bold yellow"` | モジュールのスタイルです。 | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `zig` module. | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | -------- | ------------------------------------ | +| version | `v0.6.0` | The version of `zig` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -1373,6 +1962,7 @@ symbol = "⚡️ " The `custom` modules show the output of some arbitrary commands. These modules will be shown if any of the following conditions are met: + - The current directory contains a file whose name is in `files` - The current directory contains a directory whose name is in `directories` - The current directory contains a file whose extension is in `extensions` @@ -1392,24 +1982,34 @@ The order in which custom modules are shown can be individually set by setting ` ### オプション -| 変数 | デフォルト | 説明 | -| ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. | -| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | -| `shell` | | [この表の下を参照してください](#custom-command-shell) | -| `説明` | `""` | The description of the module that is shown when running `starship explain`. | -| `files` | `[]` | The files that will be searched in the working directory for a match. | -| `directories` | `[]` | The directories that will be searched in the working directory for a match. | -| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | -| `symbol` | `""` | The symbol used before displaying the command output. | -| `style` | `"bold green"` | モジュールのスタイルです。 | -| `prefix` | `""` | Prefix to display immediately before the command output. | -| `suffix` | `""` | Suffix to display immediately after the command output. | -| `disabled` | `false` | Disables this `custom` module. | +| Option | デフォルト | 説明 | +| ------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `command` | | The command whose output should be printed. | +| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | +| `shell` | | [この表の下を参照してください](#custom-command-shell) | +| `説明` | `""` | The description of the module that is shown when running `starship explain`. | +| `files` | `[]` | The files that will be searched in the working directory for a match. | +| `directories` | `[]` | The directories that will be searched in the working directory for a match. | +| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | +| `symbol` | `""` | The symbol used before displaying the command output. | +| `style` | `"bold green"` | モジュールのスタイルです。 | +| `format` | `"[$symbol$output]($style) "` | The format for the module. | +| `disabled` | `false` | Disables this `custom` module. | + +### Variables + +| 変数 | 説明 | +| --------- | -------------------------------------- | +| output | The output of shell command in `shell` | +| symbol | Mirrors the value of option `symbol` | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string #### Custom command shell `shell` accepts a non-empty list of strings, where: + - The first string is the path to the shell to use to execute the command. - Other following arguments are passed to the shell. @@ -1460,11 +2060,22 @@ The `purescript` module shows the currently installed version of PureScript vers ### オプション -| 変数 | デフォルト | 説明 | -| ---------- | -------------- | ------------------------------------------------------------ | -| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | -| `style` | `"bold white"` | モジュールのスタイルです。 | -| `disabled` | `false` | Disables the `purescript` module. | +| Option | デフォルト | 説明 | +| ---------- | ---------------------------------- | ------------------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | +| `style` | `"bold white"` | モジュールのスタイルです。 | +| `disabled` | `false` | Disables the `purescript` module. | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | -------- | ------------------------------------ | +| version | `0.13.5` | The version of `purescript` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 設定例 @@ -1472,5 +2083,5 @@ The `purescript` module shows the currently installed version of PureScript vers # ~/.config/starship.toml [purescript] -symbol = "<=> " +format = "via [$symbol$version](bold white)" ``` diff --git a/docs/ja-JP/faq/README.md b/docs/ja-JP/faq/README.md index be1bb68a..917b75f6 100644 --- a/docs/ja-JP/faq/README.md +++ b/docs/ja-JP/faq/README.md @@ -5,9 +5,9 @@ - **ターミナルエミュレータ**:[ iTerm2 ](https://iterm2.com/) - **テーマ**: Minimal - **カラースキーム**: [Snazzy](https://github.com/sindresorhus/iterm2-snazzy) - - **フォント**: [Fira Code](https://github.com/tonsky/FiraCode) + - **Font**: [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads) - **シェル**: [Fish Shell](https://fishshell.com/) - - **設定**: [matchaiのDotfiles](https://github.com/matchai/dotfiles/blob/master/.config/fish/config.fish) + - **設定**: [matchaiのDotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish) - **プロンプト**: [Starship](https://starship.rs/) ## `prompt_order` と `.disabled` は同じことをしますか? @@ -46,7 +46,7 @@ starship prompt --help ## 古いバージョンの glibc を使用する Linux ディストリビューションで Starship を実行するにはどうすればよいですか? -"*version 'GLIBC_2のようなエラーが表示された場合。 8' が見つかりません (starshipで要求されます)*" プリビルドバイナリを使用しています(例えば、 CentOS 6 または 7 では、`glibc`の代わりに`musl`でコンパイルされたバイナリを使用できます。 +If you get an error like "_version 'GLIBC_2.18' not found (required by starship)_" when using the prebuilt binary (for example, on CentOS 6 or 7), you can use a binary compiled with `musl` instead of `glibc`: ```sh curl -fsSL https://starship.rs/install.sh | bash -s --- -platform unknown-linux-musl @@ -56,13 +56,13 @@ curl -fsSL https://starship.rs/install.sh | bash -s --- -platform unknown-linux- 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: - - 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 [powerline-patched font](https://github.com/powerline/fonts). +- 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/). To test your system, run the following commands in a terminal: -``` +```sh echo -e "\xf0\x9f\x90\x8d" echo -e "\xee\x82\xa0" ``` @@ -70,3 +70,19 @@ 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). 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) + +## How do I uninstall Starship? + +Starship is just as easy to uninstall as it is to install in the first place. + +1. Remove any lines in your shell config (e.g. `~/.bashrc`) used to initialize Starship. +1. Delete the Starship binary. + +If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. + +If Starship was installed using the `curl | bash` script, the following command will delete the binary: + +```sh +# Locate and delete the starship binary +rm "$(which starship)" +``` diff --git a/docs/ja-JP/guide/README.md b/docs/ja-JP/guide/README.md index 96364959..61b6d234 100644 --- a/docs/ja-JP/guide/README.md +++ b/docs/ja-JP/guide/README.md @@ -121,7 +121,7 @@ ### 必要なもの -- [Powerline フォント](https://github.com/powerline/fonts) がターミナルにインストールされて有効になっている必要があります(例えば [Fira Code](https://github.com/tonsky/FiraCode) を試してみてください)。 +- A [Nerd Font](https://www.nerdfonts.com/) installed and enabled in your terminal (for example, try the [Fira Code Nerd Font](https://www.nerdfonts.com/font-downloads)). ### 入門 @@ -224,7 +224,7 @@ ### コードに貢献していただいた方々 -このプロジェクトは、貢献したすべての人々のおかげで存在します。 [[Contribute](CONTRIBUTING.md)]. +このプロジェクトは、貢献したすべての人々のおかげで存在します。 [[Contribute](https://github.com/starship/starship/blob/master/CONTRIBUTING.md)]. ### 財政的な貢献をしていただいた方々 diff --git a/docs/pt-BR/advanced-config/README.md b/docs/pt-BR/advanced-config/README.md index 65f8c4cc..2a2eb26e 100644 --- a/docs/pt-BR/advanced-config/README.md +++ b/docs/pt-BR/advanced-config/README.md @@ -1,16 +1,16 @@ # Configuração avançada -While Starship is a versatile shell, sometimes you need to do more than edit `starship.toml` to get it to do certain things. This page details some of the more advanced configuration techniques used in starship. +Ainda que Starship seja um shell versátil, às vezes você precisará fazer algumas outras coisas além de editar o arquivo `starship.toml`. Esta página detalha algumas das configurações mais avançadas usadas em starship. ::: warning -The configurations in this section are subject to change in future releases of Starship. +As configurações nesta seção estão sujeitas a alterações em futuras versões do Starship. ::: -## Custom pre-prompt and pre-execution Commands in Bash +## Comandos personalizados de pre-prompt e pre-execution no Bash -Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. However, Starship does give you limited ability to insert your own functions into the prompt-rendering procedure: +O Bash não possui uma estrutura formal para os hooks preexec/precmd como a maioria dos outros shells. Por esse motivo, é difícil fornecer hooks totalmente customizáveis no `bash`. No entanto, Starship te oferece uma capacidade limitada de inserir suas próprias funções na processo de prompt-rendering: - To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do @@ -31,9 +31,9 @@ trap blastoff DEBUG # Trap DEBUG *before* running starship eval $(starship init bash) ``` -## Change Window Title +## Altera o título da janela -Some shell prompts will automatically change the window title for you (e.g. to reflect your working directory). Fish even does it by default. Starship does not do this, but it's fairly straightforward to add this functionality to `bash` or `zsh`. +Some shell prompts will automatically change the window title for you (e.g. to reflect your working directory). Fish faz isso por padrão. Starship does not do this, but it's fairly straightforward to add this functionality to `bash` or `zsh`. First, define a window title change function (identical in bash and zsh): @@ -57,7 +57,16 @@ In `zsh`, add this to the `precmd_functions` array: precmd_functions+=(set_win_title) ``` -If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zsrhc`) to make it permanent. +If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. + +For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: + +```bash +function set_win_title(){ + echo -ne "\033]0; $(basename $PWD) \007" +} +starship_precmd_user_func="set_win_title" +``` ## Estilo dos textos diff --git a/docs/pt-BR/config/README.md b/docs/pt-BR/config/README.md index 88f1e71f..a12c66b1 100644 --- a/docs/pt-BR/config/README.md +++ b/docs/pt-BR/config/README.md @@ -15,24 +15,26 @@ mkdir -p ~/.config && touch ~/.config/starship.toml Todas as configurações do starship são feitas neste arquivo [TOML](https://github.com/toml-lang/toml): ```toml -# Não imprime uma nova linha no início do prompt +# Don't print a new line at the start of the prompt add_newline = false -# Substitui o símbolo "❯" por "➜" no prompt. -[character] # O nome do módulo que estamos configurando é "character" -symbol = "➜" # O segmento "symbol" está sendo configurado para "➜" +# Replace the "❯" symbol in the prompt with "➜" +[character] # The name of the module we are configuring is "character" +success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green" -# Desabilita o módulo de pacotes, ocultando completamente do prompt. +# Disable the package module, hiding it from the prompt completely [package] disabled = true ``` Você pode alterar o caminho padrão do arquivo `starship.toml` com a variável de ambiente `STARSHIP_CONFIG`: + ```sh export STARSHIP_CONFIG=~/.starship ``` No PowerShell (Windows) você pode adicionar a seguinte linha no seu `$PROFILE`: + ```ps1 $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` @@ -41,16 +43,39 @@ $ENV:STARSHIP_CONFIG = "$HOME\.starship" **Módulo**: Um componente no prompt que fornece informações baseado no contexto do seu SO. Por exemplo, o módulo "nodejs" mostra a versão do NodeJS instalado no seu computador, se o diretório atual for um projeto NodeJS. -**Segmento**: Configurações que compõem um módulo. Por exemplo, o segmento "symbol" do módulo "nodejs" contém o caractere que é exibido antes da versão (⬢ por padrão). +**Variable**: Smaller sub-components that contains information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of NodeJS. -Aqui está a representação do módulo Node. No exemplo a seguir, "symbol" e "version" são segmentos dentro dele. Todos os módulos também tem um prefixo e um sufixo que são da cor do terminal padrão. +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. -``` -[prefix] [symbol] [version] [suffix] - "via " "⬢" "v10.4.1" "" -``` +### Format Strings -### Estilo dos textos +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. + +#### Variável + +A variable contains a `$` symbol followed by the name of the variable. The name of a variable only contains letters, numbers and `_`. + +For example: + +- `$version` is a format string with a variable named `version`. +- `$git_branch$git_commit` is a format string with two variables named `git_branch` and `git_commit`. +- `$git_branch $git_commit` has the two variables separated with a space. + +#### Text Group + +A text group is made up of two different parts. + +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. + +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used style the first part. + +For example: + +- `[on](red bold)` will print a string `on` with bold text colored red. +- `[⬢ $version](bold green)` will print a symbol `⬢` followed by the content of variable `version`, with bold text colored green. +- `[a [b](red) c](green)` will print `a b c` with `b` red, and `a` and `c` green. + +#### Estilo dos textos A maioria dos módulos do starship permite que você configure o estilo de exibição dos textos. Isso é feito através de um parâmetro (geralmente chamado `style`) que é uma string especificando a configuração. Aqui estão alguns exemplos de strings de estilo e o que elas fazem. Para detalhes sobre a sintaxe completa, consulte o [guia de configurações avançadas](/advanced-config/). @@ -63,80 +88,128 @@ A maioria dos módulos do starship permite que você configure o estilo de exibi Note que a aparência do estilo será controlado pelo seu terminal. Por exemplo, alguns terminais deixarão as cores mais brilhantes ao invés de deixar o texto em negrito, ou alguns temas podem usar as mesmas cores para cores brilhantes e normais. Além disso, para textos em itálico, o terminal precisa ter suporte. -## Prompt +#### Conditional Format Strings + +A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. + +For example: + +- `(@$region)` will show nothing if the variable `region` is `None`, otherwise `@` followed by the value of region. +- `(some text)` will always show nothing since there are no variables wrapped in the braces. +- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. + +#### Escapable characters + +The following symbols have special usage in a format string. If you want to print the following symbols, you have to escape them with a backslash (`\`). + +- $ +- \\ +- [ +- ] +- ( +- ) + +Note that `toml` has [its own escape syntax](https://github.com/toml-lang/toml#user-content-string). It is recommended to use a literal string (`''`) in your config. If you want to use a basic string (`""`), pay attention to escape the backslash `\`. + +For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: + +```toml +# with basic string +format = "\n\\$" + +# with multiline basic string +format = """ + +\\$""" + +# with literal string +format = ''' + +\$''' +``` + +## Prompt de Comando This is the list of prompt-wide configuration options. -### Options +### Opções -| Variable | Default | Description | -| -------------- | ----------------------------- | ------------------------------------------------------ | -| `add_newline` | `true` | Add a new line before the start of the prompt. | -| `prompt_order` | [link](#default-prompt-order) | Configure the order in which the prompt module occurs. | -| `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). | +| Option | Padrão | Descrição | +| -------------- | ------------------------------ | ----------------------------------------------------- | +| `format` | [link](#default-prompt-format) | Configure the format of the prompt. | +| `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). | -### Example +### Exemplo ```toml # ~/.config/starship.toml # Disable the newline at the start of the prompt -add_newline = false -# Overwrite a default_prompt_order and use custom prompt_order -prompt_order=["rust","line_break","package","line_break","character"] +format = "$all" + +# Use custom format +format = """ +[┌───────────────────>](bold green) +[│](bold green)$directory$rust$package +[└─>](bold green) """ + # Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 ``` -### Default Prompt Order +### Default Prompt Format -The default `prompt_order` is used to define the order in which modules are shown in the prompt, if empty or no `prompt_order` is provided. The default is as shown: +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. Os valores padrão são os seguintes: ```toml -prompt_order = [ - "username", - "hostname", - "kubernetes", - "directory", - "git_branch", - "git_commit", - "git_state", - "git_status", - "hg_branch", - "docker_context", - "package", - "dotnet", - "elixir", - "elm", - "erlang", - "golang", - "haskell", - "java", - "julia", - "nim", - "nodejs", - "ocaml", - "php", - "purescript", - "python", - "ruby", - "rust", - "terraform", - "zig", - "nix_shell", - "conda", - "memory_usage", - "aws", - "env_var", - "crystal", - "cmd_duration", - "custom", - "line_break", - "jobs", - "battery", - "time", - "character", -] +format = "\n$all" + +# Which is equivalent to +format = """ + +$username\ +$hostname\ +$kubernetes\ +$directory\ +$git_branch\ +$git_commit\ +$git_state\ +$git_status\ +$hg_branch\ +$docker_context\ +$package\ +$cmake\ +$dotnet\ +$elixir\ +$elm\ +$erlang\ +$golang\ +$helm\ +$java\ +$julia\ +$nim\ +$nodejs\ +$ocaml\ +$php\ +$purescript\ +$python\ +$ruby\ +$rust\ +$terraform\ +$zig\ +$nix_shell\ +$conda\ +$memory_usage\ +$aws\ +$env_var\ +$crystal\ +$cmd_duration\ +$custom\ +$line_break\ +$jobs\ +$battery\ +$time\ +$character""" ``` ## AWS @@ -145,48 +218,87 @@ The `aws` module shows the current AWS region and profile. This is based on `AWS When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var. -### Options +### Opções -| Variable | Default | Description | -| ----------------- | --------------- | --------------------------------------------------------------------------- | -| `symbol` | `"☁️ "` | The symbol used before displaying the current AWS profile. | -| `displayed_items` | `all` | Choose which item to display. Possible values: [`all`, `profile`, `region`] | -| `region_aliases` | | Table of region aliases to display in addition to the AWS name. | -| `style` | `"bold yellow"` | The style for the module. | -| `disabled` | `false` | Disables the `AWS` module. | +| Option | Padrão | Descrição | +| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- | +| `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. | +| `disabled` | `false` | Disables the `AWS` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | ---------------- | ------------------------------------ | +| region | `ap-northeast-1` | The current AWS region | +| profile | `astronauts` | The current AWS profile | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Examples + +#### Display everything ```toml # ~/.config/starship.toml [aws] +format = "on [$symbol$profile(\\($region\\))]($style) " style = "bold blue" symbol = "🅰 " -displayed_items = "region" [aws.region_aliases] ap-southeast-2 = "au" us-east-1 = "va" ``` -## Battery +#### Display region + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$region]($style) " +style = "bold blue" +symbol = "🅰 " +[aws.region_aliases] +ap-southeast-2 = "au" +us-east-1 = "va" +``` + +#### Display profile + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$profile]($style) " +style = "bold blue" +symbol = "🅰 " +``` + +## Bateria The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%. -### Options +### Opções -| Variable | Default | Description | -| -------------------- | ------------------------ | ------------------------------------------------- | -| `full_symbol` | `"•"` | The symbol shown when the battery is full. | -| `charging_symbol` | `"⇡"` | The symbol shown when the battery is charging. | -| `discharging_symbol` | `"⇣"` | The symbol shown when the battery is discharging. | -| `display` | [link](#battery-display) | Display threshold and style for the module. | -| `disabled` | `false` | Disables the `battery` module. | +| Option | Padrão | Descrição | +| -------------------- | --------------------------------- | ------------------------------------------------- | +| `full_symbol` | `"•"` | The symbol shown when the battery is full. | +| `charging_symbol` | `"⇡"` | The symbol shown when the battery is charging. | +| `discharging_symbol` | `"⇣"` | The symbol shown when the battery is discharging. | +| `format` | `"[$symbol$percentage]($style) "` | The format for the module. | +| `display` | [link](#battery-display) | Display threshold and style for the module. | +| `disabled` | `false` | Disables the `battery` module. |
There are also options for some uncommon battery states. -| Variable | Description | +| Variável | Descrição | | ---------------- | --------------------------------------------------- | | `unknown_symbol` | The symbol shown when the battery state is unknown. | | `empty_symbol` | The symbol shown when the battery state is empty. | @@ -195,7 +307,7 @@ Note: Battery indicator will be hidden if the status is `unknown` or `empty` unl
-### Example +### Exemplo ```toml # ~/.config/starship.toml @@ -206,9 +318,9 @@ charging_symbol = "⚡️" discharging_symbol = "💀" ``` -### Battery Display +### Indicador de bateria -The `display` configuration option is used to define when the battery indicator should be shown (threshold) and what it looks like (style). If no `display` is provided. The default is as shown: +The `display` configuration option is used to define when the battery indicator should be shown (threshold) and what it looks like (style). If no `display` is provided. Os valores padrão são os seguintes: ```toml [[battery.display]] @@ -216,16 +328,16 @@ threshold = 10 style = "bold red" ``` -#### Options +#### Opções The `display` option is an array of the following table. -| Variable | Description | +| Variável | Descrição | | ----------- | ----------------------------------------------- | | `threshold` | The upper bound for the display option. | | `style` | The style used if the display option is in use. | -#### Example +#### Exemplo ```toml [[battery.display]] # "bold red" style when capacity is between 0% and 10% @@ -240,40 +352,94 @@ style = "bold yellow" ``` -## Character +## Caractere The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal. -The character will tell you whether the last command was successful or not. It can do this in two ways: by changing color (red/green) or by changing its shape (❯/✖). The latter will only be done if `use_symbol_for_status` is set to `true`. +The character will tell you whether the last command was successful or not. It can do this in two ways: -### Options +- changing color (`red`/`green`) +- changing shape (`❯`/`✖`) -| Variable | Default | Description | -| ----------------------- | -------------- | ----------------------------------------------------------------------------------- | -| `symbol` | `"❯"` | The symbol used before the text input in the prompt. | -| `error_symbol` | `"✖"` | The symbol used before text input if the previous command failed. | -| `use_symbol_for_status` | `false` | Indicate error status by changing the symbol. | -| `vicmd_symbol` | `"❮"` | The symbol used before the text input in the prompt if shell is in vim normal mode. | -| `style_success` | `"bold green"` | The style used if the last command was successful. | -| `style_failure` | `"bold red"` | The style used if the last command failed. | -| `disabled` | `false` | Disables the `character` module. | +By default it only changes color. If you also want to change it's shape take a look at [this example](#with-custom-error-shape). -### Example +### Opções + +| Option | Padrão | Descrição | +| ---------------- | ------------------- | -------------------------------------------------------------------------------- | +| `format` | `"$symbol "` | The format string used before the text input. | +| `success_symbol` | `"[❯](bold green)"` | The format string used before the text input if the previous command succeeded. | +| `error_symbol` | `"[❯](bold red)"` | The format string used before the text input if the previous command failed. | +| `vicmd_symbol` | `"[❮](bold green)"` | The format string used before the text input if the shell is in vim normal mode. | +| `disabled` | `false` | Desabilita o módulo `character`. | + +### Variables + +| Variável | Exemplo | Descrição | +| -------- | ------- | --------------------------------------------------------------------- | +| symbol | | A mirror of either `success_symbol`, `error_symbol` or `vicmd_symbol` | + +### Examples + +#### With custom error shape ```toml # ~/.config/starship.toml [character] -symbol = "➜" -error_symbol = "✗" -use_symbol_for_status = true +success_symbol = "[➜](bold green) " +error_symbol = "[✗](bold red) " ``` -## Command Duration +#### Without custom error shape + +```toml +# ~/.config/starship.toml + +[character] +success_symbol = "[➜](bold green) " +error_symbol = "[➜](bold red) " +``` + +#### With custom vim shape + +```toml +# ~/.config/starship.toml + +[character] +vicmd_symbol = "[V](bold green) " +``` + +## CMake + +The `cmake` module shows the currently installed version of CMake if: + +- The current directory contains a `CMakeLists.txt` file + +### Opções + +| Option | Padrão | Descrição | +| ---------- | ---------------------------------- | -------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🛆 "` | The symbol used before the version of cmake. | +| `style` | `"bold blue"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `cmake` module. | + +### Variables + +| Variável | Exemplo | Descrição | +| --------- | --------- | ------------------------------------ | +| version | `v3.17.3` | The version of cmake | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +## Tempo de execução do comando The `cmd_duration` module shows how long the last command took to execute. The module will be shown only if the command took longer than two seconds, or the `min_time` config value, if it exists. -::: warning Do not hook the DEBUG trap in Bash +::: warning Não utilize o DEBUG-trap no Bash If you are running Starship in `bash`, do not hook the `DEBUG` trap after running `eval $(starship init $0)`, or this module **will** break. @@ -281,24 +447,33 @@ If you are running Starship in `bash`, do not hook the `DEBUG` trap after runnin Bash users who need preexec-like functionality can use [rcaloras's bash_preexec framework](https://github.com/rcaloras/bash-preexec). Simply define the arrays `preexec_functions` and `precmd_functions` before running `eval $(starship init $0)`, and then proceed as normal. -### Options +### Opções -| Variable | Default | Description | -| ------------------- | --------------- | ---------------------------------------------------------- | -| `min_time` | `2_000` | Shortest duration to show time for (in milliseconds). | -| `show_milliseconds` | `false` | Show milliseconds in addition to seconds for the duration. | -| `prefix` | `took` | Prefix to display immediately before the command duration. | -| `style` | `"bold yellow"` | The style for the module. | -| `disabled` | `false` | Disables the `cmd_duration` module. | +| Option | Padrão | Descrição | +| ------------------- | ----------------------------- | ---------------------------------------------------------- | +| `min_time` | `2_000` | Shortest duration to show time for (in milliseconds). | +| `show_milliseconds` | `false` | Show milliseconds in addition to seconds for the duration. | +| `format` | `"took [$duration]($style) "` | The format for the module. | +| `style` | `"bold yellow"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `cmd_duration` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | -------- | --------------------------------------- | +| duration | `16m40s` | The time it took to execute the command | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [cmd_duration] min_time = 500 -prefix = "underwent " +format = "underwent [$duration](bold yellow)" ``` ## Conda @@ -311,22 +486,33 @@ This does not suppress conda's own prompt modifier, you may want to run `conda c ::: -### Options +### Opções -| Variable | Default | Description | -| ------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `truncation_length` | `1` | The number of directories the environment path should be truncated to, if the environment was created via `conda create -p [path]`. `0` means no truncation. Also see the [`directory`](#directory) module. | -| `symbol` | `"C "` | The symbol used before the environment name. | -| `style` | `"bold green"` | The style for the module. | -| `disabled` | `false` | Disables the `conda` module. | +| Option | Padrão | Descrição | +| ------------------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `truncation_length` | `1` | The number of directories the environment path should be truncated to, if the environment was created via `conda create -p [path]`. `0` means no truncation. Also see the [`directory`](#directory) module. | +| `symbol` | `"🅒 "` | The symbol used before the environment name. | +| `style` | `"bold green"` | O estilo do módulo. | +| `format` | `"[$symbol$environment]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `conda` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| ----------- | ------------ | ------------------------------------ | +| environment | `astronauts` | The current conda environment | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [conda] -style = "dimmed green" +format = "[$symbol$environment](dimmed green) " ``` ## Crystal @@ -336,25 +522,35 @@ The `crystal` module shows the currently installed version of Crystal. The modul - The current directory contains a `shard.yml` file - The current directory contains a `.cr` file -### Options +### Opções -| Variable | Default | Description | -| ---------- | ------------ | --------------------------------------------------------- | -| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. | -| `style` | `"bold red"` | The style for the module. | -| `disabled` | `false` | Disables the `crystal` module. | +| Option | Padrão | Descrição | +| ---------- | ---------------------------------- | --------------------------------------------------------- | +| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. | +| `style` | `"bold red"` | O estilo do módulo. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `crystal` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | --------- | ------------------------------------ | +| version | `v0.32.1` | The version of `crystal` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [crystal] -symbol = "✨ " -style = "bold blue" +format = "via [✨ $version](bold blue) " ``` -## Directory +## Diretório The `directory` module shows the path to your current directory, truncated to three parent folders. Your directory will also be truncated to the root of the git repo that you're currently in. @@ -362,24 +558,26 @@ When using the fish style pwd option, instead of hiding the path that is truncat For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, and the option set to `1`. You will now see `~/D/N/nixpkgs/pkgs`, whereas before it would have been `nixpkgs/pkgs`. -### Options +### Opções -| Variable | 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. | -| `prefix` | `"in "` | Prefix to display immediately before the directory. | -| `style` | `"bold cyan"` | The style for the module. | -| `disabled` | `false` | Disables the `directory` module. | +| Variável | 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. | +| `format` | `"[$path]($style)[$lock_symbol]($lock_style) "` | The format for the module. | +| `style` | `"bold cyan"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `directory` module. | +| `read_only_symbol` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_symbol_style` | `"red"` | The style for the read only symbol. |
This module has a few advanced configuration options that control how the directory is displayed. -| Variable | Default | Description | -| --------------------------- | ------- | ---------------------------------------------------------------------------------------- | -| `substitutions` | | A table of substitutions to be made to the path. | -| `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. | -| `use_logical_path` | `true` | Displays the logical path provided by the shell (`PWD`) instead of the path from the OS. | +| Advanced Option | Padrão | Descrição | +| --------------------------- | ------ | ---------------------------------------------------------------------------------------- | +| `substitutions` | | A table of substitutions to be made to the path. | +| `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. | +| `use_logical_path` | `true` | Displays the logical path provided by the shell (`PWD`) instead of the path from the OS. | `substitutions` allows you to define arbitrary replacements for literal strings that occur in the path, for example long network prefixes or development directories (i.e. Java). Note that this will disable the fish style PWD. @@ -393,7 +591,16 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
-### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | --------------------- | ----------------------------------- | +| path | `"D:/Projects"` | The current directory path | +| style\* | `"black bold dimmed"` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml @@ -406,42 +613,79 @@ truncation_length = 8 The `docker_context` module shows the currently active [Docker context](https://docs.docker.com/engine/context/working-with-contexts/) if it's not set to `default`. -### Options +### Opções -| Variable | Default | Description | -| ----------------- | ------------- | --------------------------------------------------------------------------------------- | -| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context . | -| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. | -| `style` | `"bold blue"` | The style for the module. | -| `disabled` | `true` | Disables the `docker_context` module. | +| Option | Padrão | Descrição | +| ----------------- | ---------------------------------- | --------------------------------------------------------------------------------------- | +| `format` | `"via [$symbol$context]($style) "` | The format for the module. | +| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context. | +| `style` | `"blue bold"` | O estilo do módulo. | +| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. | +| `disabled` | `true` | Disables the `docker_context` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | -------------- | ------------------------------------ | +| context | `test_context` | The current docker context | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [docker_context] -symbol = "🐋 " +format = "via [🐋 $context](blue bold)" ``` ## Dotnet The `dotnet` module shows the relevant version of the .NET Core SDK for the current directory. If the SDK has been pinned in the current directory, the pinned version is shown. Otherwise the module shows the latest installed version of the SDK. -This module will only be shown in your prompt when one of the following files are present in the current directory: `global.json`, `project.json`, `*.sln`, `*.csproj`, `*.fsproj`, `*.xproj`. You'll also need the .NET Core command-line tools installed in order to use it correctly. +This module will only be shown in your prompt when one or more of the following files are present in the current directory: + +- `global.json` +- `project.json` +- `Directory.Build.props` +- `Directory.Build.targets` +- `Packages.props` +- `*.sln` +- `*.csproj` +- `*.fsproj` +- `*.xproj` + +You'll also need the .NET Core SDK installed in order to use it correctly. Internally, this module uses its own mechanism for version detection. Typically it is twice as fast as running `dotnet --version`, but it may show an incorrect version if your .NET project has an unusual directory layout. If accuracy is more important than speed, you can disable the mechanism by setting `heuristic = false` in the module options. -### Options +The module will also show the Target Framework Moniker () when there is a csproj file in the current directory. -| Variable | Default | Description | -| ----------- | ------------- | -------------------------------------------------------- | -| `symbol` | `"•NET "` | The symbol used before displaying the version of dotnet. | -| `heuristic` | `true` | Use faster version detection to keep starship snappy. | -| `style` | `"bold blue"` | The style for the module. | -| `disabled` | `false` | Disables the `dotnet` module. | +### Opções -### Example +| Option | Padrão | Descrição | +| ----------- | ---------------------------------------- | -------------------------------------------------------- | +| `format` | `"v[$symbol$version( 🎯 $tfm)]($style) "` | The format for the module. | +| `symbol` | `"•NET "` | The symbol used before displaying the version of dotnet. | +| `heuristic` | `true` | Use faster version detection to keep starship snappy. | +| `style` | `"bold blue"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `dotnet` module. | + +### Variables + +| Variável | Exemplo | Descrição | +| --------- | ---------------- | ------------------------------------------------------------------ | +| version | `v3.1.201` | The version of `dotnet` sdk | +| tfm | `netstandard2.0` | The Target Framework Moniker that the current project is targeting | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml @@ -458,15 +702,27 @@ The `elixir` module shows the currently installed version of Elixir and Erlang/O - The current directory contains a `mix.exs` file. -### Options +### Opções -| Variable | Default | Description | -| ---------- | --------------- | --------------------------------------------------------------- | -| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. | -| `style` | `"bold purple"` | The style for the module. | -| `disabled` | `false` | Disables the `elixir` module. | +| 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. | +| `disabled` | `false` | Disables the `elixir` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| ----------- | ------- | ------------------------------------ | +| version | `v1.10` | The version of `elixir` | +| otp_version | | The otp version of `elixir` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml @@ -485,22 +741,32 @@ The `elm` module shows the currently installed version of Elm. The module will b - The current directory contains a `elm-stuff` folder - The current directory contains a `*.elm` files -### Options +### Opções -| Variable | Default | Description | -| ---------- | ------------- | ----------------------------------------------------- | -| `symbol` | `"🌳 "` | The symbol used before displaying the version of Elm. | -| `style` | `"bold cyan"` | The style for the module. | -| `disabled` | `false` | Disables the `elm` module. | +| Option | Padrão | Descrição | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🌳 "` | A format string representing the symbol of Elm. | +| `style` | `"cyan bold"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `elm` module. | +### Variables -### Example +| Variável | Exemplo | Descrição | +| --------- | --------- | ------------------------------------ | +| version | `v0.19.1` | The version of `elm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [elm] -symbol = " " +format = "via [ $version](cyan bold) " ``` ## Environment Variable @@ -510,19 +776,27 @@ The `env_var` module displays the current value of a selected environment variab - The `variable` configuration option matches an existing environment variable - The `variable` configuration option is not defined, but the `default` configuration option is -### Options +### Opções -| Variable | Default | Description | -| ---------- | --------------------- | ---------------------------------------------------------------------------- | -| `symbol` | | The symbol used before displaying the variable value. | -| `variable` | | The environment variable to be displayed. | -| `default` | | The default value to be displayed when the selected variable is not defined. | -| `prefix` | `""` | Prefix to display immediately before the variable value. | -| `suffix` | `""` | Suffix to display immediately after the variable value. | -| `style` | `"dimmed bold black"` | The style for the module. | -| `disabled` | `false` | Disables the `env_var` module. | +| Option | Padrão | Descrição | +| ---------- | ------------------------------ | ---------------------------------------------------------------------------- | +| `symbol` | | The symbol used before displaying the variable value. | +| `variable` | | The environment variable to be displayed. | +| `default` | | The default value to be displayed when the selected variable is not defined. | +| `format` | `"with [$env_value]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `env_var` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | ------------------------------------------- | ------------------------------------------ | +| env_value | `Windows NT` (if *variable* would be `$OS`) | The environment value of option `variable` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | `black bold dimmed` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml @@ -539,38 +813,60 @@ The `erlang` module shows the currently installed version of Erlang/OTP. The mod - The current directory contains a `rebar.config` file. - The current directory contains a `erlang.mk` file. -### Options +### Opções -| Variable | Default | Description | -| ---------- | ---------- | -------------------------------------------------------- | -| `symbol` | `"🖧 "` | The symbol used before displaying the version of Erlang. | -| `style` | `bold red` | The style for this module. | -| `disabled` | `false` | Disables the `erlang` module. | +| Option | Padrão | Descrição | +| ---------- | ---------------------------------- | -------------------------------------------------------- | +| `symbol` | `"🖧 "` | The symbol used before displaying the version of erlang. | +| `style` | `"bold red"` | O estilo do módulo. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `erlang` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | --------- | ------------------------------------ | +| version | `v22.1.3` | The version of `erlang` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [erlang] -symbol = "e " +format = "via [e $version](bold red) " ``` ## Git Branch The `git_branch` module shows the active branch of the repo in your current directory. -### Options +### Opções -| Variable | Default | Description | -| ------------------- | --------------- | ------------------------------------------------------------------------------------- | -| `symbol` | `" "` | The symbol used before the branch name of the repo in your current directory. | -| `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes | -| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. You can use "" for no symbol | -| `style` | `"bold purple"` | The style for the module. | -| `disabled` | `false` | Disables the `git_branch` module. | +| Option | Padrão | Descrição | +| ------------------- | -------------------------------- | ---------------------------------------------------------------------------------------- | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. Use `"$branch"` to refer to the current branch name. | +| `symbol` | `" "` | A format string representing the symbol of git branch. | +| `style` | `"bold purple"` | O estilo do módulo. | +| `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes. | +| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. You can use `""` for no symbol. | +| `disabled` | `false` | Disables the `git_branch` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| branch | `master` | The current branch name, falls back to `HEAD` if there's no current branch (e.g. git detached HEAD). | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml @@ -581,22 +877,30 @@ truncation_length = 4 truncation_symbol = "" ``` -## Git Commit +## Git commit The `git_commit` module shows the current commit hash of the repo in your current directory. -### Options +### Opções -| Variable | Default | Description | -| -------------------- | -------------- | ----------------------------------------------------- | -| `commit_hash_length` | `7` | The length of the displayed git commit hash. | -| `prefix` | `"("` | Prefix to display immediately before git commit. | -| `suffix` | `")"` | Suffix to display immediately after git commit. | -| `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. | +| 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. | +| `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. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | --------- | ----------------------------------- | +| hash | `b703eb3` | The current git commit hash | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml @@ -609,70 +913,98 @@ commit_hash_length = 4 The `git_state` module will show in directories which are part of a git repository, and where there is an operation in progress, such as: _REBASING_, _BISECTING_, etc. If there is progress information (e.g., REBASING 3/10), that information will be shown too. -### Options +### Opções -| Variable | Default | Description | -| ------------------ | ------------------ | ---------------------------------------------------------------------------------------------------------------- | -| `rebase` | `"REBASING"` | The text displayed when a `rebase` is in progress. | -| `merge` | `"MERGING"` | The text displayed when a `merge` is in progress. | -| `revert` | `"REVERTING"` | The text displayed when a `revert` is in progress. | -| `cherry_pick` | `"CHERRY-PICKING"` | The text displayed when a `cherry-pick` is in progress. | -| `bisect` | `"BISECTING"` | The text displayed when a `bisect` is in progress. | -| `am` | `"AM"` | The text displayed when an `apply-mailbox` (`git am`) is in progress. | -| `am_or_rebase` | `"AM/REBASE"` | The text displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. | -| `progress_divider` | `"/"` | The symbol or text which will separate the current and total progress amounts. (e.g., `" of "`, for `"3 of 10"`) | -| `style` | `"bold yellow"` | The style for the module. | -| `disabled` | `false` | Disables the `git_state` module. | +| 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. | +| `cherry_pick` | `"CHERRY-PICKING"` | A format string displayed when a `cherry-pick` is in progress. | +| `bisect` | `"BISECTING"` | A format string displayed when a `bisect` is in progress. | +| `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. | +| `disabled` | `false` | Disables the `git_state` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| ---------------- | ---------- | ----------------------------------- | +| state | `REBASING` | The current state of the repo | +| progress_current | `1` | The current operation progress | +| progress_total | `2` | The total operation progress | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [git_state] -progress_divider = " of " -cherry_pick = "🍒 PICKING" +format = "[\\($state( $progress_current of $progress_total)\\)]($style) " +cherry_pick = "[🍒 PICKING](bold red)" ``` ## Git Status The `git_status` module shows symbols representing the state of the repo in your current directory. -### Options +### Opções -| Variable | Default | Description | -| ------------------ | -------------------------- | ------------------------------------------------------- | -| `conflicted` | `"="` | This branch has merge conflicts. | -| `conflicted_count` | [link](#git-status-counts) | Show and style the number of conflicts. | -| `ahead` | `"⇡"` | This branch is ahead of the branch being tracked. | -| `behind` | `"⇣"` | This branch is behind of the branch being tracked. | -| `diverged` | `"⇕"` | This branch has diverged from the branch being tracked. | -| `untracked` | `"?"` | There are untracked files in the working directory. | -| `untracked_count` | [link](#git-status-counts) | Show and style the number of untracked files. | -| `stashed` | `"$"` | A stash exists for the local repository. | -| `stashed_count` | [link](#git-status-counts) | Show and style the number of stashes. | -| `modified` | `"!"` | There are file modifications in the working directory. | -| `modified_count` | [link](#git-status-counts) | Show and style the number of modified files. | -| `staged` | `"+"` | A new file has been added to the staging area. | -| `staged_count` | [link](#git-status-counts) | Show and style the number of files staged files. | -| `renamed` | `"»"` | A renamed file has been added to the staging area. | -| `renamed_count` | [link](#git-status-counts) | Show and style the number of renamed files. | -| `deleted` | `"✘"` | A file's deletion has been added to the staging area. | -| `deleted_count` | [link](#git-status-counts) | Show and style the number of deleted files. | -| `show_sync_count` | `false` | Show ahead/behind count of the branch being tracked. | -| `prefix` | `[` | Prefix to display immediately before git status. | -| `suffix` | `]` | Suffix to display immediately after git status. | -| `style` | `"bold red"` | The style for the module. | -| `disabled` | `false` | Disables the `git_status` module. | +| Option | Padrão | Descrição | +| ----------------- | ----------------------------------------------- | ---------------------------------------------------- | +| `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` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `show_sync_count` | `false` | Show ahead/behind count of the branch being tracked. | +| `style` | `"bold red"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `git_status` module. | -#### Git Status Counts +### Variables -| Variable | Default | Description | -| --------- | ------- | ------------------------------------------------------ | -| `enabled` | `false` | Show the number of files | -| `style` | | Optionally style the count differently than the module | +The following variables can be used in `format`: -### Example +| Variável | Descrição | +| -------------- | --------------------------------------------------------------------------------------------- | +| `all_status` | Shortcut for`$conflicted$stashed$deleted$renamed$modified$staged$untracked` | +| `ahead_behind` | Displays `diverged` `ahead` or `behind` format string based on the current status of the repo | +| `conflicted` | Displays `conflicted` when this branch has merge conflicts. | +| `untracked` | Displays `untracked` when there are untracked files in the working directory. | +| `stashed` | Displays `stashed` when a stash exists for the local repository. | +| `modified` | Displays `modified` when there are file modifications in the working directory. | +| `staged` | Displays `staged` when a new file has been added to the staging area. | +| `renamed` | Displays `renamed` when a renamed file has been added to the staging area. | +| `deleted` | Displays `deleted` when a file's deletion has been added to the staging area. | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +The following variables can be used in `diverged`: + +| Variável | Descrição | +| -------------- | ---------------------------------------------- | +| `ahead_count` | Number of commits ahead of the tracking branch | +| `behind_count` | Number of commits behind the tracking branch | + +The following variables can be used in `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` and `deleted`: + +| Variável | Descrição | +| -------- | ------------------------ | +| `count` | Show the number of files | + +### Exemplo ```toml # ~/.config/starship.toml @@ -685,10 +1017,7 @@ diverged = "😵" untracked = "🤷‍" stashed = "📦" modified = "📝" -staged.value = "++" -staged.style = "green" -staged_count.enabled = true -staged_count.style = "green" +staged = '[++\($count\)](green)' renamed = "👅" deleted = "🗑" ``` @@ -706,70 +1035,101 @@ The `golang` module shows the currently installed version of Golang. The module - The current directory contains a `Godeps` directory - The current directory contains a file with the `.go` extension -### Options +### Opções -| Variable | Default | Description | -| ---------- | ------------- | -------------------------------------------------------- | -| `symbol` | `"🐹 "` | The symbol used before displaying the version of Golang. | -| `style` | `"bold cyan"` | The style for the module. | -| `disabled` | `false` | Disables the `golang` module. | +| Option | Padrão | Descrição | +| ---------- | ---------------------------------- | ---------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐹 "` | A format string representing the symbol of Go. | +| `style` | `"bold cyan"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `golang` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | --------- | ------------------------------------ | +| version | `v1.12.1` | The version of `go` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [golang] -symbol = "🏎💨 " +format = "via [🏎💨 $version](bold cyan) " ``` -## Haskell -The `haskell` module shows the currently installed version of Haskell Stack version. The module will be shown if any of the following conditions are met: +## Helm -- The current directory contains a `stack.yaml` file +The `helm` module shows the currently installed version of Helm. The module will be shown if any of the following conditions are met: -### Options +- The current directory contains a `helmfile.yaml` file +- The current directory contains a `Chart.yaml` file -| Variable | Default | Description | -| ---------- | ------------ | --------------------------------------------------------- | -| `symbol` | `"λ "` | The symbol used before displaying the version of Haskell. | -| `style` | `"bold red"` | The style for the module. | -| `disabled` | `false` | Disables the `haskell` module. | +### Opções +| Option | Padrão | Descrição | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⎈ "` | A format string representing the symbol of Helm. | +| `style` | `"bold white"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `helm` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | -------- | ------------------------------------ | +| version | `v3.1.1` | The version of `helm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml -[haskell] -symbol = " " +[helm] +format = "via [⎈ $version](bold white) " ``` ## Hostname The `hostname` module shows the system hostname. -### Options +### Opções -| Variable | Default | Description | -| ---------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | -| `ssh_only` | `true` | Only show hostname when connected to an SSH session. | -| `prefix` | `""` | Prefix to display immediately before the hostname. | -| `suffix` | `""` | Suffix to display immediately after the hostname. | -| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation | -| `style` | `"bold dimmed green"` | The style for the module. | -| `disabled` | `false` | Disables the `hostname` module. | +| Option | Padrão | Descrição | +| ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `ssh_only` | `true` | Only show hostname when connected to an SSH session. | +| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation | +| `format` | `"on [$hostname]($style) "` | The format for the module. | +| `style` | `"bold dimmed green"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `hostname` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | ------- | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [hostname] ssh_only = false -prefix = "⟪" -suffix = "⟫" +format = "on [$hostname](bold red) " trim_at = ".companyname.com" disabled = false ``` @@ -781,15 +1141,26 @@ The `java` module shows the currently installed version of Java. The module will - The current directory contains a `pom.xml`, `build.gradle.kts`, `build.sbt` or `.java-version` file - The current directory contains a file with the `.java`, `.class`, `.gradle` or `.jar` extension -### Options +### Opções -| Variable | Default | Description | -| ---------- | -------------- | ------------------------------------------------------ | -| `symbol` | `"☕ "` | The symbol used before displaying the version of Java. | -| `style` | `"dimmed red"` | The style for the module. | -| `disabled` | `false` | Disables the `java` module. | +| Option | Padrão | Descrição | +| ---------- | -------------------------------------- | ----------------------------------------------- | +| `format` | `"via [${symbol}${version}]($style) "` | The format for the module. | +| `symbol` | `"☕ "` | A format string representing the symbol of Java | +| `style` | `"red dimmed"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `java` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | ------- | ------------------------------------ | +| version | `v14` | The version of `java` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml @@ -802,16 +1173,27 @@ symbol = "🌟 " The `jobs` module shows the current number of jobs running. The module will be shown only if there are background jobs running. The module will show the number of jobs running if there is more than 1 job, or more than the `threshold` config value, if it exists. -### Options +### Opções -| Variable | Default | Description | -| ----------- | ------------- | ----------------------------------------------------- | -| `symbol` | `"✦"` | The symbol used before displaying the number of jobs. | -| `threshold` | `1` | Show number of jobs if exceeded. | -| `style` | `"bold blue"` | The style for the module. | -| `disabled` | `false` | Disables the `jobs` module. | +| Option | Padrão | Descrição | +| ----------- | ----------------------------- | ------------------------------------------------ | +| `threshold` | `1` | Show number of jobs if exceeded. | +| `format` | `"[$symbol$number]($style) "` | The format for the module. | +| `symbol` | `"✦"` | A format string representing the number of jobs. | +| `style` | `"bold blue"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `jobs` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | ------- | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml @@ -829,15 +1211,26 @@ The `julia` module shows the currently installed version of Julia. The module wi - The current directory contains a `Manifest.toml` file - The current directory contains a file with the `.jl` extension -### Options +### Opções -| Variable | Default | Description | -| ---------- | --------------- | ------------------------------------------------------- | -| `symbol` | `"ஃ "` | The symbol used before displaying the version of Julia. | -| `style` | `"bold purple"` | The style for the module. | -| `disabled` | `false` | Disables the `julia` module. | +| Option | Padrão | Descrição | +| ---------- | ---------------------------------- | ------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"ஃ "` | A format string representing the symbol of Julia. | +| `style` | `"bold purple"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `julia` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | -------- | ------------------------------------ | +| version | `v1.4.0` | The version of `julia` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml @@ -845,6 +1238,7 @@ The `julia` module shows the currently installed version of Julia. The module wi [julia] symbol = "∴ " ``` + ## Kubernetes Displays the current Kubernetes context name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`. @@ -855,39 +1249,51 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ::: -### Options +### Opções -| Variable | Default | Description | -| ----------------- | ------------- | --------------------------------------------------- | -| `symbol` | `"☸ "` | The symbol used before displaying the Cluster info. | -| `context_aliases` | | Table of context aliases to display | -| `style` | `"bold blue"` | The style for the module. | -| `disabled` | `true` | Disables the `kubernetes` module | +| Option | Padrão | Descrição | +| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- | +| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. | +| `format` | `"on [$symbol$context( \\($namespace\\))]($style) "` | 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. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | -------------------- | ---------------------------------------- | +| context | `starship-cluster` | The current kubernetes context | +| namespace | `starship-namespace` | If set, the current kubernetes namespace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [kubernetes] -symbol = "⛵ " -style = "dimmed green" +format = "on [⛵ $context \\($namespace\\)](dimmed green) " disabled = false [kubernetes.context_aliases] "dev.local.cluster.k8s" = "dev" ``` -## Line Break +## Quebra de linha The `line_break` module separates the prompt into two lines. -### Options +### Opções -| Variable | Default | Description | +| Option | Padrão | Descrição | | ---------- | ------- | ------------------------------------------------------------------ | | `disabled` | `false` | Disables the `line_break` module, making the prompt a single line. | -### Example +### Exemplo ```toml # ~/.config/starship.toml @@ -896,7 +1302,7 @@ The `line_break` module separates the prompt into two lines. disabled = true ``` -## Memory Usage +## Uso de memória The `memory_usage` module shows current system memory and swap usage. @@ -908,19 +1314,30 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ::: -### Options +### Opções -| Variable | Default | Description | -| ----------------- | --------------------- | ------------------------------------------------------------- | -| `show_percentage` | `false` | Display memory usage as a percentage of the available memory. | -| `show_swap` | `true` | Display swap usage if total swap is non-zero. | -| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. | -| `symbol` | `"🐏 "` | The symbol used before displaying the memory usage. | -| `separator` | `" | "` | The symbol or text that will seperate the ram and swap usage. | -| `style` | `"bold dimmed white"` | The style for the module. | -| `disabled` | `true` | Disables the `memory_usage` module. | +| Option | Padrão | Descrição | +| ----------- | --------------------------------------------- | -------------------------------------------------------- | +| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. | +| `format` | `"via $symbol [${ram}( | ${swap})]($style) "` | The format for the module. | +| `symbol` | `"🐏"` | The symbol used before displaying the memory usage. | +| `style` | `"bold dimmed white"` | O estilo do módulo. | +| `disabled` | `true` | Disables the `memory_usage` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| ------------- | ------------- | ------------------------------------------------------------------ | +| ram | `31GiB/65GiB` | The usage/total RAM of the current system memory. | +| ram_pct | `48%` | The percentage of the current system memory. | +| swap\** | `1GiB/4GiB` | The swap memory size of the current system swap memory file. | +| swap_pct\** | `77%` | The swap memory percentage of the current system swap memory file. | +| symbol | `🐏` | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string \*\*: The SWAP file information is only displayed if detected on the current system + +### Exemplo ```toml # ~/.config/starship.toml @@ -939,23 +1356,34 @@ style = "bold dimmed green" The `hg_branch` module shows the active branch of the repo in your current directory. -### Options +### Opções -| Variable | Default | Description | -| ------------------- | --------------- | -------------------------------------------------------------------------------------------- | -| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. | -| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes | -| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. | -| `style` | `"bold purple"` | The style for the module. | -| `disabled` | `true` | Disables the `hg_branch` module. | +| Option | Padrão | Descrição | +| ------------------- | -------------------------------- | -------------------------------------------------------------------------------------------- | +| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. | +| `style` | `"bold purple"` | O estilo do módulo. | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. | +| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes | +| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. | +| `disabled` | `true` | Disables the `hg_branch` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | -------- | ------------------------------------ | +| branch | `master` | The active mercurial branch | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [hg_branch] -symbol = "🌱 " +format = "on [🌱 $branch](bold purple)" truncation_length = 4 truncation_symbol = "" ``` @@ -963,20 +1391,32 @@ truncation_symbol = "" ## Nim The `nim` module shows the currently installed version of Nim. The module will be shown if any of the following conditions are met: + - The current directory contains a `nim.cfg` file - The current directory contains a file with the `.nim` extension - The current directory contains a file with the `.nims` extension - The current directory contains a file with the `.nimble` extension -### Options +### Opções -| Variable | Default | Description | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | -| `style` | `"bold yellow"` | The style for the module. | -| `disabled` | `false` | Disables the `nim` module. | +| Option | Padrão | Descrição | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module | +| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | +| `style` | `"bold yellow"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `nim` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | -------- | ------------------------------------ | +| version | `v1.2.0` | The version of `nimc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml @@ -990,28 +1430,38 @@ symbol = "🎣 " The `nix_shell` module shows the nix-shell environment. The module will be shown when inside a nix-shell environment. -### Options +### Opções -| Variable | Default | Description | -| ------------ | ------------- | ------------------------------------------------- | -| `use_name` | `false` | Display the name of the nix-shell. | -| `impure_msg` | `"impure"` | Customize the "impure" msg. | -| `pure_msg` | `"pure"` | Customize the "pure" msg. | -| `symbol` | `"❄️ "` | The symbol used before displaying the shell name. | -| `style` | `"bold blue"` | The style for the module. | -| `disabled` | `false` | Disables the `nix_shell` module. | +| Option | Padrão | Descrição | +| ------------ | -------------------------------------------------- | ----------------------------------------------------- | +| `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. | +| `pure_msg` | `"pure"` | A format string shown when the shell is pure. | +| `disabled` | `false` | Disables the `nix_shell` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | ------- | ------------------------------------ | +| state | `pure` | The state of the nix-shell | +| name | `lorri` | The name of the nix-shell | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [nix_shell] disabled = true -use_name = true -impure_msg = "impure shell" -pure_msg = "pure shell" -symbol = "☃️ " +impure_msg = "[impure shell](bold red)" +pure_msg = "[pure shell](bold green)" +format = "via [☃️ $state( \\($name\\))](bold blue) " ``` ## NodeJS @@ -1021,23 +1471,35 @@ The `nodejs` module shows the currently installed version of NodeJS. The module - The current directory contains a `package.json` file - The current directory contains a `.node-version` file - The current directory contains a `node_modules` directory -- The current directory contains a file with the `.js` extension +- The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension +- The current directory contains a file with the `.ts` extension -### Options +### Opções -| Variable | Default | Description | -| ---------- | -------------- | -------------------------------------------------------- | -| `symbol` | `"⬢ "` | The symbol used before displaying the version of NodeJS. | -| `style` | `"bold green"` | The style for the module. | -| `disabled` | `false` | Disables the `nodejs` module. | +| Option | Padrão | Descrição | +| ---------- | ---------------------------------- | -------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⬢ "` | A format string representing the symbol of NodeJS. | +| `style` | `"bold green"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `nodejs` module. | -### Example +###  Variables + +| Variável | Exemplo | Descrição | +| --------- | ---------- | ------------------------------------ | +| version | `v13.12.0` | The version of `node` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [nodejs] -symbol = "🤖 " +format = "via [🤖 $version](bold green) " ``` ## Package Version @@ -1054,22 +1516,33 @@ The `package` module is shown when the current directory is the repository for a > ⚠️ The version being shown is that of the package whose source code is in your current directory, not your package manager. -### Options +### Opções -| Variable | Default | Description | -| ----------------- | ------------ | ---------------------------------------------------------- | -| `symbol` | `"📦 "` | The symbol used before displaying the version the package. | -| `style` | `"bold 208"` | The style for the module. | -| `display_private` | `false` | Enable displaying version for packages marked as private. | -| `disabled` | `false` | Disables the `package` module. | +| Option | Padrão | Descrição | +| ----------------- | ---------------------------------- | ---------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"📦 "` | The symbol used before displaying the version the package. | +| `style` | `"bold 208"` | O estilo do módulo. | +| `display_private` | `false` | Enable displaying version for packages marked as private. | +| `disabled` | `false` | Disables the `package` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | -------- | ------------------------------------ | +| version | `v1.0.0` | The version of your package | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [package] -symbol = "🎁 " +format = "via [🎁 $version](208 bold) " ``` ## OCaml @@ -1083,21 +1556,32 @@ The `ocaml` module shows the currently installed version of OCaml. The module wi - The current directory contains a `.merlin` file - The current directory contains a file with `.ml`, `.mli`, `.re` or `.rei` extension -### Options +### Opções -| Variable | Default | Description | -| ---------- | --------------- | ------------------------------------------------------- | -| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | -| `style` | `"bold yellow"` | The style for the module. | -| `disabled` | `false` | Disables the `ocaml` module. | +| 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 OCaml. | +| `style` | `"bold yellow"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `ocaml` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | --------- | ------------------------------------ | +| version | `v4.10.0` | The version of `ocaml` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [ocaml] -symbol = "🐪 " +format = "via [🐪 $version]($style) " ``` ## PHP @@ -1108,21 +1592,32 @@ The `php` module shows the currently installed version of PHP. The module will b - The current directory contains a `.php-version` file - The current directory contains a `.php` file -### Options +### Opções -| Variable | Default | Description | -| ---------- | ------------ | ----------------------------------------------------- | -| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. | -| `style` | `"bold 147"` | The style for the module. | -| `disabled` | `false` | Disables the `php` module. | +| Option | Padrão | Descrição | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. | +| `style` | `"147 bold"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `php` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | -------- | ------------------------------------ | +| version | `v7.3.8` | The version of `php` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [php] -symbol = "🔹 " +format = "via [🔹 $version](147 bold) " ``` ## Python @@ -1143,21 +1638,30 @@ The module will be shown if any of the following conditions are met: - The current directory contains a `__init__.py` file - A virtual environment is currently activated -### Options +### Opções -| Variable | Default | Description | -| -------------------- | --------------- | --------------------------------------------------------------------------- | -| `symbol` | `"🐍 "` | The symbol used before displaying the version of Python. | -| `pyenv_version_name` | `false` | Use pyenv to get Python version | -| `pyenv_prefix` | `"pyenv "` | Prefix before pyenv version display (default display is `pyenv MY_VERSION`) | -| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | -| `style` | `"bold yellow"` | The style for the module. | -| `disabled` | `false` | Disables the `python` module. | +| Option | Padrão | Descrição | +| -------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${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 | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `disabled` | `false` | Disables the `python` module. | + +### Variables + +| Variável | Exemplo | Descrição | +| ---------- | --------------- | ------------------------------------ | +| version | `"v3.8.1"` | The version of `python` | +| symbol | `"🐍 "` | Mirrors the value of option `symbol` | +| style | `"yellow bold"` | Mirrors the value of option `style` | +| virtualenv | `"venv"` | The current `virtualenv` name |
This module has some advanced configuration options. -| Variable | Default | Description | +| Variável | Padrão | Descrição | | --------------- | -------- | ----------------------------------------------------------------------------- | | `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. | @@ -1172,7 +1676,7 @@ python_binary = "python3"
-### Example +### Exemplo ```toml # ~/.config/starship.toml @@ -1191,15 +1695,26 @@ The `ruby` module shows the currently installed version of Ruby. The module will - The current directory contains a `.ruby-version` file - The current directory contains a `.rb` file -### Options +### Opções -| Variable | Default | Description | -| ---------- | ------------ | ------------------------------------------------------ | -| `symbol` | `"💎 "` | The symbol used before displaying the version of Ruby. | -| `style` | `"bold red"` | The style for the module. | -| `disabled` | `false` | Disables the `ruby` module. | +| Option | Padrão | Descrição | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"💎 "` | A format string representing the symbol of Ruby. | +| `style` | `"bold red"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `ruby` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | -------- | ------------------------------------ | +| version | `v2.5.1` | The version of `ruby` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml @@ -1215,70 +1730,111 @@ The `rust` module shows the currently installed version of Rust. The module will - The current directory contains a `Cargo.toml` file - The current directory contains a file with the `.rs` extension -### Options +### Opções -| Variable | Default | Description | -| ---------- | ------------ | ------------------------------------------------------ | -| `symbol` | `"🦀 "` | The symbol used before displaying the version of Rust. | -| `style` | `"bold red"` | The style for the module. | -| `disabled` | `false` | Disables the `rust` module. | +| Option | Padrão | Descrição | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🦀 "` | A format string representing the symbol of Rust | +| `style` | `"bold red"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `rust` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | ----------------- | ------------------------------------ | +| version | `v1.43.0-nightly` | The version of `rustc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [rust] -symbol = "⚙️ " +format = "via [⚙️ $version](red bold)" ``` ## Singularity The `singularity` module shows the current singularity image, if inside a container and `$SINGULARITY_NAME` is set. -### Options +### Opções -| Variable | Default | Description | -| ---------- | -------------------- | ------------------------------------------------ | -| `label` | `""` | Prefix before the image name display. | -| `prefix` | `"["` | Prefix to display immediately before image name. | -| `suffix` | `"]"` | Suffix to display immediately after image name. | -| `symbol` | `""` | The symbol used before the image name. | -| `style` | `"bold dimmed blue"` | The style for the module. | -| `disabled` | `false` | Disables the `singularity` module. | +| Option | Padrão | Descrição | +| ---------- | ------------------------------------ | ------------------------------------------------ | +| `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. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | ------------ | ------------------------------------ | +| env | `centos.img` | The current singularity image | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [singularity] -symbol = "📦 " +format = "[📦 \\[$env\\]]($style) " ``` ## Terraform -The `terraform` module shows the currently selected terraform workspace and version. By default the terraform version is not shown, since this is slow on current versions of terraform when a lot of plugins are in use. The module will be shown if any of the following conditions are met: +The `terraform` module shows the currently selected terraform workspace and version. By default the terraform version is not shown, since this is slow on current versions of terraform when a lot of plugins are in use. If you still want to enable it, [follow the example shown below](#with-version). The module will be shown if any of the following conditions are met: - The current directory contains a `.terraform` folder - Current directory contains a file with the `.tf` extension -### Options +### Opções -| Variable | Default | Description | -| -------------- | ------------ | ----------------------------------------------------------- | -| `symbol` | `"💠 "` | The symbol used before displaying the terraform workspace. | -| `show_version` | `false` | Shows the terraform version. Very slow on large workspaces. | -| `style` | `"bold 105"` | The style for the module. | -| `disabled` | `false` | Disables the `terraform` module. | +| Option | Padrão | Descrição | +| ---------- | ------------------------------------ | ----------------------------------------------------- | +| `format` | `"via [$symbol$workspace]($style) "` | The format string for the module. | +| `symbol` | `"💠 "` | A format string shown before the terraform workspace. | +| `style` | `"bold 105"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `terraform` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | ---------- | ------------------------------------ | +| version | `v0.12.24` | The version of `terraform` | +| workspace | `default` | The current terraform workspace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo + +#### With Version ```toml # ~/.config/starship.toml [terraform] -symbol = "🏎💨 " +format = "[🏎💨 $version$workspace]($style) " +``` + +#### Without version + +```toml +# ~/.config/starship.toml + +[terraform] +format = "[🏎💨 $workspace]($style) " ``` ## Time @@ -1291,27 +1847,38 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ::: -### Options +### Opções -| Variable | Default | Description | -| ----------------- | --------------- | ------------------------------------------------------------------------------------------------------------------- | -| `use_12hr` | `false` | Enables 12 hour formatting. | -| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. | -| `style` | `"bold yellow"` | The style for the module time. | -| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. | -| `disabled` | `true` | Disables the `time` module. | -| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | +| Option | Padrão | Descrição | +| ----------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `format` | `"at [$time]($style) "` | The format string for the module. | +| `use_12hr` | `false` | Enables 12 hour formatting | +| `time_format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. | +| `style` | `"bold yellow"` | The style for the module time | +| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. | +| `disabled` | `true` | Disables the `time` module. | +| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | -If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | ---------- | ----------------------------------- | +| time | `13:08:10` | The current time. | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [time] disabled = false -format = "🕙[ %T ]" +format = "🕙[\\[ $time \\]]($style) " +time_format = "%T" utc_time_offset = "-5" time_range = "10:00:00-14:00:00" ``` @@ -1325,40 +1892,62 @@ The `username` module shows active user's username. The module will be shown if - The user is currently connected as an SSH session - The variable `show_always` is set to true -### Options +### Opções -| Variable | Default | Description | -| ------------- | --------------- | ------------------------------------- | -| `style_root` | `"bold red"` | The style used when the user is root. | -| `style_user` | `"bold yellow"` | The style used for non-root users. | -| `show_always` | `false` | Always shows the `username` module. | -| `disabled` | `false` | Disables the `username` module. | +| Option | Padrão | Descrição | +| ------------- | ------------------------ | ------------------------------------- | +| `style_root` | `"bold red"` | The style used when the user is root. | +| `style_user` | `"bold yellow"` | The style used for non-root users. | +| `format` | `"via [$user]($style) "` | The format for the module. | +| `show_always` | `false` | Always shows the `username` module. | +| `disabled` | `false` | Disables the `username` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| -------- | ------------ | ------------------------------------------------------------------------------------------- | +| `style` | `"red bold"` | Mirrors the value of option `style_root` when root is logged in and `style_user` otherwise. | +| `user` | `"matchai"` | The currently logged-in user ID. | + +### Exemplo ```toml # ~/.config/starship.toml [username] -disabled = true +style_user = "white bold" +style_root = "black bold" +format = "user: [$user]($style) " +disabled = false +show_always = true ``` - ## Zig The `zig` module shows the currently installed version of Zig. The module will be shown if any of the following conditions are met: - The current directory contains a `.zig` file -### Options +### Opções -| Variable | Default | Description | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | -| `style` | `"bold yellow"` | The style for the module. | -| `disabled` | `false` | Disables the `zig` module. | +| Option | Padrão | Descrição | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | +| `style` | `"bold yellow"` | O estilo do módulo. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `zig` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | -------- | ------------------------------------ | +| version | `v0.6.0` | The version of `zig` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml @@ -1372,6 +1961,7 @@ symbol = "⚡️ " The `custom` modules show the output of some arbitrary commands. These modules will be shown if any of the following conditions are met: + - The current directory contains a file whose name is in `files` - The current directory contains a directory whose name is in `directories` - The current directory contains a file whose extension is in `extensions` @@ -1389,26 +1979,36 @@ The order in which custom modules are shown can be individually set by setting ` ::: -### Options +### Opções -| Variable | Default | Description | -| ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. | -| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | -| `shell` | | [See below](#custom-command-shell) | -| `description` | `""` | The description of the module that is shown when running `starship explain`. | -| `files` | `[]` | The files that will be searched in the working directory for a match. | -| `directories` | `[]` | The directories that will be searched in the working directory for a match. | -| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | -| `symbol` | `""` | The symbol used before displaying the command output. | -| `style` | `"bold green"` | The style for the module. | -| `prefix` | `""` | Prefix to display immediately before the command output. | -| `suffix` | `""` | Suffix to display immediately after the command output. | -| `disabled` | `false` | Disables this `custom` module. | +| Option | Padrão | Descrição | +| ------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `command` | | The command whose output should be printed. | +| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | +| `shell` | | [See below](#custom-command-shell) | +| `descrição` | `""` | The description of the module that is shown when running `starship explain`. | +| `files` | `[]` | The files that will be searched in the working directory for a match. | +| `directories` | `[]` | The directories that will be searched in the working directory for a match. | +| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | +| `symbol` | `""` | The symbol used before displaying the command output. | +| `style` | `"bold green"` | O estilo do módulo. | +| `format` | `"[$symbol$output]($style) "` | The format for the module. | +| `disabled` | `false` | Disables this `custom` module. | + +### Variables + +| Variável | Descrição | +| --------- | -------------------------------------- | +| output | The output of shell command in `shell` | +| symbol | Mirrors the value of option `symbol` | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string #### Custom command shell `shell` accepts a non-empty list of strings, where: + - The first string is the path to the shell to use to execute the command. - Other following arguments are passed to the shell. @@ -1432,7 +2032,7 @@ Automatic detection of shells and proper parameters addition are currently imple ::: -### Example +### Exemplo ```toml # ~/.config/starship.toml @@ -1457,19 +2057,30 @@ The `purescript` module shows the currently installed version of PureScript vers - The current directory contains a `spago.dhall` file - The current directory contains a \*.purs files -### Options +### Opções -| Variable | Default | Description | -| ---------- | -------------- | ------------------------------------------------------------ | -| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | -| `style` | `"bold white"` | The style for the module. | -| `disabled` | `false` | Disables the `purescript` module. | +| Option | Padrão | Descrição | +| ---------- | ---------------------------------- | ------------------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | +| `style` | `"bold white"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `purescript` module. | -### Example +### Variables + +| Variável | Exemplo | Descrição | +| --------- | -------- | ------------------------------------ | +| version | `0.13.5` | The version of `purescript` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemplo ```toml # ~/.config/starship.toml [purescript] -symbol = "<=> " +format = "via [$symbol$version](bold white)" ``` diff --git a/docs/pt-BR/faq/README.md b/docs/pt-BR/faq/README.md index e6daa985..84be958c 100644 --- a/docs/pt-BR/faq/README.md +++ b/docs/pt-BR/faq/README.md @@ -5,9 +5,9 @@ - **Terminal Emulator**: [iTerm2](https://iterm2.com/) - **Theme**: Minimal - **Color Scheme**: [Snazzy](https://github.com/sindresorhus/iterm2-snazzy) - - **Font**: [Fira Code](https://github.com/tonsky/FiraCode) + - **Font**: [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads) - **Shell**: [Fish Shell](https://fishshell.com/) - - **Configuration**: [matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/master/.config/fish/config.fish) + - **Configuration**: [matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish) - **Prompt**: [Starship](https://starship.rs/) ## Do `prompt_order` and `.disabled` do the same thing? @@ -46,7 +46,7 @@ The prompt will use as much context as is provided, but no flags are "required". ## How do I run Starship on Linux distributions with older versions of glibc? -If you get an error like "*version 'GLIBC_2.18' not found (required by starship)*" when using the prebuilt binary (for example, on CentOS 6 or 7), you can use a binary compiled with `musl` instead of `glibc`: +If you get an error like "_version 'GLIBC_2.18' not found (required by starship)_" when using the prebuilt binary (for example, on CentOS 6 or 7), you can use a binary compiled with `musl` instead of `glibc`: ```sh curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux-musl @@ -56,13 +56,13 @@ curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux- 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: - - 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 [powerline-patched font](https://github.com/powerline/fonts). +- 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/). To test your system, run the following commands in a terminal: -``` +```sh echo -e "\xf0\x9f\x90\x8d" echo -e "\xee\x82\xa0" ``` @@ -70,3 +70,19 @@ 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). 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) + +## How do I uninstall Starship? + +Starship is just as easy to uninstall as it is to install in the first place. + +1. Remove any lines in your shell config (e.g. `~/.bashrc`) used to initialize Starship. +1. Delete the Starship binary. + +If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. + +If Starship was installed using the `curl | bash` script, the following command will delete the binary: + +```sh +# Locate and delete the starship binary +rm "$(which starship)" +``` diff --git a/docs/pt-BR/guide/README.md b/docs/pt-BR/guide/README.md index dcc430d4..61ac05f2 100644 --- a/docs/pt-BR/guide/README.md +++ b/docs/pt-BR/guide/README.md @@ -121,7 +121,7 @@ ### Pré-requisitos -- Uma das fontes [Powerline font](https://github.com/powerline/fonts) instalada e configurada no seu terminal (por exemplo, experimente a [Fira Code](https://github.com/tonsky/FiraCode)). +- Uma [Nerd Font](https://www.nerdfonts.com/) instalada e funcionando no seu terminal (por exemplo, experimente a [Fira Code Nerd Font](https://www.nerdfonts.com/font-downloads)). ### Primeiros passos @@ -224,7 +224,7 @@ Se você está interessado em ajudar contribuindo com o projeto, dê uma olhada ### Contribuidores de código -Este projeto existe graças a todas as pessoas que contribuem. [[Contribuir](CONTRIBUTING.md)]. +Este projeto existe graças a todas as pessoas que contribuem. [[Contribuir](https://github.com/starship/starship/blob/master/CONTRIBUTING.md)]. ### Contribuidores Financeiros diff --git a/docs/pt-BR/presets/README.md b/docs/pt-BR/presets/README.md index a5998d84..34411326 100644 --- a/docs/pt-BR/presets/README.md +++ b/docs/pt-BR/presets/README.md @@ -1,16 +1,16 @@ -# Presets +# Predefinições -Here is a collection of community-submitted configuration presets for Starship. If you have a preset to share, please [submit a PR](https://github.com/starship/starship/edit/master/docs/presets/README.md) updating this file! 😊 +Aqui tem uma coleção de predefinições de configuração criadas pela comunidade de Starship. Se você tem uma predefinição para compartilhar, por favor, [envie uma PR](https://github.com/starship/starship/edit/master/docs/presets/README.md) atualizando este arquivo! 😊 ## Nerd Font Symbols -This preset doesn't change anything except for the symbols used for each module. If emojis aren't your thing, this might catch your eye! +Essa predefinição não altera nada exceto os símbolos usados para cada módulo. Se você não gosta de emojis, isso pode chamar sua atenção! -![Screenshot of Nerd Font Symbols preset](/presets/nerd-font-symbols.png) +![Captura de tela da predefinição Nerd Font Symbols](/presets/nerd-font-symbols.png) ### Pré-requisitos -- A [Nerd Font](https://www.nerdfonts.com/) installed and enabled in your terminal (the example uses Fira Code Nerd Font) +- Uma [Nerd Font](https://www.nerdfonts.com/) instalada e funcionando no seu terminal (o exemplo utiliza Fira Code Nerd Font) ### Configuração diff --git a/docs/pt-PT/advanced-config/README.md b/docs/pt-PT/advanced-config/README.md index d5d27031..2b11f18a 100644 --- a/docs/pt-PT/advanced-config/README.md +++ b/docs/pt-PT/advanced-config/README.md @@ -57,7 +57,16 @@ In `zsh`, add this to the `precmd_functions` array: precmd_functions+=(set_win_title) ``` -If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zsrhc`) to make it permanent. +If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. + +For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: + +```bash +function set_win_title(){ + echo -ne "\033]0; $(basename $PWD) \007" +} +starship_precmd_user_func="set_win_title" +``` ## Style Strings diff --git a/docs/pt-PT/config/README.md b/docs/pt-PT/config/README.md index c9db5963..8ec13467 100644 --- a/docs/pt-PT/config/README.md +++ b/docs/pt-PT/config/README.md @@ -19,8 +19,8 @@ All configuration for starship is done in this [TOML](https://github.com/toml-la add_newline = false # Replace the "❯" symbol in the prompt with "➜" -[character] # The name of the module we are configuring is "character" -symbol = "➜" # The "symbol" segment is being set to "➜" +[character] # The name of the module we are configuring is "character" +success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green" # Disable the package module, hiding it from the prompt completely [package] @@ -28,11 +28,13 @@ disabled = true ``` You can change default `starship.toml` file location with `STARSHIP_CONFIG` environment variable: + ```sh export STARSHIP_CONFIG=~/.starship ``` Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: + ```ps1 $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` @@ -41,16 +43,39 @@ $ENV:STARSHIP_CONFIG = "$HOME\.starship" **Module**: A component in the prompt giving information based on contextual information from your OS. For example, the "nodejs" module shows the version of NodeJS that is currently installed on your computer, if your current directory is a NodeJS project. -**Segment**: Smaller sub-components that compose a module. For example, the "symbol" segment in the "nodejs" module contains the character that is shown before the version number (⬢ by default). +**Variable**: Smaller sub-components that contains information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of NodeJS. -Here is the representation of the node module. In the following example, "symbol" and "version" are segments within it. Every module also has a prefix and suffix that are the default terminal color. +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. -``` -[prefix] [symbol] [version] [suffix] - "via " "⬢" "v10.4.1" "" -``` +### Format Strings -### Style Strings +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. + +#### Variable + +A variable contains a `$` symbol followed by the name of the variable. The name of a variable only contains letters, numbers and `_`. + +For example: + +- `$version` is a format string with a variable named `version`. +- `$git_branch$git_commit` is a format string with two variables named `git_branch` and `git_commit`. +- `$git_branch $git_commit` has the two variables separated with a space. + +#### Text Group + +A text group is made up of two different parts. + +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. + +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used style the first part. + +For example: + +- `[on](red bold)` will print a string `on` with bold text colored red. +- `[⬢ $version](bold green)` will print a symbol `⬢` followed by the content of variable `version`, with bold text colored green. +- `[a [b](red) c](green)` will print `a b c` with `b` red, and `a` and `c` green. + +#### Style Strings Most modules in starship allow you to configure their display styles. This is done with an entry (usually called `style`) which is a string specifying the configuration. Here are some examples of style strings along with what they do. For details on the full syntax, consult the [advanced config guide](/advanced-config/). @@ -63,17 +88,56 @@ Most modules in starship allow you to configure their display styles. This is do Note that what styling looks like will be controlled by your terminal emulator. For example, some terminal emulators will brighten the colors instead of bolding text, and some color themes use the same values for the normal and bright colors. Also, to get italic text, your terminal must support italics. +#### Conditional Format Strings + +A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. + +For example: + +- `(@$region)` will show nothing if the variable `region` is `None`, otherwise `@` followed by the value of region. +- `(some text)` will always show nothing since there are no variables wrapped in the braces. +- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. + +#### Escapable characters + +The following symbols have special usage in a format string. If you want to print the following symbols, you have to escape them with a backslash (`\`). + +- $ +- \\ +- [ +- ] +- ( +- ) + +Note that `toml` has [its own escape syntax](https://github.com/toml-lang/toml#user-content-string). It is recommended to use a literal string (`''`) in your config. If you want to use a basic string (`""`), pay attention to escape the backslash `\`. + +For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: + +```toml +# with basic string +format = "\n\\$" + +# with multiline basic string +format = """ + +\\$""" + +# with literal string +format = ''' + +\$''' +``` + ## Prompt This is the list of prompt-wide configuration options. ### Options -| Variable | Default | Description | -| -------------- | ----------------------------- | ------------------------------------------------------ | -| `add_newline` | `true` | Add a new line before the start of the prompt. | -| `prompt_order` | [link](#default-prompt-order) | Configure the order in which the prompt module occurs. | -| `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). | +| Option | Default | Description | +| -------------- | ------------------------------ | ----------------------------------------------------- | +| `format` | [link](#default-prompt-format) | Configure the format of the prompt. | +| `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). | ### Example @@ -81,62 +145,71 @@ This is the list of prompt-wide configuration options. # ~/.config/starship.toml # Disable the newline at the start of the prompt -add_newline = false -# Overwrite a default_prompt_order and use custom prompt_order -prompt_order=["rust","line_break","package","line_break","character"] +format = "$all" + +# Use custom format +format = """ +[┌───────────────────>](bold green) +[│](bold green)$directory$rust$package +[└─>](bold green) """ + # Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 ``` -### Default Prompt Order +### Default Prompt Format -The default `prompt_order` is used to define the order in which modules are shown in the prompt, if empty or no `prompt_order` is provided. The default is as shown: +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. The default is as shown: ```toml -prompt_order = [ - "username", - "hostname", - "kubernetes", - "directory", - "git_branch", - "git_commit", - "git_state", - "git_status", - "hg_branch", - "docker_context", - "package", - "dotnet", - "elixir", - "elm", - "erlang", - "golang", - "haskell", - "java", - "julia", - "nim", - "nodejs", - "ocaml", - "php", - "purescript", - "python", - "ruby", - "rust", - "terraform", - "zig", - "nix_shell", - "conda", - "memory_usage", - "aws", - "env_var", - "crystal", - "cmd_duration", - "custom", - "line_break", - "jobs", - "battery", - "time", - "character", -] +format = "\n$all" + +# Which is equivalent to +format = """ + +$username\ +$hostname\ +$kubernetes\ +$directory\ +$git_branch\ +$git_commit\ +$git_state\ +$git_status\ +$hg_branch\ +$docker_context\ +$package\ +$cmake\ +$dotnet\ +$elixir\ +$elm\ +$erlang\ +$golang\ +$helm\ +$java\ +$julia\ +$nim\ +$nodejs\ +$ocaml\ +$php\ +$purescript\ +$python\ +$ruby\ +$rust\ +$terraform\ +$zig\ +$nix_shell\ +$conda\ +$memory_usage\ +$aws\ +$env_var\ +$crystal\ +$cmd_duration\ +$custom\ +$line_break\ +$jobs\ +$battery\ +$time\ +$character""" ``` ## AWS @@ -147,41 +220,80 @@ When using [aws-vault](https://github.com/99designs/aws-vault) the profile is re ### Options -| Variable | Default | Description | -| ----------------- | --------------- | --------------------------------------------------------------------------- | -| `symbol` | `"☁️ "` | The symbol used before displaying the current AWS profile. | -| `displayed_items` | `all` | Choose which item to display. Possible values: [`all`, `profile`, `region`] | -| `region_aliases` | | Table of region aliases to display in addition to the AWS name. | -| `style` | `"bold yellow"` | The style for the module. | -| `disabled` | `false` | Disables the `AWS` module. | +| Option | Default | Description | +| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- | +| `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. | +| `disabled` | `false` | Disables the `AWS` module. | -### Example +### Variables + +| Variable | Example | Description | +| --------- | ---------------- | ------------------------------------ | +| region | `ap-northeast-1` | The current AWS region | +| profile | `astronauts` | The current AWS profile | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Examples + +#### Display everything ```toml # ~/.config/starship.toml [aws] +format = "on [$symbol$profile(\\($region\\))]($style) " style = "bold blue" symbol = "🅰 " -displayed_items = "region" [aws.region_aliases] ap-southeast-2 = "au" us-east-1 = "va" ``` +#### Display region + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$region]($style) " +style = "bold blue" +symbol = "🅰 " +[aws.region_aliases] +ap-southeast-2 = "au" +us-east-1 = "va" +``` + +#### Display profile + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$profile]($style) " +style = "bold blue" +symbol = "🅰 " +``` + ## Battery The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%. ### Options -| Variable | Default | Description | -| -------------------- | ------------------------ | ------------------------------------------------- | -| `full_symbol` | `"•"` | The symbol shown when the battery is full. | -| `charging_symbol` | `"⇡"` | The symbol shown when the battery is charging. | -| `discharging_symbol` | `"⇣"` | The symbol shown when the battery is discharging. | -| `display` | [link](#battery-display) | Display threshold and style for the module. | -| `disabled` | `false` | Disables the `battery` module. | +| Option | Default | Description | +| -------------------- | --------------------------------- | ------------------------------------------------- | +| `full_symbol` | `"•"` | The symbol shown when the battery is full. | +| `charging_symbol` | `"⇡"` | The symbol shown when the battery is charging. | +| `discharging_symbol` | `"⇣"` | The symbol shown when the battery is discharging. | +| `format` | `"[$symbol$percentage]($style) "` | The format for the module. | +| `display` | [link](#battery-display) | Display threshold and style for the module. | +| `disabled` | `false` | Disables the `battery` module. |
There are also options for some uncommon battery states. @@ -244,31 +356,85 @@ style = "bold yellow" The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal. -The character will tell you whether the last command was successful or not. It can do this in two ways: by changing color (red/green) or by changing its shape (❯/✖). The latter will only be done if `use_symbol_for_status` is set to `true`. +The character will tell you whether the last command was successful or not. It can do this in two ways: + +- changing color (`red`/`green`) +- changing shape (`❯`/`✖`) + +By default it only changes color. If you also want to change it's shape take a look at [this example](#with-custom-error-shape). ### Options -| Variable | Default | Description | -| ----------------------- | -------------- | ----------------------------------------------------------------------------------- | -| `symbol` | `"❯"` | The symbol used before the text input in the prompt. | -| `error_symbol` | `"✖"` | The symbol used before text input if the previous command failed. | -| `use_symbol_for_status` | `false` | Indicate error status by changing the symbol. | -| `vicmd_symbol` | `"❮"` | The symbol used before the text input in the prompt if shell is in vim normal mode. | -| `style_success` | `"bold green"` | The style used if the last command was successful. | -| `style_failure` | `"bold red"` | The style used if the last command failed. | -| `disabled` | `false` | Disables the `character` module. | +| Option | Default | Description | +| ---------------- | ------------------- | -------------------------------------------------------------------------------- | +| `format` | `"$symbol "` | The format string used before the text input. | +| `success_symbol` | `"[❯](bold green)"` | The format string used before the text input if the previous command succeeded. | +| `error_symbol` | `"[❯](bold red)"` | The format string used before the text input if the previous command failed. | +| `vicmd_symbol` | `"[❮](bold green)"` | The format string used before the text input if the shell is in vim normal mode. | +| `disabled` | `false` | Disables the `character` module. | -### Example +### Variables + +| Variable | Example | Description | +| -------- | ------- | --------------------------------------------------------------------- | +| symbol | | A mirror of either `success_symbol`, `error_symbol` or `vicmd_symbol` | + +### Examples + +#### With custom error shape ```toml # ~/.config/starship.toml [character] -symbol = "➜" -error_symbol = "✗" -use_symbol_for_status = true +success_symbol = "[➜](bold green) " +error_symbol = "[✗](bold red) " ``` +#### Without custom error shape + +```toml +# ~/.config/starship.toml + +[character] +success_symbol = "[➜](bold green) " +error_symbol = "[➜](bold red) " +``` + +#### With custom vim shape + +```toml +# ~/.config/starship.toml + +[character] +vicmd_symbol = "[V](bold green) " +``` + +## CMake + +The `cmake` module shows the currently installed version of CMake if: + +- The current directory contains a `CMakeLists.txt` file + +### Options + +| Option | Default | Description | +| ---------- | ---------------------------------- | -------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🛆 "` | The symbol used before the version of cmake. | +| `style` | `"bold blue"` | The style for the module. | +| `disabled` | `false` | Disables the `cmake` module. | + +### Variables + +| Variable | Example | Description | +| --------- | --------- | ------------------------------------ | +| version | `v3.17.3` | The version of cmake | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + ## Command Duration The `cmd_duration` module shows how long the last command took to execute. The module will be shown only if the command took longer than two seconds, or the `min_time` config value, if it exists. @@ -283,13 +449,22 @@ Bash users who need preexec-like functionality can use [rcaloras's bash_preexec ### Options -| Variable | Default | Description | -| ------------------- | --------------- | ---------------------------------------------------------- | -| `min_time` | `2_000` | Shortest duration to show time for (in milliseconds). | -| `show_milliseconds` | `false` | Show milliseconds in addition to seconds for the duration. | -| `prefix` | `took` | Prefix to display immediately before the command duration. | -| `style` | `"bold yellow"` | The style for the module. | -| `disabled` | `false` | Disables the `cmd_duration` module. | +| Option | Default | Description | +| ------------------- | ----------------------------- | ---------------------------------------------------------- | +| `min_time` | `2_000` | Shortest duration to show time for (in milliseconds). | +| `show_milliseconds` | `false` | Show milliseconds in addition to seconds for the duration. | +| `format` | `"took [$duration]($style) "` | The format for the module. | +| `style` | `"bold yellow"` | The style for the module. | +| `disabled` | `false` | Disables the `cmd_duration` module. | + +### Variables + +| Variable | Example | Description | +| --------- | -------- | --------------------------------------- | +| duration | `16m40s` | The time it took to execute the command | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -298,7 +473,7 @@ Bash users who need preexec-like functionality can use [rcaloras's bash_preexec [cmd_duration] min_time = 500 -prefix = "underwent " +format = "underwent [$duration](bold yellow)" ``` ## Conda @@ -313,12 +488,23 @@ This does not suppress conda's own prompt modifier, you may want to run `conda c ### Options -| Variable | Default | Description | -| ------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `truncation_length` | `1` | The number of directories the environment path should be truncated to, if the environment was created via `conda create -p [path]`. `0` means no truncation. Also see the [`directory`](#directory) module. | -| `symbol` | `"C "` | The symbol used before the environment name. | -| `style` | `"bold green"` | The style for the module. | -| `disabled` | `false` | Disables the `conda` module. | +| Option | Default | Description | +| ------------------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `truncation_length` | `1` | The number of directories the environment path should be truncated to, if the environment was created via `conda create -p [path]`. `0` means no truncation. Also see the [`directory`](#directory) module. | +| `symbol` | `"🅒 "` | The symbol used before the environment name. | +| `style` | `"bold green"` | The style for the module. | +| `format` | `"[$symbol$environment]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `conda` module. | + +### Variables + +| Variable | Example | Description | +| ----------- | ------------ | ------------------------------------ | +| environment | `astronauts` | The current conda environment | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -326,7 +512,7 @@ This does not suppress conda's own prompt modifier, you may want to run `conda c # ~/.config/starship.toml [conda] -style = "dimmed green" +format = "[$symbol$environment](dimmed green) " ``` ## Crystal @@ -338,11 +524,22 @@ The `crystal` module shows the currently installed version of Crystal. The modul ### Options -| Variable | Default | Description | -| ---------- | ------------ | --------------------------------------------------------- | -| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. | -| `style` | `"bold red"` | The style for the module. | -| `disabled` | `false` | Disables the `crystal` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | --------------------------------------------------------- | +| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. | +| `style` | `"bold red"` | The style for the module. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `crystal` module. | + +### Variables + +| Variable | Example | Description | +| --------- | --------- | ------------------------------------ | +| version | `v0.32.1` | The version of `crystal` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -350,8 +547,7 @@ The `crystal` module shows the currently installed version of Crystal. The modul # ~/.config/starship.toml [crystal] -symbol = "✨ " -style = "bold blue" +format = "via [✨ $version](bold blue) " ``` ## Directory @@ -364,18 +560,20 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an ### Options -| Variable | 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. | -| `prefix` | `"in "` | Prefix to display immediately before the directory. | -| `style` | `"bold cyan"` | The style for the module. | -| `disabled` | `false` | Disables the `directory` module. | +| Variable | Default | Description | +| ------------------------ | ----------------------------------------------- | -------------------------------------------------------------------------------- | +| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | +| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | +| `format` | `"[$path]($style)[$lock_symbol]($lock_style) "` | The format for the module. | +| `style` | `"bold cyan"` | The style for the module. | +| `disabled` | `false` | Disables the `directory` module. | +| `read_only_symbol` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_symbol_style` | `"red"` | The style for the read only symbol. |
This module has a few advanced configuration options that control how the directory is displayed. -| Variable | Default | Description | +| Advanced Option | Default | Description | | --------------------------- | ------- | ---------------------------------------------------------------------------------------- | | `substitutions` | | A table of substitutions to be made to the path. | | `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. | @@ -393,6 +591,15 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an
+### Variables + +| Variable | Example | Description | +| --------- | --------------------- | ----------------------------------- | +| path | `"D:/Projects"` | The current directory path | +| style\* | `"black bold dimmed"` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + ### Example ```toml @@ -408,12 +615,23 @@ The `docker_context` module shows the currently active [Docker context](https:// ### Options -| Variable | Default | Description | -| ----------------- | ------------- | --------------------------------------------------------------------------------------- | -| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context . | -| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. | -| `style` | `"bold blue"` | The style for the module. | -| `disabled` | `true` | Disables the `docker_context` module. | +| Option | Default | Description | +| ----------------- | ---------------------------------- | --------------------------------------------------------------------------------------- | +| `format` | `"via [$symbol$context]($style) "` | The format for the module. | +| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context. | +| `style` | `"blue bold"` | The style for the module. | +| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. | +| `disabled` | `true` | Disables the `docker_context` module. | + +### Variables + +| Variable | Example | Description | +| --------- | -------------- | ------------------------------------ | +| context | `test_context` | The current docker context | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -421,25 +639,51 @@ The `docker_context` module shows the currently active [Docker context](https:// # ~/.config/starship.toml [docker_context] -symbol = "🐋 " +format = "via [🐋 $context](blue bold)" ``` ## Dotnet The `dotnet` module shows the relevant version of the .NET Core SDK for the current directory. If the SDK has been pinned in the current directory, the pinned version is shown. Otherwise the module shows the latest installed version of the SDK. -This module will only be shown in your prompt when one of the following files are present in the current directory: `global.json`, `project.json`, `*.sln`, `*.csproj`, `*.fsproj`, `*.xproj`. You'll also need the .NET Core command-line tools installed in order to use it correctly. +This module will only be shown in your prompt when one or more of the following files are present in the current directory: + +- `global.json` +- `project.json` +- `Directory.Build.props` +- `Directory.Build.targets` +- `Packages.props` +- `*.sln` +- `*.csproj` +- `*.fsproj` +- `*.xproj` + +You'll also need the .NET Core SDK installed in order to use it correctly. Internally, this module uses its own mechanism for version detection. Typically it is twice as fast as running `dotnet --version`, but it may show an incorrect version if your .NET project has an unusual directory layout. If accuracy is more important than speed, you can disable the mechanism by setting `heuristic = false` in the module options. +The module will also show the Target Framework Moniker () when there is a csproj file in the current directory. + ### Options -| Variable | Default | Description | -| ----------- | ------------- | -------------------------------------------------------- | -| `symbol` | `"•NET "` | The symbol used before displaying the version of dotnet. | -| `heuristic` | `true` | Use faster version detection to keep starship snappy. | -| `style` | `"bold blue"` | The style for the module. | -| `disabled` | `false` | Disables the `dotnet` module. | +| Option | Default | Description | +| ----------- | ---------------------------------------- | -------------------------------------------------------- | +| `format` | `"v[$symbol$version( 🎯 $tfm)]($style) "` | The format for the module. | +| `symbol` | `"•NET "` | The symbol used before displaying the version of dotnet. | +| `heuristic` | `true` | Use faster version detection to keep starship snappy. | +| `style` | `"bold blue"` | The style for the module. | +| `disabled` | `false` | Disables the `dotnet` module. | + +### Variables + +| Variable | Example | Description | +| --------- | ---------------- | ------------------------------------------------------------------ | +| version | `v3.1.201` | The version of `dotnet` sdk | +| tfm | `netstandard2.0` | The Target Framework Moniker that the current project is targeting | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -460,11 +704,23 @@ The `elixir` module shows the currently installed version of Elixir and Erlang/O ### Options -| Variable | Default | Description | -| ---------- | --------------- | --------------------------------------------------------------- | -| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. | -| `style` | `"bold purple"` | The style for the module. | -| `disabled` | `false` | Disables the `elixir` module. | +| 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. | +| `disabled` | `false` | Disables the `elixir` module. | + +### Variables + +| Variable | Example | Description | +| ----------- | ------- | ------------------------------------ | +| version | `v1.10` | The version of `elixir` | +| otp_version | | The otp version of `elixir` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -487,12 +743,22 @@ The `elm` module shows the currently installed version of Elm. The module will b ### Options -| Variable | Default | Description | -| ---------- | ------------- | ----------------------------------------------------- | -| `symbol` | `"🌳 "` | The symbol used before displaying the version of Elm. | -| `style` | `"bold cyan"` | The style for the module. | -| `disabled` | `false` | Disables the `elm` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🌳 "` | A format string representing the symbol of Elm. | +| `style` | `"cyan bold"` | The style for the module. | +| `disabled` | `false` | Disables the `elm` module. | +### Variables + +| Variable | Example | Description | +| --------- | --------- | ------------------------------------ | +| version | `v0.19.1` | The version of `elm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -500,7 +766,7 @@ The `elm` module shows the currently installed version of Elm. The module will b # ~/.config/starship.toml [elm] -symbol = " " +format = "via [ $version](cyan bold) " ``` ## Environment Variable @@ -512,15 +778,23 @@ The `env_var` module displays the current value of a selected environment variab ### Options -| Variable | Default | Description | -| ---------- | --------------------- | ---------------------------------------------------------------------------- | -| `symbol` | | The symbol used before displaying the variable value. | -| `variable` | | The environment variable to be displayed. | -| `default` | | The default value to be displayed when the selected variable is not defined. | -| `prefix` | `""` | Prefix to display immediately before the variable value. | -| `suffix` | `""` | Suffix to display immediately after the variable value. | -| `style` | `"dimmed bold black"` | The style for the module. | -| `disabled` | `false` | Disables the `env_var` module. | +| Option | Default | Description | +| ---------- | ------------------------------ | ---------------------------------------------------------------------------- | +| `symbol` | | The symbol used before displaying the variable value. | +| `variable` | | The environment variable to be displayed. | +| `default` | | The default value to be displayed when the selected variable is not defined. | +| `format` | `"with [$env_value]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `env_var` module. | + +### Variables + +| Variable | Example | Description | +| --------- | ------------------------------------------- | ------------------------------------------ | +| env_value | `Windows NT` (if *variable* would be `$OS`) | The environment value of option `variable` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | `black bold dimmed` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -541,11 +815,22 @@ The `erlang` module shows the currently installed version of Erlang/OTP. The mod ### Options -| Variable | Default | Description | -| ---------- | ---------- | -------------------------------------------------------- | -| `symbol` | `"🖧 "` | The symbol used before displaying the version of Erlang. | -| `style` | `bold red` | The style for this module. | -| `disabled` | `false` | Disables the `erlang` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | -------------------------------------------------------- | +| `symbol` | `"🖧 "` | The symbol used before displaying the version of erlang. | +| `style` | `"bold red"` | The style for the module. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `erlang` module. | + +### Variables + +| Variable | Example | Description | +| --------- | --------- | ------------------------------------ | +| version | `v22.1.3` | The version of `erlang` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -553,7 +838,7 @@ The `erlang` module shows the currently installed version of Erlang/OTP. The mod # ~/.config/starship.toml [erlang] -symbol = "e " +format = "via [e $version](bold red) " ``` ## Git Branch @@ -562,13 +847,24 @@ The `git_branch` module shows the active branch of the repo in your current dire ### Options -| Variable | Default | Description | -| ------------------- | --------------- | ------------------------------------------------------------------------------------- | -| `symbol` | `" "` | The symbol used before the branch name of the repo in your current directory. | -| `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes | -| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. You can use "" for no symbol | -| `style` | `"bold purple"` | The style for the module. | -| `disabled` | `false` | Disables the `git_branch` module. | +| Option | Default | Description | +| ------------------- | -------------------------------- | ---------------------------------------------------------------------------------------- | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. Use `"$branch"` to refer to the current branch name. | +| `symbol` | `" "` | A format string representing the symbol of git branch. | +| `style` | `"bold purple"` | The style for the module. | +| `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes. | +| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. You can use `""` for no symbol. | +| `disabled` | `false` | Disables the `git_branch` module. | + +### Variables + +| Variable | Example | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| branch | `master` | The current branch name, falls back to `HEAD` if there's no current branch (e.g. git detached HEAD). | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -587,14 +883,22 @@ The `git_commit` module shows the current commit hash of the repo in your curren ### Options -| Variable | Default | Description | -| -------------------- | -------------- | ----------------------------------------------------- | -| `commit_hash_length` | `7` | The length of the displayed git commit hash. | -| `prefix` | `"("` | Prefix to display immediately before git commit. | -| `suffix` | `")"` | Suffix to display immediately after git commit. | -| `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. | +| Option | Default | Description | +| -------------------- | ------------------------------ | ----------------------------------------------------- | +| `commit_hash_length` | `7` | The length of the displayed git commit hash. | +| `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. | + +### Variables + +| Variable | Example | Description | +| --------- | --------- | ----------------------------------- | +| hash | `b703eb3` | The current git commit hash | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -611,18 +915,29 @@ The `git_state` module will show in directories which are part of a git reposito ### Options -| Variable | Default | Description | -| ------------------ | ------------------ | ---------------------------------------------------------------------------------------------------------------- | -| `rebase` | `"REBASING"` | The text displayed when a `rebase` is in progress. | -| `merge` | `"MERGING"` | The text displayed when a `merge` is in progress. | -| `revert` | `"REVERTING"` | The text displayed when a `revert` is in progress. | -| `cherry_pick` | `"CHERRY-PICKING"` | The text displayed when a `cherry-pick` is in progress. | -| `bisect` | `"BISECTING"` | The text displayed when a `bisect` is in progress. | -| `am` | `"AM"` | The text displayed when an `apply-mailbox` (`git am`) is in progress. | -| `am_or_rebase` | `"AM/REBASE"` | The text displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. | -| `progress_divider` | `"/"` | The symbol or text which will separate the current and total progress amounts. (e.g., `" of "`, for `"3 of 10"`) | -| `style` | `"bold yellow"` | The style for the module. | -| `disabled` | `false` | Disables the `git_state` module. | +| 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. | +| `cherry_pick` | `"CHERRY-PICKING"` | A format string displayed when a `cherry-pick` is in progress. | +| `bisect` | `"BISECTING"` | A format string displayed when a `bisect` is in progress. | +| `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. | +| `disabled` | `false` | Disables the `git_state` module. | + +### Variables + +| Variable | Example | Description | +| ---------------- | ---------- | ----------------------------------- | +| state | `REBASING` | The current state of the repo | +| progress_current | `1` | The current operation progress | +| progress_total | `2` | The total operation progress | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -630,8 +945,8 @@ The `git_state` module will show in directories which are part of a git reposito # ~/.config/starship.toml [git_state] -progress_divider = " of " -cherry_pick = "🍒 PICKING" +format = "[\\($state( $progress_current of $progress_total)\\)]($style) " +cherry_pick = "[🍒 PICKING](bold red)" ``` ## Git Status @@ -640,37 +955,54 @@ The `git_status` module shows symbols representing the state of the repo in your ### Options -| Variable | Default | Description | -| ------------------ | -------------------------- | ------------------------------------------------------- | -| `conflicted` | `"="` | This branch has merge conflicts. | -| `conflicted_count` | [link](#git-status-counts) | Show and style the number of conflicts. | -| `ahead` | `"⇡"` | This branch is ahead of the branch being tracked. | -| `behind` | `"⇣"` | This branch is behind of the branch being tracked. | -| `diverged` | `"⇕"` | This branch has diverged from the branch being tracked. | -| `untracked` | `"?"` | There are untracked files in the working directory. | -| `untracked_count` | [link](#git-status-counts) | Show and style the number of untracked files. | -| `stashed` | `"$"` | A stash exists for the local repository. | -| `stashed_count` | [link](#git-status-counts) | Show and style the number of stashes. | -| `modified` | `"!"` | There are file modifications in the working directory. | -| `modified_count` | [link](#git-status-counts) | Show and style the number of modified files. | -| `staged` | `"+"` | A new file has been added to the staging area. | -| `staged_count` | [link](#git-status-counts) | Show and style the number of files staged files. | -| `renamed` | `"»"` | A renamed file has been added to the staging area. | -| `renamed_count` | [link](#git-status-counts) | Show and style the number of renamed files. | -| `deleted` | `"✘"` | A file's deletion has been added to the staging area. | -| `deleted_count` | [link](#git-status-counts) | Show and style the number of deleted files. | -| `show_sync_count` | `false` | Show ahead/behind count of the branch being tracked. | -| `prefix` | `[` | Prefix to display immediately before git status. | -| `suffix` | `]` | Suffix to display immediately after git status. | -| `style` | `"bold red"` | The style for the module. | -| `disabled` | `false` | Disables the `git_status` module. | +| Option | Default | Description | +| ----------------- | ----------------------------------------------- | ---------------------------------------------------- | +| `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` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `show_sync_count` | `false` | Show ahead/behind count of the branch being tracked. | +| `style` | `"bold red"` | The style for the module. | +| `disabled` | `false` | Disables the `git_status` module. | -#### Git Status Counts +### Variables -| Variable | Default | Description | -| --------- | ------- | ------------------------------------------------------ | -| `enabled` | `false` | Show the number of files | -| `style` | | Optionally style the count differently than the module | +The following variables can be used in `format`: + +| Variable | Description | +| -------------- | --------------------------------------------------------------------------------------------- | +| `all_status` | Shortcut for`$conflicted$stashed$deleted$renamed$modified$staged$untracked` | +| `ahead_behind` | Displays `diverged` `ahead` or `behind` format string based on the current status of the repo | +| `conflicted` | Displays `conflicted` when this branch has merge conflicts. | +| `untracked` | Displays `untracked` when there are untracked files in the working directory. | +| `stashed` | Displays `stashed` when a stash exists for the local repository. | +| `modified` | Displays `modified` when there are file modifications in the working directory. | +| `staged` | Displays `staged` when a new file has been added to the staging area. | +| `renamed` | Displays `renamed` when a renamed file has been added to the staging area. | +| `deleted` | Displays `deleted` when a file's deletion has been added to the staging area. | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +The following variables can be used in `diverged`: + +| Variable | Description | +| -------------- | ---------------------------------------------- | +| `ahead_count` | Number of commits ahead of the tracking branch | +| `behind_count` | Number of commits behind the tracking branch | + +The following variables can be used in `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` and `deleted`: + +| Variable | Description | +| -------- | ------------------------ | +| `count` | Show the number of files | ### Example @@ -685,10 +1017,7 @@ diverged = "😵" untracked = "🤷‍" stashed = "📦" modified = "📝" -staged.value = "++" -staged.style = "green" -staged_count.enabled = true -staged_count.style = "green" +staged = '[++\($count\)](green)' renamed = "👅" deleted = "🗑" ``` @@ -708,11 +1037,22 @@ The `golang` module shows the currently installed version of Golang. The module ### Options -| Variable | Default | Description | -| ---------- | ------------- | -------------------------------------------------------- | -| `symbol` | `"🐹 "` | The symbol used before displaying the version of Golang. | -| `style` | `"bold cyan"` | The style for the module. | -| `disabled` | `false` | Disables the `golang` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ---------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐹 "` | A format string representing the symbol of Go. | +| `style` | `"bold cyan"` | The style for the module. | +| `disabled` | `false` | Disables the `golang` module. | + +### Variables + +| Variable | Example | Description | +| --------- | --------- | ------------------------------------ | +| version | `v1.12.1` | The version of `go` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -720,30 +1060,42 @@ The `golang` module shows the currently installed version of Golang. The module # ~/.config/starship.toml [golang] -symbol = "🏎💨 " +format = "via [🏎💨 $version](bold cyan) " ``` -## Haskell -The `haskell` module shows the currently installed version of Haskell Stack version. The module will be shown if any of the following conditions are met: +## Helm -- The current directory contains a `stack.yaml` file +The `helm` module shows the currently installed version of Helm. The module will be shown if any of the following conditions are met: + +- The current directory contains a `helmfile.yaml` file +- The current directory contains a `Chart.yaml` file ### Options -| Variable | Default | Description | -| ---------- | ------------ | --------------------------------------------------------- | -| `symbol` | `"λ "` | The symbol used before displaying the version of Haskell. | -| `style` | `"bold red"` | The style for the module. | -| `disabled` | `false` | Disables the `haskell` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⎈ "` | A format string representing the symbol of Helm. | +| `style` | `"bold white"` | The style for the module. | +| `disabled` | `false` | Disables the `helm` module. | +### Variables + +| Variable | Example | Description | +| --------- | -------- | ------------------------------------ | +| version | `v3.1.1` | The version of `helm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example ```toml # ~/.config/starship.toml -[haskell] -symbol = " " +[helm] +format = "via [⎈ $version](bold white) " ``` ## Hostname @@ -752,14 +1104,23 @@ The `hostname` module shows the system hostname. ### Options -| Variable | Default | Description | -| ---------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | -| `ssh_only` | `true` | Only show hostname when connected to an SSH session. | -| `prefix` | `""` | Prefix to display immediately before the hostname. | -| `suffix` | `""` | Suffix to display immediately after the hostname. | -| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation | -| `style` | `"bold dimmed green"` | The style for the module. | -| `disabled` | `false` | Disables the `hostname` module. | +| Option | Default | Description | +| ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `ssh_only` | `true` | Only show hostname when connected to an SSH session. | +| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation | +| `format` | `"on [$hostname]($style) "` | The format for the module. | +| `style` | `"bold dimmed green"` | The style for the module. | +| `disabled` | `false` | Disables the `hostname` module. | + +### Variables + +| Variable | Example | Description | +| --------- | ------- | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -768,8 +1129,7 @@ The `hostname` module shows the system hostname. [hostname] ssh_only = false -prefix = "⟪" -suffix = "⟫" +format = "on [$hostname](bold red) " trim_at = ".companyname.com" disabled = false ``` @@ -783,11 +1143,22 @@ The `java` module shows the currently installed version of Java. The module will ### Options -| Variable | Default | Description | -| ---------- | -------------- | ------------------------------------------------------ | -| `symbol` | `"☕ "` | The symbol used before displaying the version of Java. | -| `style` | `"dimmed red"` | The style for the module. | -| `disabled` | `false` | Disables the `java` module. | +| Option | Default | Description | +| ---------- | -------------------------------------- | ----------------------------------------------- | +| `format` | `"via [${symbol}${version}]($style) "` | The format for the module. | +| `symbol` | `"☕ "` | A format string representing the symbol of Java | +| `style` | `"red dimmed"` | The style for the module. | +| `disabled` | `false` | Disables the `java` module. | + +### Variables + +| Variable | Example | Description | +| --------- | ------- | ------------------------------------ | +| version | `v14` | The version of `java` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -804,12 +1175,23 @@ The `jobs` module shows the current number of jobs running. The module will be s ### Options -| Variable | Default | Description | -| ----------- | ------------- | ----------------------------------------------------- | -| `symbol` | `"✦"` | The symbol used before displaying the number of jobs. | -| `threshold` | `1` | Show number of jobs if exceeded. | -| `style` | `"bold blue"` | The style for the module. | -| `disabled` | `false` | Disables the `jobs` module. | +| Option | Default | Description | +| ----------- | ----------------------------- | ------------------------------------------------ | +| `threshold` | `1` | Show number of jobs if exceeded. | +| `format` | `"[$symbol$number]($style) "` | The format for the module. | +| `symbol` | `"✦"` | A format string representing the number of jobs. | +| `style` | `"bold blue"` | The style for the module. | +| `disabled` | `false` | Disables the `jobs` module. | + +### Variables + +| Variable | Example | Description | +| --------- | ------- | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -831,11 +1213,22 @@ The `julia` module shows the currently installed version of Julia. The module wi ### Options -| Variable | Default | Description | -| ---------- | --------------- | ------------------------------------------------------- | -| `symbol` | `"ஃ "` | The symbol used before displaying the version of Julia. | -| `style` | `"bold purple"` | The style for the module. | -| `disabled` | `false` | Disables the `julia` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"ஃ "` | A format string representing the symbol of Julia. | +| `style` | `"bold purple"` | The style for the module. | +| `disabled` | `false` | Disables the `julia` module. | + +### Variables + +| Variable | Example | Description | +| --------- | -------- | ------------------------------------ | +| version | `v1.4.0` | The version of `julia` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -845,6 +1238,7 @@ The `julia` module shows the currently installed version of Julia. The module wi [julia] symbol = "∴ " ``` + ## Kubernetes Displays the current Kubernetes context name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`. @@ -857,12 +1251,25 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ### Options -| Variable | Default | Description | -| ----------------- | ------------- | --------------------------------------------------- | -| `symbol` | `"☸ "` | The symbol used before displaying the Cluster info. | -| `context_aliases` | | Table of context aliases to display | -| `style` | `"bold blue"` | The style for the module. | -| `disabled` | `true` | Disables the `kubernetes` module | +| Option | Default | Description | +| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- | +| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. | +| `format` | `"on [$symbol$context( \\($namespace\\))]($style) "` | 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. | + +### Variables + +| Variable | Example | Description | +| --------- | -------------------- | ---------------------------------------- | +| context | `starship-cluster` | The current kubernetes context | +| namespace | `starship-namespace` | If set, the current kubernetes namespace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -870,8 +1277,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y # ~/.config/starship.toml [kubernetes] -symbol = "⛵ " -style = "dimmed green" +format = "on [⛵ $context \\($namespace\\)](dimmed green) " disabled = false [kubernetes.context_aliases] "dev.local.cluster.k8s" = "dev" @@ -883,7 +1289,7 @@ The `line_break` module separates the prompt into two lines. ### Options -| Variable | Default | Description | +| Option | Default | Description | | ---------- | ------- | ------------------------------------------------------------------ | | `disabled` | `false` | Disables the `line_break` module, making the prompt a single line. | @@ -910,15 +1316,26 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ### Options -| Variable | Default | Description | -| ----------------- | --------------------- | ------------------------------------------------------------- | -| `show_percentage` | `false` | Display memory usage as a percentage of the available memory. | -| `show_swap` | `true` | Display swap usage if total swap is non-zero. | -| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. | -| `symbol` | `"🐏 "` | The symbol used before displaying the memory usage. | -| `separator` | `" | "` | The symbol or text that will seperate the ram and swap usage. | -| `style` | `"bold dimmed white"` | The style for the module. | -| `disabled` | `true` | Disables the `memory_usage` module. | +| Option | Default | Description | +| ----------- | --------------------------------------------- | -------------------------------------------------------- | +| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. | +| `format` | `"via $symbol [${ram}( | ${swap})]($style) "` | The format for the module. | +| `symbol` | `"🐏"` | The symbol used before displaying the memory usage. | +| `style` | `"bold dimmed white"` | The style for the module. | +| `disabled` | `true` | Disables the `memory_usage` module. | + +### Variables + +| Variable | Example | Description | +| ------------- | ------------- | ------------------------------------------------------------------ | +| ram | `31GiB/65GiB` | The usage/total RAM of the current system memory. | +| ram_pct | `48%` | The percentage of the current system memory. | +| swap\** | `1GiB/4GiB` | The swap memory size of the current system swap memory file. | +| swap_pct\** | `77%` | The swap memory percentage of the current system swap memory file. | +| symbol | `🐏` | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string \*\*: The SWAP file information is only displayed if detected on the current system ### Example @@ -941,13 +1358,24 @@ The `hg_branch` module shows the active branch of the repo in your current direc ### Options -| Variable | Default | Description | -| ------------------- | --------------- | -------------------------------------------------------------------------------------------- | -| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. | -| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes | -| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. | -| `style` | `"bold purple"` | The style for the module. | -| `disabled` | `true` | Disables the `hg_branch` module. | +| Option | Default | Description | +| ------------------- | -------------------------------- | -------------------------------------------------------------------------------------------- | +| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. | +| `style` | `"bold purple"` | The style for the module. | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. | +| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes | +| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. | +| `disabled` | `true` | Disables the `hg_branch` module. | + +### Variables + +| Variable | Example | Description | +| --------- | -------- | ------------------------------------ | +| branch | `master` | The active mercurial branch | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -955,7 +1383,7 @@ The `hg_branch` module shows the active branch of the repo in your current direc # ~/.config/starship.toml [hg_branch] -symbol = "🌱 " +format = "on [🌱 $branch](bold purple)" truncation_length = 4 truncation_symbol = "" ``` @@ -963,6 +1391,7 @@ truncation_symbol = "" ## Nim The `nim` module shows the currently installed version of Nim. The module will be shown if any of the following conditions are met: + - The current directory contains a `nim.cfg` file - The current directory contains a file with the `.nim` extension - The current directory contains a file with the `.nims` extension @@ -970,11 +1399,22 @@ The `nim` module shows the currently installed version of Nim. The module will b ### Options -| Variable | Default | Description | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | -| `style` | `"bold yellow"` | The style for the module. | -| `disabled` | `false` | Disables the `nim` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module | +| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | +| `style` | `"bold yellow"` | The style for the module. | +| `disabled` | `false` | Disables the `nim` module. | + +### Variables + +| Variable | Example | Description | +| --------- | -------- | ------------------------------------ | +| version | `v1.2.0` | The version of `nimc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -992,14 +1432,25 @@ The `nix_shell` module shows the nix-shell environment. The module will be shown ### Options -| Variable | Default | Description | -| ------------ | ------------- | ------------------------------------------------- | -| `use_name` | `false` | Display the name of the nix-shell. | -| `impure_msg` | `"impure"` | Customize the "impure" msg. | -| `pure_msg` | `"pure"` | Customize the "pure" msg. | -| `symbol` | `"❄️ "` | The symbol used before displaying the shell name. | -| `style` | `"bold blue"` | The style for the module. | -| `disabled` | `false` | Disables the `nix_shell` module. | +| Option | Default | Description | +| ------------ | -------------------------------------------------- | ----------------------------------------------------- | +| `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. | +| `pure_msg` | `"pure"` | A format string shown when the shell is pure. | +| `disabled` | `false` | Disables the `nix_shell` module. | + +### Variables + +| Variable | Example | Description | +| --------- | ------- | ------------------------------------ | +| state | `pure` | The state of the nix-shell | +| name | `lorri` | The name of the nix-shell | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -1008,10 +1459,9 @@ The `nix_shell` module shows the nix-shell environment. The module will be shown [nix_shell] disabled = true -use_name = true -impure_msg = "impure shell" -pure_msg = "pure shell" -symbol = "☃️ " +impure_msg = "[impure shell](bold red)" +pure_msg = "[pure shell](bold green)" +format = "via [☃️ $state( \\($name\\))](bold blue) " ``` ## NodeJS @@ -1021,15 +1471,27 @@ The `nodejs` module shows the currently installed version of NodeJS. The module - The current directory contains a `package.json` file - The current directory contains a `.node-version` file - The current directory contains a `node_modules` directory -- The current directory contains a file with the `.js` extension +- The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension +- The current directory contains a file with the `.ts` extension ### Options -| Variable | Default | Description | -| ---------- | -------------- | -------------------------------------------------------- | -| `symbol` | `"⬢ "` | The symbol used before displaying the version of NodeJS. | -| `style` | `"bold green"` | The style for the module. | -| `disabled` | `false` | Disables the `nodejs` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | -------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⬢ "` | A format string representing the symbol of NodeJS. | +| `style` | `"bold green"` | The style for the module. | +| `disabled` | `false` | Disables the `nodejs` module. | + +###  Variables + +| Variable | Example | Description | +| --------- | ---------- | ------------------------------------ | +| version | `v13.12.0` | The version of `node` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -1037,7 +1499,7 @@ The `nodejs` module shows the currently installed version of NodeJS. The module # ~/.config/starship.toml [nodejs] -symbol = "🤖 " +format = "via [🤖 $version](bold green) " ``` ## Package Version @@ -1056,12 +1518,23 @@ The `package` module is shown when the current directory is the repository for a ### Options -| Variable | Default | Description | -| ----------------- | ------------ | ---------------------------------------------------------- | -| `symbol` | `"📦 "` | The symbol used before displaying the version the package. | -| `style` | `"bold 208"` | The style for the module. | -| `display_private` | `false` | Enable displaying version for packages marked as private. | -| `disabled` | `false` | Disables the `package` module. | +| Option | Default | Description | +| ----------------- | ---------------------------------- | ---------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"📦 "` | The symbol used before displaying the version the package. | +| `style` | `"bold 208"` | The style for the module. | +| `display_private` | `false` | Enable displaying version for packages marked as private. | +| `disabled` | `false` | Disables the `package` module. | + +### Variables + +| Variable | Example | Description | +| --------- | -------- | ------------------------------------ | +| version | `v1.0.0` | The version of your package | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -1069,7 +1542,7 @@ The `package` module is shown when the current directory is the repository for a # ~/.config/starship.toml [package] -symbol = "🎁 " +format = "via [🎁 $version](208 bold) " ``` ## OCaml @@ -1085,11 +1558,22 @@ The `ocaml` module shows the currently installed version of OCaml. The module wi ### Options -| Variable | Default | Description | -| ---------- | --------------- | ------------------------------------------------------- | -| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | -| `style` | `"bold yellow"` | The style for the module. | -| `disabled` | `false` | Disables the `ocaml` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format string for the module. | +| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | +| `style` | `"bold yellow"` | The style for the module. | +| `disabled` | `false` | Disables the `ocaml` module. | + +### Variables + +| Variable | Example | Description | +| --------- | --------- | ------------------------------------ | +| version | `v4.10.0` | The version of `ocaml` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -1097,7 +1581,7 @@ The `ocaml` module shows the currently installed version of OCaml. The module wi # ~/.config/starship.toml [ocaml] -symbol = "🐪 " +format = "via [🐪 $version]($style) " ``` ## PHP @@ -1110,11 +1594,22 @@ The `php` module shows the currently installed version of PHP. The module will b ### Options -| Variable | Default | Description | -| ---------- | ------------ | ----------------------------------------------------- | -| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. | -| `style` | `"bold 147"` | The style for the module. | -| `disabled` | `false` | Disables the `php` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. | +| `style` | `"147 bold"` | The style for the module. | +| `disabled` | `false` | Disables the `php` module. | + +### Variables + +| Variable | Example | Description | +| --------- | -------- | ------------------------------------ | +| version | `v7.3.8` | The version of `php` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -1122,7 +1617,7 @@ The `php` module shows the currently installed version of PHP. The module will b # ~/.config/starship.toml [php] -symbol = "🔹 " +format = "via [🔹 $version](147 bold) " ``` ## Python @@ -1145,14 +1640,23 @@ The module will be shown if any of the following conditions are met: ### Options -| Variable | Default | Description | -| -------------------- | --------------- | --------------------------------------------------------------------------- | -| `symbol` | `"🐍 "` | The symbol used before displaying the version of Python. | -| `pyenv_version_name` | `false` | Use pyenv to get Python version | -| `pyenv_prefix` | `"pyenv "` | Prefix before pyenv version display (default display is `pyenv MY_VERSION`) | -| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | -| `style` | `"bold yellow"` | The style for the module. | -| `disabled` | `false` | Disables the `python` module. | +| Option | Default | Description | +| -------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${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 | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `disabled` | `false` | Disables the `python` module. | + +### Variables + +| Variable | Example | Description | +| ---------- | --------------- | ------------------------------------ | +| version | `"v3.8.1"` | The version of `python` | +| symbol | `"🐍 "` | Mirrors the value of option `symbol` | +| style | `"yellow bold"` | Mirrors the value of option `style` | +| virtualenv | `"venv"` | The current `virtualenv` name |
This module has some advanced configuration options. @@ -1193,11 +1697,22 @@ The `ruby` module shows the currently installed version of Ruby. The module will ### Options -| Variable | Default | Description | -| ---------- | ------------ | ------------------------------------------------------ | -| `symbol` | `"💎 "` | The symbol used before displaying the version of Ruby. | -| `style` | `"bold red"` | The style for the module. | -| `disabled` | `false` | Disables the `ruby` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"💎 "` | A format string representing the symbol of Ruby. | +| `style` | `"bold red"` | The style for the module. | +| `disabled` | `false` | Disables the `ruby` module. | + +### Variables + +| Variable | Example | Description | +| --------- | -------- | ------------------------------------ | +| version | `v2.5.1` | The version of `ruby` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -1217,11 +1732,22 @@ The `rust` module shows the currently installed version of Rust. The module will ### Options -| Variable | Default | Description | -| ---------- | ------------ | ------------------------------------------------------ | -| `symbol` | `"🦀 "` | The symbol used before displaying the version of Rust. | -| `style` | `"bold red"` | The style for the module. | -| `disabled` | `false` | Disables the `rust` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🦀 "` | A format string representing the symbol of Rust | +| `style` | `"bold red"` | The style for the module. | +| `disabled` | `false` | Disables the `rust` module. | + +### Variables + +| Variable | Example | Description | +| --------- | ----------------- | ------------------------------------ | +| version | `v1.43.0-nightly` | The version of `rustc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -1229,7 +1755,7 @@ The `rust` module shows the currently installed version of Rust. The module will # ~/.config/starship.toml [rust] -symbol = "⚙️ " +format = "via [⚙️ $version](red bold)" ``` ## Singularity @@ -1238,14 +1764,22 @@ The `singularity` module shows the current singularity image, if inside a contai ### Options -| Variable | Default | Description | -| ---------- | -------------------- | ------------------------------------------------ | -| `label` | `""` | Prefix before the image name display. | -| `prefix` | `"["` | Prefix to display immediately before image name. | -| `suffix` | `"]"` | Suffix to display immediately after image name. | -| `symbol` | `""` | The symbol used before the image name. | -| `style` | `"bold dimmed blue"` | The style for the module. | -| `disabled` | `false` | Disables the `singularity` module. | +| Option | Default | Description | +| ---------- | ------------------------------------ | ------------------------------------------------ | +| `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. | + +### Variables + +| Variable | Example | Description | +| --------- | ------------ | ------------------------------------ | +| env | `centos.img` | The current singularity image | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -1253,32 +1787,54 @@ The `singularity` module shows the current singularity image, if inside a contai # ~/.config/starship.toml [singularity] -symbol = "📦 " +format = "[📦 \\[$env\\]]($style) " ``` ## Terraform -The `terraform` module shows the currently selected terraform workspace and version. By default the terraform version is not shown, since this is slow on current versions of terraform when a lot of plugins are in use. The module will be shown if any of the following conditions are met: +The `terraform` module shows the currently selected terraform workspace and version. By default the terraform version is not shown, since this is slow on current versions of terraform when a lot of plugins are in use. If you still want to enable it, [follow the example shown below](#with-version). The module will be shown if any of the following conditions are met: - The current directory contains a `.terraform` folder - Current directory contains a file with the `.tf` extension ### Options -| Variable | Default | Description | -| -------------- | ------------ | ----------------------------------------------------------- | -| `symbol` | `"💠 "` | The symbol used before displaying the terraform workspace. | -| `show_version` | `false` | Shows the terraform version. Very slow on large workspaces. | -| `style` | `"bold 105"` | The style for the module. | -| `disabled` | `false` | Disables the `terraform` module. | +| Option | Default | Description | +| ---------- | ------------------------------------ | ----------------------------------------------------- | +| `format` | `"via [$symbol$workspace]($style) "` | The format string for the module. | +| `symbol` | `"💠 "` | A format string shown before the terraform workspace. | +| `style` | `"bold 105"` | The style for the module. | +| `disabled` | `false` | Disables the `terraform` module. | + +### Variables + +| Variable | Example | Description | +| --------- | ---------- | ------------------------------------ | +| version | `v0.12.24` | The version of `terraform` | +| workspace | `default` | The current terraform workspace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example +#### With Version + ```toml # ~/.config/starship.toml [terraform] -symbol = "🏎💨 " +format = "[🏎💨 $version$workspace]($style) " +``` + +#### Without version + +```toml +# ~/.config/starship.toml + +[terraform] +format = "[🏎💨 $workspace]($style) " ``` ## Time @@ -1293,16 +1849,26 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ### Options -| Variable | Default | Description | -| ----------------- | --------------- | ------------------------------------------------------------------------------------------------------------------- | -| `use_12hr` | `false` | Enables 12 hour formatting. | -| `format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. | -| `style` | `"bold yellow"` | The style for the module time. | -| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. | -| `disabled` | `true` | Disables the `time` module. | -| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | +| Option | Default | Description | +| ----------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `format` | `"at [$time]($style) "` | The format string for the module. | +| `use_12hr` | `false` | Enables 12 hour formatting | +| `time_format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. | +| `style` | `"bold yellow"` | The style for the module time | +| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 < x < 24. Allows floats to accommodate 30/45 minute timezone offsets. | +| `disabled` | `true` | Disables the `time` module. | +| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | -If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `format` will override the `use_12hr` setting. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. + +### Variables + +| Variable | Example | Description | +| --------- | ---------- | ----------------------------------- | +| time | `13:08:10` | The current time. | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -1311,7 +1877,8 @@ If `use_12hr` is `true`, then `format` defaults to `"%r"`. Otherwise, it default [time] disabled = false -format = "🕙[ %T ]" +format = "🕙[\\[ $time \\]]($style) " +time_format = "%T" utc_time_offset = "-5" time_range = "10:00:00-14:00:00" ``` @@ -1327,12 +1894,20 @@ The `username` module shows active user's username. The module will be shown if ### Options -| Variable | Default | Description | -| ------------- | --------------- | ------------------------------------- | -| `style_root` | `"bold red"` | The style used when the user is root. | -| `style_user` | `"bold yellow"` | The style used for non-root users. | -| `show_always` | `false` | Always shows the `username` module. | -| `disabled` | `false` | Disables the `username` module. | +| Option | Default | Description | +| ------------- | ------------------------ | ------------------------------------- | +| `style_root` | `"bold red"` | The style used when the user is root. | +| `style_user` | `"bold yellow"` | The style used for non-root users. | +| `format` | `"via [$user]($style) "` | The format for the module. | +| `show_always` | `false` | Always shows the `username` module. | +| `disabled` | `false` | Disables the `username` module. | + +### Variables + +| Variable | Example | Description | +| -------- | ------------ | ------------------------------------------------------------------------------------------- | +| `style` | `"red bold"` | Mirrors the value of option `style_root` when root is logged in and `style_user` otherwise. | +| `user` | `"matchai"` | The currently logged-in user ID. | ### Example @@ -1340,10 +1915,13 @@ The `username` module shows active user's username. The module will be shown if # ~/.config/starship.toml [username] -disabled = true +style_user = "white bold" +style_root = "black bold" +format = "user: [$user]($style) " +disabled = false +show_always = true ``` - ## Zig The `zig` module shows the currently installed version of Zig. The module will be shown if any of the following conditions are met: @@ -1352,11 +1930,22 @@ The `zig` module shows the currently installed version of Zig. The module will b ### Options -| Variable | Default | Description | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | -| `style` | `"bold yellow"` | The style for the module. | -| `disabled` | `false` | Disables the `zig` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | +| `style` | `"bold yellow"` | The style for the module. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `zig` module. | + +### Variables + +| Variable | Example | Description | +| --------- | -------- | ------------------------------------ | +| version | `v0.6.0` | The version of `zig` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -1372,6 +1961,7 @@ symbol = "⚡️ " The `custom` modules show the output of some arbitrary commands. These modules will be shown if any of the following conditions are met: + - The current directory contains a file whose name is in `files` - The current directory contains a directory whose name is in `directories` - The current directory contains a file whose extension is in `extensions` @@ -1391,24 +1981,34 @@ The order in which custom modules are shown can be individually set by setting ` ### Options -| Variable | Default | Description | -| ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. | -| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | -| `shell` | | [See below](#custom-command-shell) | -| `description` | `""` | The description of the module that is shown when running `starship explain`. | -| `files` | `[]` | The files that will be searched in the working directory for a match. | -| `directories` | `[]` | The directories that will be searched in the working directory for a match. | -| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | -| `symbol` | `""` | The symbol used before displaying the command output. | -| `style` | `"bold green"` | The style for the module. | -| `prefix` | `""` | Prefix to display immediately before the command output. | -| `suffix` | `""` | Suffix to display immediately after the command output. | -| `disabled` | `false` | Disables this `custom` module. | +| Option | Default | Description | +| ------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `command` | | The command whose output should be printed. | +| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | +| `shell` | | [See below](#custom-command-shell) | +| `description` | `""` | The description of the module that is shown when running `starship explain`. | +| `files` | `[]` | The files that will be searched in the working directory for a match. | +| `directories` | `[]` | The directories that will be searched in the working directory for a match. | +| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | +| `symbol` | `""` | The symbol used before displaying the command output. | +| `style` | `"bold green"` | The style for the module. | +| `format` | `"[$symbol$output]($style) "` | The format for the module. | +| `disabled` | `false` | Disables this `custom` module. | + +### Variables + +| Variable | Description | +| --------- | -------------------------------------- | +| output | The output of shell command in `shell` | +| symbol | Mirrors the value of option `symbol` | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string #### Custom command shell `shell` accepts a non-empty list of strings, where: + - The first string is the path to the shell to use to execute the command. - Other following arguments are passed to the shell. @@ -1459,11 +2059,22 @@ The `purescript` module shows the currently installed version of PureScript vers ### Options -| Variable | Default | Description | -| ---------- | -------------- | ------------------------------------------------------------ | -| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | -| `style` | `"bold white"` | The style for the module. | -| `disabled` | `false` | Disables the `purescript` module. | +| Option | Default | Description | +| ---------- | ---------------------------------- | ------------------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | +| `style` | `"bold white"` | The style for the module. | +| `disabled` | `false` | Disables the `purescript` module. | + +### Variables + +| Variable | Example | Description | +| --------- | -------- | ------------------------------------ | +| version | `0.13.5` | The version of `purescript` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Example @@ -1471,5 +2082,5 @@ The `purescript` module shows the currently installed version of PureScript vers # ~/.config/starship.toml [purescript] -symbol = "<=> " +format = "via [$symbol$version](bold white)" ``` diff --git a/docs/pt-PT/faq/README.md b/docs/pt-PT/faq/README.md index e6daa985..84be958c 100644 --- a/docs/pt-PT/faq/README.md +++ b/docs/pt-PT/faq/README.md @@ -5,9 +5,9 @@ - **Terminal Emulator**: [iTerm2](https://iterm2.com/) - **Theme**: Minimal - **Color Scheme**: [Snazzy](https://github.com/sindresorhus/iterm2-snazzy) - - **Font**: [Fira Code](https://github.com/tonsky/FiraCode) + - **Font**: [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads) - **Shell**: [Fish Shell](https://fishshell.com/) - - **Configuration**: [matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/master/.config/fish/config.fish) + - **Configuration**: [matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish) - **Prompt**: [Starship](https://starship.rs/) ## Do `prompt_order` and `.disabled` do the same thing? @@ -46,7 +46,7 @@ The prompt will use as much context as is provided, but no flags are "required". ## How do I run Starship on Linux distributions with older versions of glibc? -If you get an error like "*version 'GLIBC_2.18' not found (required by starship)*" when using the prebuilt binary (for example, on CentOS 6 or 7), you can use a binary compiled with `musl` instead of `glibc`: +If you get an error like "_version 'GLIBC_2.18' not found (required by starship)_" when using the prebuilt binary (for example, on CentOS 6 or 7), you can use a binary compiled with `musl` instead of `glibc`: ```sh curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux-musl @@ -56,13 +56,13 @@ curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux- 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: - - 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 [powerline-patched font](https://github.com/powerline/fonts). +- 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/). To test your system, run the following commands in a terminal: -``` +```sh echo -e "\xf0\x9f\x90\x8d" echo -e "\xee\x82\xa0" ``` @@ -70,3 +70,19 @@ 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). 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) + +## How do I uninstall Starship? + +Starship is just as easy to uninstall as it is to install in the first place. + +1. Remove any lines in your shell config (e.g. `~/.bashrc`) used to initialize Starship. +1. Delete the Starship binary. + +If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. + +If Starship was installed using the `curl | bash` script, the following command will delete the binary: + +```sh +# Locate and delete the starship binary +rm "$(which starship)" +``` diff --git a/docs/pt-PT/guide/README.md b/docs/pt-PT/guide/README.md index 88e7a57b..8f1bb81f 100644 --- a/docs/pt-PT/guide/README.md +++ b/docs/pt-PT/guide/README.md @@ -121,7 +121,7 @@ ### Prerequisites -- A [Powerline font](https://github.com/powerline/fonts) installed and enabled in your terminal (for example, try [Fira Code](https://github.com/tonsky/FiraCode)). +- A [Nerd Font](https://www.nerdfonts.com/) installed and enabled in your terminal (for example, try the [Fira Code Nerd Font](https://www.nerdfonts.com/font-downloads)). ### Getting Started @@ -224,7 +224,7 @@ If you are interested in helping contribute to starship, please take a look at o ### Code Contributors -This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. +This project exists thanks to all the people who contribute. [[Contribute](https://github.com/starship/starship/blob/master/CONTRIBUTING.md)]. ### Financial Contributors diff --git a/docs/ru-RU/advanced-config/README.md b/docs/ru-RU/advanced-config/README.md index 80192ef8..51ee5980 100644 --- a/docs/ru-RU/advanced-config/README.md +++ b/docs/ru-RU/advanced-config/README.md @@ -57,7 +57,16 @@ starship_precmd_user_func="set_win_title" precmd_functions+=(set_win_title) ``` -Если вам нравится результат, добавьте эти строки в конфигурационный файл оболочки (`~/.bashrc` или `~/.zsrhc`), чтобы сделать его постоянным. +If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. + +For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: + +```bash +function set_win_title(){ + echo -ne "\033]0; $(basename $PWD) \007" +} +starship_precmd_user_func="set_win_title" +``` ## Строки стиля diff --git a/docs/ru-RU/config/README.md b/docs/ru-RU/config/README.md index 5557dbdd..c2f1ec91 100644 --- a/docs/ru-RU/config/README.md +++ b/docs/ru-RU/config/README.md @@ -15,24 +15,26 @@ mkdir -p ~/.config && touch ~/.config/starship.toml Вся конфигурация Starship выполняется в этом файле [TOML](https://github.com/toml-lang/toml): ```toml -# Не добавлять пустую строку в начале ввода +# Don't print a new line at the start of the prompt add_newline = false -# Поменять символ "❯" на символ "➜" -[character] # Имя настраемого модуля - "character" -symbol = "➜" # Сегменту "symbol" присваеваем значение "➜" +# Replace the "❯" symbol in the prompt with "➜" +[character] # The name of the module we are configuring is "character" +success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green" -# Отключить модуль пакетов, полностью скрывая его из терминала +# Disable the package module, hiding it from the prompt completely [package] disabled = true ``` Вы можете изменить расположение файла `starship.toml` переменной окружения `STARSHIP_CONFIG`: + ```sh export STARSHIP_CONFIG=~/.starship ``` Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: + ```ps1 $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` @@ -41,16 +43,39 @@ $ENV:STARSHIP_CONFIG = "$HOME\.starship" **Модуль**: Компонент строки, дающий информацию на основе контекстной информации вашей ОС. Например, модуль "nodejs" показывает установленную версию NodeJS на вашем компьютере, если вы находитесь в директории проекта NodeJS. -**Сегмент**: Меньшие подкомпоненты, составляющие модуль. Например, сегмент "symbol" в модуле "nodejs" хранит символ, показываемый перед версией NodeJS (⬢, по умолчанию). +**Variable**: Smaller sub-components that contains information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of NodeJS. -Вот представление модуля "nodejs". В примере, "symbol" и "version" - его сегменты. Также, каждый модуль имеет префикс и суффикс, являющиеся цветом терминала по умолчанию. +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. -``` -[prefix] [symbol] [version] [suffix] - "via " "⬢" "v10.4.1" "" -``` +### Format Strings -### Стиль строк +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. + +#### Переменная + +A variable contains a `$` symbol followed by the name of the variable. The name of a variable only contains letters, numbers and `_`. + +For example: + +- `$version` is a format string with a variable named `version`. +- `$git_branch$git_commit` is a format string with two variables named `git_branch` and `git_commit`. +- `$git_branch $git_commit` has the two variables separated with a space. + +#### Text Group + +A text group is made up of two different parts. + +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. + +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used style the first part. + +For example: + +- `[on](red bold)` will print a string `on` with bold text colored red. +- `[⬢ $version](bold green)` will print a symbol `⬢` followed by the content of variable `version`, with bold text colored green. +- `[a [b](red) c](green)` will print `a b c` with `b` red, and `a` and `c` green. + +#### Строки стиля В Starship, большинство модулей позволяют настроить стили отображения. Это делается записью (обычно называется `style`), которая представляет собой строку, определяющую конфигурацию. Ниже приведены несколько примеров стилей строк, а также, их действия. Подробнее о полном синтаксисе можно прочитать в [расширенном разделе конфигурации](/advanced-config/). @@ -63,80 +88,128 @@ $ENV:STARSHIP_CONFIG = "$HOME\.starship" Обратите внимание на то, что, вид стиля зависит от вашего эмулятора терминала. Например, некоторые эмуляторы терминала будут использовать яркие цвета вместо жирного текста, и некоторые цветовые темы используют одинаковые значение для обычных и ярких цветов. Также, чтобы получить курсивный текст, ваш терминал должен поддерживать курсив. +#### Conditional Format Strings + +A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. + +For example: + +- `(@$region)` will show nothing if the variable `region` is `None`, otherwise `@` followed by the value of region. +- `(some text)` will always show nothing since there are no variables wrapped in the braces. +- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. + +#### Escapable characters + +The following symbols have special usage in a format string. If you want to print the following symbols, you have to escape them with a backslash (`\`). + +- $ +- \\ +- [ +- ] +- ( +- ) + +Note that `toml` has [its own escape syntax](https://github.com/toml-lang/toml#user-content-string). It is recommended to use a literal string (`''`) in your config. If you want to use a basic string (`""`), pay attention to escape the backslash `\`. + +For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: + +```toml +# with basic string +format = "\n\\$" + +# with multiline basic string +format = """ + +\\$""" + +# with literal string +format = ''' + +\$''' +``` + ## Командная строка Ниже находится список опций, применяющихся для всей командной строки. ### Опции -| Переменная | По умолчанию | Описание | -| -------------- | ------------------------------- | -------------------------------------------------------- | -| `add_newline` | `true` | Добавление пустой строки перед началом командной строки. | -| `prompt_order` | [ссылка](#default-prompt-order) | Настройка порядка появления модулей командной строки. | -| `scan_timeout` | `30` | Тайм-аут запуска сканирования файлов (в миллисекундах). | +| Option | По умолчанию | Описание | +| -------------- | -------------------------------- | ------------------------------------------------------- | +| `format` | [ссылка](#default-prompt-format) | Configure the format of the prompt. | +| `scan_timeout` | `30` | Тайм-аут запуска сканирования файлов (в миллисекундах). | ### Пример ```toml # ~/.config/starship.toml -# Не добавлять пустую строку перед началом командной строки -add_newline = false -# Перезаписать default_prompt_order и использовать пользовательский prompt_order -prompt_order=["rust","line_break","package","line_break","character"] -# Ждать 10 миллисекунд перед запуском сканирования файлов. +# Disable the newline at the start of the prompt +format = "$all" + +# Use custom format +format = """ +[┌───────────────────>](bold green) +[│](bold green)$directory$rust$package +[└─>](bold green) """ + +# Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 ``` -### Порядок модулей командной строки по умолчанию +### Default Prompt Format -По умолчанию, `prompt_order` определеят порядок появления модулей командной строки, если `prompt_order` пустой или не объявлен. Значение по умолчанию: +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. Значение по умолчанию: ```toml -prompt_order = [ - "username", - "hostname", - "kubernetes", - "directory", - "git_branch", - "git_commit", - "git_state", - "git_status", - "hg_branch", - "docker_context", - "package", - "dotnet", - "elixir", - "elm", - "erlang", - "golang", - "haskell", - "java", - "julia", - "nim", - "nodejs", - "ocaml", - "php", - "purescript", - "python", - "ruby", - "rust", - "terraform", - "zig", - "nix_shell", - "conda", - "memory_usage", - "aws", - "env_var", - "crystal", - "cmd_duration", - "custom", - "line_break", - "jobs", - "battery", - "time", - "character", -] +format = "\n$all" + +# Which is equivalent to +format = """ + +$username\ +$hostname\ +$kubernetes\ +$directory\ +$git_branch\ +$git_commit\ +$git_state\ +$git_status\ +$hg_branch\ +$docker_context\ +$package\ +$cmake\ +$dotnet\ +$elixir\ +$elm\ +$erlang\ +$golang\ +$helm\ +$java\ +$julia\ +$nim\ +$nodejs\ +$ocaml\ +$php\ +$purescript\ +$python\ +$ruby\ +$rust\ +$terraform\ +$zig\ +$nix_shell\ +$conda\ +$memory_usage\ +$aws\ +$env_var\ +$crystal\ +$cmd_duration\ +$custom\ +$line_break\ +$jobs\ +$battery\ +$time\ +$character""" ``` ## AWS @@ -147,41 +220,80 @@ prompt_order = [ ### Опции -| Переменная | По умолчанию | Описание | -| ----------------- | --------------- | ---------------------------------------------------------------- | -| `symbol` | `"☁️ "` | Символ перед отображением текущего профиля AWS. | -| `displayed_items` | `all` | Выбор элементов. Возможные значения [`all`, `profile`, `region`] | -| `region_aliases` | | Таблица региона псевдонимов, отображаемая вместе с именем AWS. | -| `style` | `"bold yellow"` | Стиль модуля. | -| `disabled` | `false` | Отключение модуля `AWS`. | +| Option | По умолчанию | Описание | +| ---------------- | ---------------------------------------------------- | -------------------------------------------------------------- | +| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | The format for the module. | +| `symbol` | `"☁️ "` | Символ перед отображением текущего профиля AWS. | +| `region_aliases` | | Таблица региона псевдонимов, отображаемая вместе с именем AWS. | +| `style` | `"bold yellow"` | Стиль модуля. | +| `disabled` | `false` | Отключение модуля `AWS`. | -### Пример +### Variables + +| Переменная | Пример | Описание | +| ---------- | ---------------- | ------------------------------------ | +| region | `ap-northeast-1` | The current AWS region | +| profile | `astronauts` | The current AWS profile | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Examples + +#### Display everything ```toml # ~/.config/starship.toml [aws] +format = "on [$symbol$profile(\\($region\\))]($style) " style = "bold blue" symbol = "🅰 " -displayed_items = "region" [aws.region_aliases] ap-southeast-2 = "au" us-east-1 = "va" ``` +#### Display region + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$region]($style) " +style = "bold blue" +symbol = "🅰 " +[aws.region_aliases] +ap-southeast-2 = "au" +us-east-1 = "va" +``` + +#### Display profile + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$profile]($style) " +style = "bold blue" +symbol = "🅰 " +``` + ## Батарея Модуль `battery` показывает насколько заряжена батарея девайса и статус зарядки на данный момент. Модуль виден только, если заряд батареи устройства меньше 10%. ### Опции -| Переменная | По умолчанию | Описание | -| -------------------- | ------------------------ | ----------------------------------------------- | -| `full_symbol` | `"•"` | Символ, отображаемый при полной батарее. | -| `charging_symbol` | `"⇡"` | Символ, показываемый при зарядке аккумулятора. | -| `discharging_symbol` | `"⇣"` | Символ, показываемый при разрядке аккумулятора. | -| `display` | [link](#battery-display) | Порог отображения и стиль для модуля. | -| `disabled` | `false` | Отключает модуль `battery`. | +| Option | По умолчанию | Описание | +| -------------------- | --------------------------------- | ----------------------------------------------- | +| `full_symbol` | `"•"` | Символ, отображаемый при полной батарее. | +| `charging_symbol` | `"⇡"` | Символ, показываемый при зарядке аккумулятора. | +| `discharging_symbol` | `"⇣"` | Символ, показываемый при разрядке аккумулятора. | +| `format` | `"[$symbol$percentage]($style) "` | The format for the module. | +| `display` | [ссылка](#battery-display) | Порог отображения и стиль для модуля. | +| `disabled` | `false` | Отключает модуль `battery`. |
Также, есть опции для некоторых нетипичных состояний батареи. @@ -244,31 +356,85 @@ style = "bold yellow" Модуль `character` показывает символ (обычно, стрелка) рядом с вводимым текстом в терминале. -Символ показывает, была ли последняя команда успешной или нет. Это возможно двумя способами: меняя цвет (красный/зеленый) или изменяя его форму (❯/✖). Последнее будет исполняться только в том случае, если переменной `use_symbol_for_status` установлено значение `true`. +Символ показывает, была ли последняя команда успешной или нет. It can do this in two ways: + +- changing color (`red`/`green`) +- changing shape (`❯`/`✖`) + +By default it only changes color. If you also want to change it's shape take a look at [this example](#with-custom-error-shape). ### Опции -| Переменная | По умолчанию | Описание | -| ----------------------- | -------------- | ----------------------------------------------------------------------------------------------------------- | -| `symbol` | `"❯"` | Символ, используемый перед вводом текста в командной строке. | -| `error_symbol` | `"✖"` | Символ, используемый перед вводом текста, если предыдущая команда не удалась. | -| `use_symbol_for_status` | `false` | Показывает статус ошибки путем изменения символа. | -| `vicmd_symbol` | `"❮"` | Символ, используемый перед вводом текста в строке, если командная строка находится в нормальном режиме vim. | -| `style_success` | `"bold green"` | Используемый стиль, если последняя команда была успешной. | -| `style_failure` | `"bold red"` | Используемый стиль, если последняя команда была не успешной. | -| `disabled` | `false` | Отключает модуль `character`. | +| Option | По умолчанию | Описание | +| ---------------- | ------------------- | -------------------------------------------------------------------------------- | +| `format` | `"$symbol "` | The format string used before the text input. | +| `success_symbol` | `"[❯](bold green)"` | The format string used before the text input if the previous command succeeded. | +| `error_symbol` | `"[❯](bold red)"` | The format string used before the text input if the previous command failed. | +| `vicmd_symbol` | `"[❮](bold green)"` | The format string used before the text input if the shell is in vim normal mode. | +| `disabled` | `false` | Отключает модуль `character`. | -### Пример +### Variables + +| Переменная | Пример | Описание | +| ---------- | ------ | --------------------------------------------------------------------- | +| symbol | | A mirror of either `success_symbol`, `error_symbol` or `vicmd_symbol` | + +### Examples + +#### With custom error shape ```toml # ~/.config/starship.toml [character] -symbol = "➜" -error_symbol = "✗" -use_symbol_for_status = true +success_symbol = "[➜](bold green) " +error_symbol = "[✗](bold red) " ``` +#### Without custom error shape + +```toml +# ~/.config/starship.toml + +[character] +success_symbol = "[➜](bold green) " +error_symbol = "[➜](bold red) " +``` + +#### With custom vim shape + +```toml +# ~/.config/starship.toml + +[character] +vicmd_symbol = "[V](bold green) " +``` + +## CMake + +The `cmake` module shows the currently installed version of CMake if: + +- The current directory contains a `CMakeLists.txt` file + +### Опции + +| Option | По умолчанию | Описание | +| ---------- | ---------------------------------- | -------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🛆 "` | The symbol used before the version of cmake. | +| `style` | `"bold blue"` | Стиль модуля. | +| `disabled` | `false` | Disables the `cmake` module. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | --------- | ------------------------------------ | +| version | `v3.17.3` | The version of cmake | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + ## Длительность команды Модуль `cmd_duration` показывает время исполнения последней команды. Модуль будет показан только, если команда заняла более двух секунд, или если задан параметр `min_time`. @@ -283,13 +449,22 @@ use_symbol_for_status = true ### Опции -| Переменная | По умолчанию | Описание | -| ------------------- | --------------- | -------------------------------------------------------------------- | -| `min_time` | `2_000` | Кратчайшая продолжительность для показа времени (в миллисекундах). | -| `show_milliseconds` | `false` | Показывать миллисекунды в дополнение к секундам в продолжительности. | -| `prefix` | `took` | Префикс, отображаемый перед продолжительностью команды. | -| `style` | `"bold yellow"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `cmd_duration`. | +| Option | По умолчанию | Описание | +| ------------------- | ----------------------------- | -------------------------------------------------------------------- | +| `min_time` | `2_000` | Кратчайшая продолжительность для показа времени (в миллисекундах). | +| `show_milliseconds` | `false` | Показывать миллисекунды в дополнение к секундам в продолжительности. | +| `format` | `"took [$duration]($style) "` | The format for the module. | +| `style` | `"bold yellow"` | Стиль модуля. | +| `disabled` | `false` | Отключает модуль `cmd_duration`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | -------- | --------------------------------------- | +| duration | `16m40s` | The time it took to execute the command | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -298,7 +473,7 @@ use_symbol_for_status = true [cmd_duration] min_time = 500 -prefix = "underwent " +format = "underwent [$duration](bold yellow)" ``` ## Конда @@ -313,12 +488,23 @@ prefix = "underwent " ### Опции -| Переменная | По умолчанию | Описание | -| ------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `truncation_length` | `1` | Количество каталогов, в которых путь к окружению должен быть усечен, если окружение было создано через `conda create -p [path]`. `0` означает без усечения. Также смотрите модуль [`directory`](#directory). | -| `symbol` | `"C "` | Символ перед названием окружения. | -| `style` | `"bold green"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `conda`. | +| Option | По умолчанию | Описание | +| ------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `truncation_length` | `1` | Количество каталогов, в которых путь к окружению должен быть усечен, если окружение было создано через `conda create -p [path]`. `0` означает без усечения. Также смотрите модуль [`directory`](#directory). | +| `symbol` | `"🅒 "` | Символ перед названием окружения. | +| `style` | `"bold green"` | Стиль модуля. | +| `format` | `"[$symbol$environment]($style) "` | The format for the module. | +| `disabled` | `false` | Отключает модуль `conda`. | + +### Variables + +| Переменная | Пример | Описание | +| ----------- | ------------ | ------------------------------------ | +| environment | `astronauts` | The current conda environment | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -326,7 +512,7 @@ prefix = "underwent " # ~/.config/starship.toml [conda] -style = "dimmed green" +format = "[$symbol$environment](dimmed green) " ``` ## Crystal @@ -338,11 +524,22 @@ style = "dimmed green" ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | ------------ | ------------------------------------------------------- | -| `symbol` | `"🔮 "` | Символ, используемый перед отображением версии crystal. | -| `style` | `"bold red"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `crystal`. | +| Option | По умолчанию | Описание | +| ---------- | ---------------------------------- | ------------------------------------------------------- | +| `symbol` | `"🔮 "` | Символ, используемый перед отображением версии crystal. | +| `style` | `"bold red"` | Стиль модуля. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Отключает модуль `crystal`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | --------- | ------------------------------------ | +| version | `v0.32.1` | The version of `crystal` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -350,8 +547,7 @@ style = "dimmed green" # ~/.config/starship.toml [crystal] -symbol = "✨ " -style = "bold blue" +format = "via [✨ $version](bold blue) " ``` ## Каталог @@ -364,18 +560,20 @@ style = "bold blue" ### Опции -| Переменная | По умолчанию | Описание | -| ------------------- | ------------- | ---------------------------------------------------------------------------- | -| `truncation_length` | `3` | Количество родительских папок, к которым должен быть усечен текущий каталог. | -| `truncate_to_repo` | `true` | Следует или нет обрезать до корня репозитория git, в котором вы находитесь. | -| `prefix` | `"in "` | Префикс, отображаемый перед папкой. | -| `style` | `"bold cyan"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `directory`. | +| Переменная | По умолчанию | Описание | +| ------------------------ | ----------------------------------------------- | ---------------------------------------------------------------------------- | +| `truncation_length` | `3` | Количество родительских папок, к которым должен быть усечен текущий каталог. | +| `truncate_to_repo` | `true` | Следует или нет обрезать до корня репозитория git, в котором вы находитесь. | +| `format` | `"[$path]($style)[$lock_symbol]($lock_style) "` | The format for the module. | +| `style` | `"bold cyan"` | Стиль модуля. | +| `disabled` | `false` | Отключает модуль `directory`. | +| `read_only_symbol` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_symbol_style` | `"red"` | The style for the read only symbol. |
Этот модуль имеет несколько расширенных опций конфигурации, которые контролируют отображение каталога. -| Переменная | По умолчанию | Описание | +| Advanced Option | По умолчанию | Описание | | --------------------------- | ------------ | --------------------------------------------------------------------------------- | | `substitutions` | | A table of substitutions to be made to the path. | | `fish_style_pwd_dir_length` | `0` | Количество символов, используемых при использовании логики создания пути из fish. | @@ -393,6 +591,15 @@ style = "bold blue"
+### Variables + +| Переменная | Пример | Описание | +| ---------- | --------------------- | ----------------------------------- | +| path | `"D:/Projects"` | The current directory path | +| style\* | `"black bold dimmed"` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + ### Пример ```toml @@ -408,12 +615,23 @@ truncation_length = 8 ### Опции -| Переменная | По умолчанию | Описание | -| ----------------- | ------------- | --------------------------------------------------------------------------------------- | -| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context . | -| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. | -| `style` | `"bold blue"` | Стиль модуля. | -| `disabled` | `true` | Disables the `docker_context` module. | +| Option | По умолчанию | Описание | +| ----------------- | ---------------------------------- | --------------------------------------------------------------------------------------- | +| `format` | `"via [$symbol$context]($style) "` | The format for the module. | +| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context. | +| `style` | `"blue bold"` | Стиль модуля. | +| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. | +| `disabled` | `true` | Disables the `docker_context` module. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | -------------- | ------------------------------------ | +| context | `test_context` | The current docker context | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -421,25 +639,51 @@ truncation_length = 8 # ~/.config/starship.toml [docker_context] -symbol = "🐋 " +format = "via [🐋 $context](blue bold)" ``` ## Dotnet Модуль `dotnet` показывает соответствующую версию .NET Core SDK для текущего каталога. Если SDK был закреплен в текущей директории, будет показана закрепленная версия. В противном случае модуль отображает последнюю установленную версию SDK. -Этот модуль будет показан только, когда один из следующих файлов присутствует в текущей директории: `global.json`, `project.json`, `*.sln`, `*.csproj`, `*.fsproj`, `*.xproj`. Также, для правильного использования, нужны инструменты командной строки .NET Core. +This module will only be shown in your prompt when one or more of the following files are present in the current directory: + +- `global.json` +- `project.json` +- `Directory.Build.props` +- `Directory.Build.targets` +- `Packages.props` +- `*.sln` +- `*.csproj` +- `*.fsproj` +- `*.xproj` + +You'll also need the .NET Core SDK installed in order to use it correctly. Внутренне этот модуль использует свой собственный механизм определения версий. Обычно он в два раза быстрее, чем `dotnet --version`, но он может показывать неправильную версию, если ваш .NET проект имеет необычный формат каталога. Если точность важнее, чем скорость, вы можете отключить механизм опцией `heuristic = false` в настройках модуля. +The module will also show the Target Framework Moniker () when there is a csproj file in the current directory. + ### Опции -| Переменная | По умолчанию | Описание | -| ----------- | ------------- | ----------------------------------------------------------------- | -| `symbol` | `"•NET "` | Символ перед отображением текущей версии dotnet. | -| `heuristic` | `true` | Использовать быстрое определение версии, для сохранения скорости. | -| `style` | `"bold blue"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `dotnet`. | +| Option | По умолчанию | Описание | +| ----------- | ---------------------------------------- | ----------------------------------------------------------------- | +| `format` | `"v[$symbol$version( 🎯 $tfm)]($style) "` | The format for the module. | +| `symbol` | `"•NET "` | Символ перед отображением текущей версии dotnet. | +| `heuristic` | `true` | Использовать быстрое определение версии, для сохранения скорости. | +| `style` | `"bold blue"` | Стиль модуля. | +| `disabled` | `false` | Отключает модуль `dotnet`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | ---------------- | ------------------------------------------------------------------ | +| version | `v3.1.201` | The version of `dotnet` sdk | +| tfm | `netstandard2.0` | The Target Framework Moniker that the current project is targeting | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -460,11 +704,23 @@ heuristic = false ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | --------------- | ------------------------------------------------------------- | -| `symbol` | `"💧 "` | Символ, используемый перед отображением версии Elixir/Erlang. | -| `style` | `"bold purple"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `elixir`. | +| Option | По умолчанию | Описание | +| ---------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `symbol` | `"💧 "` | Символ, используемый перед отображением версии Elixir/Erlang. | +| `style` | `"bold purple"` | Стиль модуля. | +| `format` | `"via [$symbol$version \\(OTP $otp_version\\)]($style) "` | The format for the module elixir. | +| `disabled` | `false` | Отключает модуль `elixir`. | + +### Variables + +| Переменная | Пример | Описание | +| ----------- | ------- | ------------------------------------ | +| version | `v1.10` | The version of `elixir` | +| otp_version | | The otp version of `elixir` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -487,12 +743,22 @@ symbol = "🔮 " ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | ------------- | --------------------------------------------------- | -| `symbol` | `"🌳 "` | Символ, используемый перед отображением версии Elm. | -| `style` | `"bold cyan"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `elm`. | +| Option | По умолчанию | Описание | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🌳 "` | A format string representing the symbol of Elm. | +| `style` | `"cyan bold"` | Стиль модуля. | +| `disabled` | `false` | Отключает модуль `elm`. | +### Variables + +| Переменная | Пример | Описание | +| ---------- | --------- | ------------------------------------ | +| version | `v0.19.1` | The version of `elm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -500,7 +766,7 @@ symbol = "🔮 " # ~/.config/starship.toml [elm] -symbol = " " +format = "via [ $version](cyan bold) " ``` ## Переменная Окружения @@ -512,15 +778,23 @@ symbol = " " ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | --------------------- | ------------------------------------------------------------------ | -| `symbol` | | Символ, используемый перед отображением значения переменной. | -| `variable` | | Отображаемая переменная окружения. | -| `default` | | Значение отображаемое, когда выбранная переменная не определена. | -| `prefix` | `""` | Префикс, отображаемый, непосредственно перед значением переменной. | -| `suffix` | `""` | Префикс, отображаемый, непосредственно после значением переменной. | -| `style` | `"dimmed bold black"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `env_var`. | +| Option | По умолчанию | Описание | +| ---------- | ------------------------------ | ---------------------------------------------------------------- | +| `symbol` | | Символ, используемый перед отображением значения переменной. | +| `variable` | | Отображаемая переменная окружения. | +| `default` | | Значение отображаемое, когда выбранная переменная не определена. | +| `format` | `"with [$env_value]($style) "` | The format for the module. | +| `disabled` | `false` | Отключает модуль `env_var`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | ------------------------------------------- | ------------------------------------------ | +| env_value | `Windows NT` (if *variable* would be `$OS`) | The environment value of option `variable` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | `black bold dimmed` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -541,11 +815,22 @@ The `erlang` module shows the currently installed version of Erlang/OTP. Мод ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | ------------ | -------------------------------------------------------- | -| `symbol` | `"🖧 "` | The symbol used before displaying the version of Erlang. | -| `style` | `bold red` | The style for this module. | -| `disabled` | `false` | Disables the `erlang` module. | +| Option | По умолчанию | Описание | +| ---------- | ---------------------------------- | -------------------------------------------------------- | +| `symbol` | `"🖧 "` | The symbol used before displaying the version of erlang. | +| `style` | `"bold red"` | Стиль модуля. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `erlang` module. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | --------- | ------------------------------------ | +| version | `v22.1.3` | The version of `erlang` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -553,7 +838,7 @@ The `erlang` module shows the currently installed version of Erlang/OTP. Мод # ~/.config/starship.toml [erlang] -symbol = "e " +format = "via [e $version](bold red) " ``` ## Ветвь Git @@ -562,13 +847,24 @@ symbol = "e " ### Опции -| Переменная | По умолчанию | Описание | -| ------------------- | --------------- | --------------------------------------------------------------------------------------------------------------- | -| `symbol` | `" "` | Символ, используемый перед именем ветки репозитория в вашей текущей директории. | -| `truncation_length` | `2^63 - 1` | Отрезает ветку git до X графемов | -| `truncation_symbol` | `"…"` | Символ, используемый для обозначения усечения названия ветки. Вы можете использовать "", чтобы не видеть символ | -| `style` | `"bold purple"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `git_branch`. | +| Option | По умолчанию | Описание | +| ------------------- | -------------------------------- | --------------------------------------------------------------------------------------------- | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. Use `"$branch"` to refer to the current branch name. | +| `symbol` | `" "` | A format string representing the symbol of git branch. | +| `style` | `"bold purple"` | Стиль модуля. | +| `truncation_length` | `2^63 - 1` | Отрезает ветку git до X графемов. | +| `truncation_symbol` | `"…"` | Символ, используемый для обозначения усечения названия ветки. You can use `""` for no symbol. | +| `disabled` | `false` | Отключает модуль `git_branch`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | -------- | ---------------------------------------------------------------------------------------------------- | +| branch | `master` | The current branch name, falls back to `HEAD` if there's no current branch (e.g. git detached HEAD). | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -587,14 +883,22 @@ truncation_symbol = "" ### Опции -| Переменная | По умолчанию | Описание | -| -------------------- | -------------- | ----------------------------------------------------------------------- | -| `commit_hash_length` | `7` | Длина отображаемого хэша коммита git. | -| `prefix` | `"("` | Префикс, отображаемый сразу после коммита. | -| `suffix` | `")"` | Суффикс, отображаемый сразу после коммита git. | -| `style` | `"bold green"` | Стиль модуля. | -| `only_detached` | `true` | Показывать хэш коммита git, только находясь в состоянии отделённой HEAD | -| `disabled` | `false` | Отключает модуль `git_commit`. | +| Option | По умолчанию | Описание | +| -------------------- | ------------------------------ | ----------------------------------------------------------------------- | +| `commit_hash_length` | `7` | Длина отображаемого хэша коммита git. | +| `format` | `"[\\($hash\\)]($style) "` | The format for the module. | +| `style` | `"bold green"` | Стиль модуля. | +| `only_detached` | `true` | Показывать хэш коммита git, только находясь в состоянии отделённой HEAD | +| `disabled` | `false` | Отключает модуль `git_commit`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | --------- | ----------------------------------- | +| hash | `b703eb3` | The current git commit hash | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -611,18 +915,29 @@ commit_hash_length = 4 ### Опции -| Переменная | По умолчанию | Описание | -| ------------------ | ------------------ | ------------------------------------------------------------------------------------------------------------- | -| `rebase` | `"REBASING"` | Текст, отображаемый в процессе операции `rebase`. | -| `merge` | `"MERGING"` | Текст, отображаемый в процессе операции `merge`. | -| `revert` | `"REVERTING"` | Текст, отображаемый в процессе операции `revert`. | -| `cherry_pick` | `"CHERRY-PICKING"` | Текст, отображаемый в процессе операции `cherry-pick`. | -| `bisect` | `"BISECTING"` | Текст, отображаемый в процессе операции `bisect`. | -| `am` | `"AM"` | Текст, отображаемый в процессе операции `apply-mailbox` (`git am`). | -| `am_or_rebase` | `"AM/REBASE"` | Текст, отображаемый, когда выполняется неоднозначный процесс `apply-mailbox` или `rebase`. | -| `progress_divider` | `"/"` | Символ или текст, который будет разделять текущую и общую сумму прогресса. (напр., `" из "`, для `"3 из 10"`) | -| `style` | `"bold yellow"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `git_state`. | +| 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. | +| `cherry_pick` | `"CHERRY-PICKING"` | A format string displayed when a `cherry-pick` is in progress. | +| `bisect` | `"BISECTING"` | A format string displayed when a `bisect` is in progress. | +| `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. | +| `disabled` | `false` | Отключает модуль `git_state`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------------- | ---------- | ----------------------------------- | +| state | `REBASING` | The current state of the repo | +| progress_current | `1` | The current operation progress | +| progress_total | `2` | The total operation progress | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -630,8 +945,8 @@ commit_hash_length = 4 # ~/.config/starship.toml [git_state] -progress_divider = " of " -cherry_pick = "🍒 PICKING" +format = "[\\($state( $progress_current of $progress_total)\\)]($style) " +cherry_pick = "[🍒 PICKING](bold red)" ``` ## Статус Git @@ -640,37 +955,54 @@ cherry_pick = "🍒 PICKING" ### Опции -| Переменная | По умолчанию | Описание | -| ------------------ | ---------------------------- | ---------------------------------------------------------------- | -| `conflicted` | `"="` | Эта ветка имеет конфликты слияния. | -| `conflicted_count` | [ссылка](#git-status-counts) | Оформленно показывать количество конфликтов. | -| `ahead` | `"⇡"` | Эта ветка впереди отслеживаемой ветви. | -| `behind` | `"⇣"` | Эта ветка позади отслеживаемой ветви. | -| `diverged` | `"⇕"` | Эта ветка расходится от отслеживаемой ветки. | -| `untracked` | `"?"` | В рабочей директории есть неотслеженные файлы. | -| `untracked_count` | [ссылка](#git-status-counts) | Показывать в стиле количество неотслеженных файлов. | -| `stashed` | `"$"` | Для локального репозитория существует тайник. | -| `stashed_count` | [ссылка](#git-status-counts) | Оформленно показывать количество тайников. | -| `modified` | `"!"` | В рабочем директории есть изменения файлов. | -| `modified_count` | [ссылка](#git-status-counts) | Оформленно показывать количество измененных файлов. | -| `staged` | `"+"` | В промежуточную область добавлен новый файл. | -| `staged_count` | [ссылка](#git-status-counts) | Оформленно показывать количество файлов в промежуточной области. | -| `renamed` | `"»"` | В промежуточную область добавлен переименованный файл. | -| `renamed_count` | [ссылка](#git-status-counts) | Оформленно показывать количество переименованных файлов. | -| `deleted` | `"✘"` | Удаление файла было добавлено в промежуточную область. | -| `deleted_count` | [ссылка](#git-status-counts) | Оформленно показывать количество удаленных файлов. | -| `show_sync_count` | `false` | Показывать счетчик впереди/позади для отслеживаемой ветки. | -| `prefix` | `[` | Префикс для отображения сразу перед статусом git. | -| `suffix` | `]` | Суффикс, отображаемый сразу после статуса git. | -| `style` | `"bold red"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `git_status`. | +| Option | По умолчанию | Описание | +| ----------------- | ----------------------------------------------- | ---------------------------------------------------------- | +| `format` | "([\[$all_status$ahead_behind\]]($style) )" | The default format for `git_status` | +| `conflicted` | `"="` | Эта ветка имеет конфликты слияния. | +| `ahead` | `"⇡"` | The format of `ahead` | +| `behind` | `"⇣"` | The format of `behind` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `show_sync_count` | `false` | Показывать счетчик впереди/позади для отслеживаемой ветки. | +| `style` | `"bold red"` | Стиль модуля. | +| `disabled` | `false` | Отключает модуль `git_status`. | -#### Счетчик статуса Git +### Variables -| Переменная | По умолчанию | Описание | -| ---------- | ------------ | ------------------------------------------------------- | -| `enabled` | `false` | Показать количество файлов | -| `style` | | При желании, можно оформлять счетчик не так, как модуль | +The following variables can be used in `format`: + +| Переменная | Описание | +| -------------- | --------------------------------------------------------------------------------------------- | +| `all_status` | Shortcut for`$conflicted$stashed$deleted$renamed$modified$staged$untracked` | +| `ahead_behind` | Displays `diverged` `ahead` or `behind` format string based on the current status of the repo | +| `conflicted` | Displays `conflicted` when this branch has merge conflicts. | +| `untracked` | Displays `untracked` when there are untracked files in the working directory. | +| `stashed` | Displays `stashed` when a stash exists for the local repository. | +| `modified` | Displays `modified` when there are file modifications in the working directory. | +| `staged` | Displays `staged` when a new file has been added to the staging area. | +| `renamed` | Displays `renamed` when a renamed file has been added to the staging area. | +| `deleted` | Displays `deleted` when a file's deletion has been added to the staging area. | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +The following variables can be used in `diverged`: + +| Переменная | Описание | +| -------------- | ---------------------------------------------- | +| `ahead_count` | Number of commits ahead of the tracking branch | +| `behind_count` | Number of commits behind the tracking branch | + +The following variables can be used in `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` and `deleted`: + +| Переменная | Описание | +| ---------- | -------------------------- | +| `count` | Показать количество файлов | ### Пример @@ -685,10 +1017,7 @@ diverged = "😵" untracked = "🤷‍" stashed = "📦" modified = "📝" -staged.value = "++" -staged.style = "green" -staged_count.enabled = true -staged_count.style = "green" +staged = '[++\($count\)](green)' renamed = "👅" deleted = "🗑" ``` @@ -708,11 +1037,22 @@ deleted = "🗑" ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | ------------- | ------------------------------------------------------ | -| `symbol` | `"🐹 "` | Символ, используемый перед отображением версии Golang. | -| `style` | `"bold cyan"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `golang`. | +| Option | По умолчанию | Описание | +| ---------- | ---------------------------------- | ---------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐹 "` | A format string representing the symbol of Go. | +| `style` | `"bold cyan"` | Стиль модуля. | +| `disabled` | `false` | Отключает модуль `golang`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | --------- | ------------------------------------ | +| version | `v1.12.1` | The version of `go` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -720,30 +1060,42 @@ deleted = "🗑" # ~/.config/starship.toml [golang] -symbol = "🏎💨 " +format = "via [🏎💨 $version](bold cyan) " ``` -## Haskell -Модуль `haskell` показывает установленную версию Haskell Stack. Модуль будет показан, если любое из следующих условий соблюдено: +## Helm -- Текущий каталог содержит файл `stack.yaml` +The `helm` module shows the currently installed version of Helm. Модуль будет показан, если любое из следующих условий соблюдено: + +- Текущий каталог содержит файл `helmfile.yaml` +- The current directory contains a `Chart.yaml` file ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | ------------ | ------------------------------------------------- | -| `symbol` | `"λ "` | Символ перед отображением текущей версии Haskell. | -| `style` | `"bold red"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `haskell`. | +| Option | По умолчанию | Описание | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⎈ "` | A format string representing the symbol of Helm. | +| `style` | `"bold white"` | Стиль модуля. | +| `disabled` | `false` | Disables the `helm` module. | +### Variables + +| Переменная | Пример | Описание | +| ---------- | -------- | ------------------------------------ | +| version | `v3.1.1` | The version of `helm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример ```toml # ~/.config/starship.toml -[haskell] -symbol = " " +[helm] +format = "via [⎈ $version](bold white) " ``` ## Имя хоста @@ -752,14 +1104,23 @@ symbol = " " ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `ssh_only` | `true` | Показывать имя хоста только при подключении к SSH-сессии. | -| `prefix` | `""` | Префикс, отображаемый непосредственно перед именем хоста. | -| `suffix` | `""` | Суффикс, отображаемый непосредственно перед именем хоста. | -| `trim_at` | `"."` | Строка, по которую имя хоста будет сокращено после первого совпадения. `"."` остановится после первой точки. `""` отключит любое усечение | -| `style` | `"bold dimmed green"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `hostname`. | +| Option | По умолчанию | Описание | +| ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `ssh_only` | `true` | Показывать имя хоста только при подключении к SSH-сессии. | +| `trim_at` | `"."` | Символы, по которую имя хоста будет сокращено после первого совпадения. `"."` остановится после первой точки. `""` отключит любое усечение | +| `format` | `"on [$hostname]($style) "` | The format for the module. | +| `style` | `"bold dimmed green"` | Стиль модуля. | +| `disabled` | `false` | Отключает модуль `hostname`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | ------ | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -768,8 +1129,7 @@ symbol = " " [hostname] ssh_only = false -prefix = "⟪" -suffix = "⟫" +format = "on [$hostname](bold red) " trim_at = ".companyname.com" disabled = false ``` @@ -783,11 +1143,22 @@ disabled = false ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | -------------- | ---------------------------------------------------- | -| `symbol` | `"☕ "` | Символ, используемый перед отображением версии Java. | -| `style` | `"dimmed red"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `java`. | +| Option | По умолчанию | Описание | +| ---------- | -------------------------------------- | ----------------------------------------------- | +| `format` | `"via [${symbol}${version}]($style) "` | The format for the module. | +| `symbol` | `"☕ "` | A format string representing the symbol of Java | +| `style` | `"red dimmed"` | Стиль модуля. | +| `disabled` | `false` | Отключает модуль `java`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | ------ | ------------------------------------ | +| version | `v14` | The version of `java` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -804,12 +1175,23 @@ symbol = "🌟 " ### Опции -| Переменная | По умолчанию | Описание | -| ----------- | ------------- | --------------------------------------------------------- | -| `symbol` | `"✦"` | Символ, используемый перед отображением количества работ. | -| `threshold` | `1` | Показывать количество задач, если превышено. | -| `style` | `"bold blue"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `jobs`. | +| Option | По умолчанию | Описание | +| ----------- | ----------------------------- | ------------------------------------------------ | +| `threshold` | `1` | Показывать количество задач, если превышено. | +| `format` | `"[$symbol$number]($style) "` | The format for the module. | +| `symbol` | `"✦"` | A format string representing the number of jobs. | +| `style` | `"bold blue"` | Стиль модуля. | +| `disabled` | `false` | Отключает модуль `jobs`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | ------ | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -831,11 +1213,22 @@ The `julia` module shows the currently installed version of Julia. Модуль ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | --------------- | ------------------------------------------------------- | -| `symbol` | `"ஃ "` | The symbol used before displaying the version of Julia. | -| `style` | `"bold purple"` | Стиль модуля. | -| `disabled` | `false` | Disables the `julia` module. | +| Option | По умолчанию | Описание | +| ---------- | ---------------------------------- | ------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"ஃ "` | A format string representing the symbol of Julia. | +| `style` | `"bold purple"` | Стиль модуля. | +| `disabled` | `false` | Disables the `julia` module. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | -------- | ------------------------------------ | +| version | `v1.4.0` | The version of `julia` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -845,9 +1238,10 @@ The `julia` module shows the currently installed version of Julia. Модуль [julia] symbol = "∴ " ``` + ## Kubernetes -Отображает текущее контекстное имя Kubernetes и, если применено, пространство имён из файла kubeconfig. Пространство имен дожно быть задано в файле kubeconfig, это делается через `kubectl config set-context starship-cluster --namespace astronaut`. Если переменная окружения `$KUBECONFIG` задана, модуль будет использовать его значение, в противном случае будет использовать `~/.kube/config`. +Displays the current Kubernetes context name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`. ::: tip @@ -857,12 +1251,25 @@ symbol = "∴ " ### Опции -| Переменная | По умолчанию | Описание | -| ----------------- | ------------- | ------------------------------------------------------------- | -| `symbol` | `"☸ "` | Символ, используемый перед отображением информации о Cluster. | -| `context_aliases` | | Table of context aliases to display | -| `style` | `"bold blue"` | Стиль модуля. | -| `disabled` | `true` | Отключает модуль `kubernetes` | +| Option | По умолчанию | Описание | +| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- | +| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. | +| `format` | `"on [$symbol$context( \\($namespace\\))]($style) "` | 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`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | -------------------- | ---------------------------------------- | +| context | `starship-cluster` | The current kubernetes context | +| namespace | `starship-namespace` | If set, the current kubernetes namespace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -870,8 +1277,7 @@ symbol = "∴ " # ~/.config/starship.toml [kubernetes] -symbol = "⛵ " -style = "dimmed green" +format = "on [⛵ $context \\($namespace\\)](dimmed green) " disabled = false [kubernetes.context_aliases] "dev.local.cluster.k8s" = "dev" @@ -883,7 +1289,7 @@ disabled = false ### Опции -| Переменная | По умолчанию | Описание | +| Option | По умолчанию | Описание | | ---------- | ------------ | ------------------------------------------------------------------------ | | `disabled` | `false` | Отключает модуль `line_break`, отображая командную строку в одну строку. | @@ -910,15 +1316,26 @@ disabled = true ### Опции -| Переменная | По умолчанию | Описание | -| ----------------- | --------------------- | --------------------------------------------------------------------------- | -| `show_percentage` | `false` | Отображать использование памяти в процентах от доступной памяти. | -| `show_swap` | `true` | Отображать использование подкачки, если общая сумма подкачки не равна нулю. | -| `threshold` | `75` | Скрывать использование памяти, если она не превышает этот процент. | -| `symbol` | `"🐏 "` | Символ, используемый перед отображением использования памяти. | -| `separator` | `" | "` | Символ или текст, который отделит использование памяти и подкачки. | -| `style` | `"bold dimmed white"` | Стиль модуля. | -| `disabled` | `true` | Отключает модуль `memory_usage`. | +| Option | По умолчанию | Описание | +| ----------- | --------------------------------------------- | ------------------------------------------------------------------ | +| `threshold` | `75` | Скрывать использование памяти, если она не превышает этот процент. | +| `format` | `"via $symbol [${ram}( | ${swap})]($style) "` | The format for the module. | +| `symbol` | `"🐏"` | Символ, используемый перед отображением использования памяти. | +| `style` | `"bold dimmed white"` | Стиль модуля. | +| `disabled` | `true` | Отключает модуль `memory_usage`. | + +### Variables + +| Переменная | Пример | Описание | +| ------------- | ------------- | ------------------------------------------------------------------ | +| ram | `31GiB/65GiB` | The usage/total RAM of the current system memory. | +| ram_pct | `48%` | The percentage of the current system memory. | +| swap\** | `1GiB/4GiB` | The swap memory size of the current system swap memory file. | +| swap_pct\** | `77%` | The swap memory percentage of the current system swap memory file. | +| symbol | `🐏` | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string \*\*: The SWAP file information is only displayed if detected on the current system ### Пример @@ -941,13 +1358,24 @@ style = "bold dimmed green" ### Опции -| Переменная | По умолчанию | Описание | -| ------------------- | --------------- | ---------------------------------------------------------------------------------------- | -| `symbol` | `" "` | Символ, используемый перед закладкой hg или именем ветви репозитория в текущем каталоге. | -| `truncation_length` | `2^63 - 1` | Обрезает имя ветки hg до X графемов | -| `truncation_symbol` | `"…"` | Символ, используемый для обозначения усечения названия ветки. | -| `style` | `"bold purple"` | Стиль модуля. | -| `disabled` | `true` | Отключает модуль `hg_branch`. | +| Option | По умолчанию | Описание | +| ------------------- | -------------------------------- | ---------------------------------------------------------------------------------------- | +| `symbol` | `" "` | Символ, используемый перед закладкой hg или именем ветки репозитория в текущем каталоге. | +| `style` | `"bold purple"` | Стиль модуля. | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. | +| `truncation_length` | `2^63 - 1` | Обрезает имя ветки hg до X графемов | +| `truncation_symbol` | `"…"` | Символ, используемый для обозначения усечения названия ветки. | +| `disabled` | `true` | Отключает модуль `hg_branch`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | -------- | ------------------------------------ | +| branch | `master` | The active mercurial branch | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -955,7 +1383,7 @@ style = "bold dimmed green" # ~/.config/starship.toml [hg_branch] -symbol = "🌱 " +format = "on [🌱 $branch](bold purple)" truncation_length = 4 truncation_symbol = "" ``` @@ -963,18 +1391,30 @@ truncation_symbol = "" ## Nim The `nim` module shows the currently installed version of Nim. Модуль будет показан, если любое из следующих условий соблюдено: -- The current directory contains a `nim.cfg` file + +- Текущий каталог содержит файл `nim.cfg` - The current directory contains a file with the `.nim` extension - The current directory contains a file with the `.nims` extension - The current directory contains a file with the `.nimble` extension ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | -| `style` | `"bold yellow"` | Стиль модуля. | -| `disabled` | `false` | Disables the `nim` module. | +| Option | По умолчанию | Описание | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module | +| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | +| `style` | `"bold yellow"` | Стиль модуля. | +| `disabled` | `false` | Disables the `nim` module. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | -------- | ------------------------------------ | +| version | `v1.2.0` | The version of `nimc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -992,14 +1432,25 @@ symbol = "🎣 " ### Опции -| Переменная | По умолчанию | Описание | -| ------------ | ------------- | ------------------------------------------------- | -| `use_name` | `false` | Отображать имя nix-shell. | -| `impure_msg` | `"impure"` | Настройте сообщение "impure". | -| `pure_msg` | `"pure"` | Настройте сообщение "pure". | -| `symbol` | `"❄️ "` | The symbol used before displaying the shell name. | -| `style` | `"bold blue"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `nix_shell`. | +| Option | По умолчанию | Описание | +| ------------ | -------------------------------------------------- | ----------------------------------------------------- | +| `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. | +| `pure_msg` | `"pure"` | A format string shown when the shell is pure. | +| `disabled` | `false` | Отключает модуль `nix_shell`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | ------- | ------------------------------------ | +| state | `pure` | The state of the nix-shell | +| name | `lorri` | The name of the nix-shell | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -1008,10 +1459,9 @@ symbol = "🎣 " [nix_shell] disabled = true -use_name = true -impure_msg = "impure shell" -pure_msg = "pure shell" -symbol = "☃️ " +impure_msg = "[impure shell](bold red)" +pure_msg = "[pure shell](bold green)" +format = "via [☃️ $state( \\($name\\))](bold blue) " ``` ## NodeJS @@ -1021,15 +1471,27 @@ symbol = "☃️ " - Текущий каталог содержит файл `package.json` - The current directory contains a `.node-version` file - Текущий каталог содержит каталог `node_modules` -- Текущий каталог содержит файл с расширением `.js` +- The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension +- The current directory contains a file with the `.ts` extension ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | -------------- | ------------------------------------------------------ | -| `symbol` | `"⬢ "` | Символ, используемый перед отображением версии NodeJS. | -| `style` | `"bold green"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `nodejs`. | +| Option | По умолчанию | Описание | +| ---------- | ---------------------------------- | -------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⬢ "` | A format string representing the symbol of NodeJS. | +| `style` | `"bold green"` | Стиль модуля. | +| `disabled` | `false` | Отключает модуль `nodejs`. | + +###  Variables + +| Переменная | Пример | Описание | +| ---------- | ---------- | ------------------------------------ | +| version | `v13.12.0` | The version of `node` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -1037,7 +1499,7 @@ symbol = "☃️ " # ~/.config/starship.toml [nodejs] -symbol = "🤖 " +format = "via [🤖 $version](bold green) " ``` ## Версия пакета @@ -1056,12 +1518,23 @@ symbol = "🤖 " ### Опции -| Переменная | По умолчанию | Описание | -| ----------------- | ------------ | --------------------------------------------------------- | -| `symbol` | `"📦 "` | Символ, используемый перед отображением версии пакета. | -| `style` | `"bold 208"` | Стиль модуля. | -| `display_private` | `false` | Enable displaying version for packages marked as private. | -| `disabled` | `false` | Отключает модуль `package`. | +| Option | По умолчанию | Описание | +| ----------------- | ---------------------------------- | --------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"📦 "` | Символ, используемый перед отображением версии пакета. | +| `style` | `"bold 208"` | Стиль модуля. | +| `display_private` | `false` | Enable displaying version for packages marked as private. | +| `disabled` | `false` | Отключает модуль `package`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | -------- | ------------------------------------ | +| version | `v1.0.0` | The version of your package | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -1069,7 +1542,7 @@ symbol = "🤖 " # ~/.config/starship.toml [package] -symbol = "🎁 " +format = "via [🎁 $version](208 bold) " ``` ## OCaml @@ -1085,11 +1558,22 @@ The `ocaml` module shows the currently installed version of OCaml. Модуль ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | --------------- | ------------------------------------------------------- | -| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | -| `style` | `"bold yellow"` | Стиль модуля. | -| `disabled` | `false` | Disables the `ocaml` module. | +| Option | По умолчанию | Описание | +| ---------- | ---------------------------------- | ------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format string for the module. | +| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | +| `style` | `"bold yellow"` | Стиль модуля. | +| `disabled` | `false` | Disables the `ocaml` module. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | --------- | ------------------------------------ | +| version | `v4.10.0` | The version of `ocaml` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -1097,7 +1581,7 @@ The `ocaml` module shows the currently installed version of OCaml. Модуль # ~/.config/starship.toml [ocaml] -symbol = "🐪 " +format = "via [🐪 $version]($style) " ``` ## PHP @@ -1110,11 +1594,22 @@ symbol = "🐪 " ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | ------------ | --------------------------------------------------- | -| `symbol` | `"🐘 "` | Символ, используемый перед отображением версии PHP. | -| `style` | `"bold 147"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `php`. | +| Option | По умолчанию | Описание | +| ---------- | ---------------------------------- | --------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐘 "` | Символ, используемый перед отображением версии PHP. | +| `style` | `"147 bold"` | Стиль модуля. | +| `disabled` | `false` | Отключает модуль `php`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | -------- | ------------------------------------ | +| version | `v7.3.8` | The version of `php` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -1122,7 +1617,7 @@ symbol = "🐪 " # ~/.config/starship.toml [php] -symbol = "🔹 " +format = "via [🔹 $version](147 bold) " ``` ## Python @@ -1145,14 +1640,23 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name ### Опции -| Переменная | По умолчанию | Описание | -| -------------------- | --------------- | ------------------------------------------------------------------------------------- | -| `symbol` | `"🐍 "` | Символ перед отображением текущей версии Python. | -| `pyenv_version_name` | `false` | Использовать pyenv для получения версии Python | -| `pyenv_prefix` | `"pyenv "` | Префикс перед отображением версии pyenv (отображение по умолчанию `pyenv MY_VERSION`) | -| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | -| `style` | `"bold yellow"` | Стиль модуля. | -| `disabled` | `false` | Disables the `python` module. | +| Option | По умолчанию | Описание | +| -------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${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 | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `disabled` | `false` | Disables the `python` module. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | --------------- | ------------------------------------ | +| version | `"v3.8.1"` | The version of `python` | +| symbol | `"🐍 "` | Mirrors the value of option `symbol` | +| style | `"yellow bold"` | Mirrors the value of option `style` | +| virtualenv | `"venv"` | The current `virtualenv` name |
This module has some advanced configuration options. @@ -1193,11 +1697,22 @@ pyenv_prefix = "foo " ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | ------------ | ---------------------------------------------------- | -| `symbol` | `"💎 "` | Символ, используемый перед отображением версии Ruby. | -| `style` | `"bold red"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `ruby`. | +| Option | По умолчанию | Описание | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"💎 "` | A format string representing the symbol of Ruby. | +| `style` | `"bold red"` | Стиль модуля. | +| `disabled` | `false` | Отключает модуль `ruby`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | -------- | ------------------------------------ | +| version | `v2.5.1` | The version of `ruby` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -1217,11 +1732,22 @@ symbol = "🔺 " ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | ------------ | ---------------------------------------------------- | -| `symbol` | `"🦀 "` | Символ, используемый перед отображением версии Rust. | -| `style` | `"bold red"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `rust`. | +| Option | По умолчанию | Описание | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🦀 "` | A format string representing the symbol of Rust | +| `style` | `"bold red"` | Стиль модуля. | +| `disabled` | `false` | Отключает модуль `rust`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | ----------------- | ------------------------------------ | +| version | `v1.43.0-nightly` | The version of `rustc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -1229,7 +1755,7 @@ symbol = "🔺 " # ~/.config/starship.toml [rust] -symbol = "⚙️ " +format = "via [⚙️ $version](red bold)" ``` ## Singularity @@ -1238,14 +1764,22 @@ symbol = "⚙️ " ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | -------------------- | -------------------------------------------------- | -| `label` | `""` | Префикс перед отображением имени образа. | -| `prefix` | `"["` | Префикс для отображения сразу перед именем образа. | -| `suffix` | `"]"` | Суффикс, отображаемый сразу после имени образа. | -| `symbol` | `""` | Символ, используемый перед именем образа. | -| `style` | `"bold dimmed blue"` | Стиль модуля. | -| `disabled` | `false` | Disables the `singularity` module. | +| Option | По умолчанию | Описание | +| ---------- | ------------------------------------ | ------------------------------------------------ | +| `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. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | ------------ | ------------------------------------ | +| env | `centos.img` | The current singularity image | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -1253,32 +1787,54 @@ symbol = "⚙️ " # ~/.config/starship.toml [singularity] -symbol = "📦 " +format = "[📦 \\[$env\\]]($style) " ``` ## Terraform -Модуль `terraform` показывает выбранную рабочую область и версию terraform. По умолчанию, версия terraform не показана, так как это медленно на текущих версиях terraform, при использовании большого количества плагинов. Модуль будет показан, если любое из следующих условий соблюдено: +Модуль `terraform` показывает выбранную рабочую область и версию terraform. По умолчанию, версия terraform не показана, так как это медленно на текущих версиях terraform, при использовании большого количества плагинов. If you still want to enable it, [follow the example shown below](#with-version). Модуль будет показан, если любое из следующих условий соблюдено: - Текущий каталог содержит папку `.terraform` - Текущий каталог содержит файл с расширением `.tf` ### Опции -| Переменная | По умолчанию | Описание | -| -------------- | ------------ | --------------------------------------------------------------------------- | -| `symbol` | `"💠 "` | Символ, используемый перед отображением рабочего пространства terraform. | -| `show_version` | `false` | Показать версию terraform. Очень медленно на больших рабочих пространствах. | -| `style` | `"bold 105"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `terraform`. | +| Option | По умолчанию | Описание | +| ---------- | ------------------------------------ | ----------------------------------------------------- | +| `format` | `"via [$symbol$workspace]($style) "` | The format string for the module. | +| `symbol` | `"💠 "` | A format string shown before the terraform workspace. | +| `style` | `"bold 105"` | Стиль модуля. | +| `disabled` | `false` | Отключает модуль `terraform`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | ---------- | ------------------------------------ | +| version | `v0.12.24` | The version of `terraform` | +| workspace | `default` | The current terraform workspace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример +#### With Version + ```toml # ~/.config/starship.toml [terraform] -symbol = "🏎💨 " +format = "[🏎💨 $version$workspace]($style) " +``` + +#### Without version + +```toml +# ~/.config/starship.toml + +[terraform] +format = "[🏎💨 $workspace]($style) " ``` ## Время @@ -1293,16 +1849,26 @@ symbol = "🏎💨 " ### Опции -| Переменная | По умолчанию | Описание | -| ----------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `use_12hr` | `false` | Включить 12-часовое форматирование. | -| `format` | см. ниже | [Строка формата chrono](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html), используемая для форматирования времени. | -| `style` | `"bold yellow"` | Стиль модуля времени. | -| `utc_time_offset` | `"local"` | Устанавливает смещение UTC. Диапазон -24 < x < 24. Разрешает числам с плавающей точкой встраивать 30/45-минутное смещение временной зоны. | -| `disabled` | `true` | Отключает модуль `time`. | -| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | +| Option | По умолчанию | Описание | +| ----------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `format` | `"at [$time]($style) "` | The format string for the module. | +| `use_12hr` | `false` | Включить 12-часовое форматирование | +| `time_format` | см. ниже | [Строка формата chrono](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html), используемая для форматирования времени. | +| `style` | `"bold yellow"` | Стиль модуля времени | +| `utc_time_offset` | `"local"` | Устанавливает смещение UTC. Range from -24 < x < 24. Разрешает числам с плавающей точкой встраивать 30/45-минутное смещение временной зоны. | +| `disabled` | `true` | Отключает модуль `time`. | +| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | -Если `use_12hr` равно `true`, то `format` по умолчанию равно `"%r"`. Иначе по умолчанию используется `"%T"`. Установка `format` вручную переопределит параметр `use_12hr`. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Иначе по умолчанию используется `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. + +### Variables + +| Переменная | Пример | Описание | +| ---------- | ---------- | ----------------------------------- | +| время | `13:08:10` | The current time. | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -1311,7 +1877,8 @@ symbol = "🏎💨 " [time] disabled = false -format = "🕙[ %T ]" +format = "🕙[\\[ $time \\]]($style) " +time_format = "%T" utc_time_offset = "-5" time_range = "10:00:00-14:00:00" ``` @@ -1327,12 +1894,20 @@ time_range = "10:00:00-14:00:00" ### Опции -| Переменная | По умолчанию | Описание | -| ------------- | --------------- | ------------------------------------------------------- | -| `style_root` | `"bold red"` | Стиль, используемый для пользователя root. | -| `style_user` | `"bold yellow"` | Стиль, используемый для всех пользователей, кроме root. | -| `show_always` | `false` | Всегда показывать модуль `username`. | -| `disabled` | `false` | Отключает модуль `username`. | +| Option | По умолчанию | Описание | +| ------------- | ------------------------ | ------------------------------------------------------- | +| `style_root` | `"bold red"` | Стиль, используемый для пользователя root. | +| `style_user` | `"bold yellow"` | Стиль, используемый для всех пользователей, кроме root. | +| `format` | `"via [$user]($style) "` | The format for the module. | +| `show_always` | `false` | Всегда показывать модуль `username`. | +| `disabled` | `false` | Отключает модуль `username`. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | ------------ | ------------------------------------------------------------------------------------------- | +| `style` | `"red bold"` | Mirrors the value of option `style_root` when root is logged in and `style_user` otherwise. | +| `user` | `"matchai"` | The currently logged-in user ID. | ### Пример @@ -1340,10 +1915,13 @@ time_range = "10:00:00-14:00:00" # ~/.config/starship.toml [username] -disabled = true +style_user = "white bold" +style_root = "black bold" +format = "user: [$user]($style) " +disabled = false +show_always = true ``` - ## Zig The `zig` module shows the currently installed version of Zig. Модуль будет показан, если любое из следующих условий соблюдено: @@ -1352,11 +1930,22 @@ The `zig` module shows the currently installed version of Zig. Модуль бу ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | -| `style` | `"bold yellow"` | Стиль модуля. | -| `disabled` | `false` | Disables the `zig` module. | +| Option | По умолчанию | Описание | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | +| `style` | `"bold yellow"` | Стиль модуля. | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `zig` module. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | -------- | ------------------------------------ | +| version | `v0.6.0` | The version of `zig` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -1372,6 +1961,7 @@ symbol = "⚡️ " The `custom` modules show the output of some arbitrary commands. These modules will be shown if any of the following conditions are met: + - The current directory contains a file whose name is in `files` - The current directory contains a directory whose name is in `directories` - The current directory contains a file whose extension is in `extensions` @@ -1391,24 +1981,34 @@ The order in which custom modules are shown can be individually set by setting ` ### Опции -| Переменная | По умолчанию | Описание | -| ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. | -| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | -| `shell` | | [See below](#custom-command-shell) | -| `описание` | `""` | The description of the module that is shown when running `starship explain`. | -| `files` | `[]` | The files that will be searched in the working directory for a match. | -| `directories` | `[]` | The directories that will be searched in the working directory for a match. | -| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | -| `symbol` | `""` | The symbol used before displaying the command output. | -| `style` | `"bold green"` | Стиль модуля. | -| `prefix` | `""` | Prefix to display immediately before the command output. | -| `suffix` | `""` | Suffix to display immediately after the command output. | -| `disabled` | `false` | Disables this `custom` module. | +| Option | По умолчанию | Описание | +| ------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `command` | | The command whose output should be printed. | +| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | +| `shell` | | [See below](#custom-command-shell) | +| `описание` | `""` | The description of the module that is shown when running `starship explain`. | +| `files` | `[]` | The files that will be searched in the working directory for a match. | +| `directories` | `[]` | The directories that will be searched in the working directory for a match. | +| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | +| `symbol` | `""` | The symbol used before displaying the command output. | +| `style` | `"bold green"` | Стиль модуля. | +| `format` | `"[$symbol$output]($style) "` | The format for the module. | +| `disabled` | `false` | Disables this `custom` module. | + +### Variables + +| Переменная | Описание | +| ---------- | -------------------------------------- | +| output | The output of shell command in `shell` | +| symbol | Mirrors the value of option `symbol` | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string #### Custom command shell `shell` accepts a non-empty list of strings, where: + - The first string is the path to the shell to use to execute the command. - Other following arguments are passed to the shell. @@ -1459,11 +2059,22 @@ The `purescript` module shows the currently installed version of PureScript vers ### Опции -| Переменная | По умолчанию | Описание | -| ---------- | -------------- | ------------------------------------------------------------ | -| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | -| `style` | `"bold white"` | Стиль модуля. | -| `disabled` | `false` | Disables the `purescript` module. | +| Option | По умолчанию | Описание | +| ---------- | ---------------------------------- | ------------------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | +| `style` | `"bold white"` | Стиль модуля. | +| `disabled` | `false` | Disables the `purescript` module. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | -------- | ------------------------------------ | +| version | `0.13.5` | The version of `purescript` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### Пример @@ -1471,5 +2082,5 @@ The `purescript` module shows the currently installed version of PureScript vers # ~/.config/starship.toml [purescript] -symbol = "<=> " +format = "via [$symbol$version](bold white)" ``` diff --git a/docs/ru-RU/faq/README.md b/docs/ru-RU/faq/README.md index 812a361c..f8322de8 100644 --- a/docs/ru-RU/faq/README.md +++ b/docs/ru-RU/faq/README.md @@ -5,9 +5,9 @@ - **Эмулятор терминала**: [iTerm2](https://iterm2.com/) - **Тема**: Минимальная - **Цветовая схема**: [Snazzy](https://github.com/sindresorhus/iterm2-snazzy) - - **Шрифт**: [Fira Code](https://github.com/tonsky/FiraCode) + - **Font**: [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads) - **Оболочка**: [Fish Shell](https://fishshell.com/) - - **Конфигурация**: [matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/master/.config/fish/config.fish) + - **Конфигурация**: [matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish) - **Подсказка**: [Starship](https://starship.rs/) ## `prompt_order` и `.disabled` - это одно и то же? @@ -46,7 +46,7 @@ starship prompt --help ## Как запускать Starship на Linux-дистрибутивах с более ранними версиями glibc? -Если вы получаете ошибку типа "*version 'GLIBC_2.18' not found (required by starship)*" при использовании заранее собранного бинарного файла (например, на CentOS 6 или 7), вы можете использовать бинарный файл, скомпилированый с `musl` вместо `glibc`: +If you get an error like "_version 'GLIBC_2.18' not found (required by starship)_" when using the prebuilt binary (for example, on CentOS 6 or 7), you can use a binary compiled with `musl` instead of `glibc`: ```sh curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux-musl @@ -56,13 +56,13 @@ curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux- 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: - - 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 [powerline-patched font](https://github.com/powerline/fonts). +- 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/). To test your system, run the following commands in a terminal: -``` +```sh echo -e "\xf0\x9f\x90\x8d" echo -e "\xee\x82\xa0" ``` @@ -70,3 +70,19 @@ 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). 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) + +## How do I uninstall Starship? + +Starship is just as easy to uninstall as it is to install in the first place. + +1. Remove any lines in your shell config (e.g. `~/.bashrc`) used to initialize Starship. +1. Delete the Starship binary. + +If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. + +If Starship was installed using the `curl | bash` script, the following command will delete the binary: + +```sh +# Locate and delete the starship binary +rm "$(which starship)" +``` diff --git a/docs/ru-RU/guide/README.md b/docs/ru-RU/guide/README.md index d223bce6..6a01bee5 100644 --- a/docs/ru-RU/guide/README.md +++ b/docs/ru-RU/guide/README.md @@ -121,7 +121,7 @@ ### Требования -- Установленный и включённый [шрифт Powerline](https://github.com/powerline/fonts) (например, [Fira Code](https://github.com/tonsky/FiraCode)). +- A [Nerd Font](https://www.nerdfonts.com/) installed and enabled in your terminal (for example, try the [Fira Code Nerd Font](https://www.nerdfonts.com/font-downloads)). ### Начало работы @@ -224,7 +224,7 @@ ### Соавторы кода -Этот проект существует благодаря всем тем, кто внес свой вклад. [[Внести вклад](CONTRIBUTING.md)]. +Этот проект существует благодаря всем тем, кто внес свой вклад. [[Внести вклад](https://github.com/starship/starship/blob/master/CONTRIBUTING.md)]. ### Финансовые спонсоры diff --git a/docs/zh-CN/advanced-config/README.md b/docs/zh-CN/advanced-config/README.md index 27bc5982..84dffb16 100644 --- a/docs/zh-CN/advanced-config/README.md +++ b/docs/zh-CN/advanced-config/README.md @@ -57,7 +57,16 @@ starship_precmd_user_func="set_win_title" precmd_functions+=(set_win_title) ``` -如果您对产生的效果感到满意,请将以上代码添加到您的 shell 配置文件(`~/.bashrc` 或 `~/zsrhc`)中以使其永久化。 +If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. + +For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: + +```bash +function set_win_title(){ + echo -ne "\033]0; $(basename $PWD) \007" +} +starship_precmd_user_func="set_win_title" +``` ## 样式设定 diff --git a/docs/zh-CN/config/README.md b/docs/zh-CN/config/README.md index ffe44f1e..b5c4c2b1 100644 --- a/docs/zh-CN/config/README.md +++ b/docs/zh-CN/config/README.md @@ -15,24 +15,26 @@ mkdir -p ~/.config && touch ~/.config/starship.toml Starship 的所有配置都在此 [TOML](https://github.com/toml-lang/toml) 配置文件中完成: ```toml -# 不用在提示符的开始换行 +# Don't print a new line at the start of the prompt add_newline = false -# 将提示符标志由“❯”换成“➜” -[character] # 正在配置的组件名称是“character” -symbol = "➜" # “symbol”字段被设置为 "➜" +# Replace the "❯" symbol in the prompt with "➜" +[character] # The name of the module we are configuring is "character" +success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green" -# 禁用 package 组件,它不会在提示符中被显示出来 +# Disable the package module, hiding it from the prompt completely [package] disabled = true ``` 你可以设置环境变量 `STARSHIP_CONFIG` 来修改 starship 查找配置文件 `starship.toml` 时查找的位置: + ```sh export STARSHIP_CONFIG=~/.starship ``` Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: + ```ps1 $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` @@ -41,16 +43,39 @@ $ENV:STARSHIP_CONFIG = "$HOME\.starship" **组件(Module)**:提示符的组成部分,通过来自系统的上下文信息向用户显示各种信息。 比如“nodejs”组件会在当前目录是一个 NodeJS 项目时显示您当前安装的 NodeJS 版本。 -**字段(Segment)**:组成组件的下级单位。 例如,“nodejs”组件中的“symbol”字段包含了在版本号之前显示的字符(默认为 ⬢)。 +**Variable**: Smaller sub-components that contains information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of NodeJS. -以下定义了整个 node 组件的显示格式。 在下面这个例子里,“symbol”和“version”是其中的字段。 每一个组件都有一个以终端默认颜色显示的前缀(prefix)和后缀(suffix)。 +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. -``` -[prefix] [symbol] [version] [suffix] - "via " "⬢" "v10.4.1" "" -``` +### Format Strings -### 样式字符串 +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. + +#### 字段 + +A variable contains a `$` symbol followed by the name of the variable. The name of a variable only contains letters, numbers and `_`. + +For example: + +- `$version` is a format string with a variable named `version`. +- `$git_branch$git_commit` is a format string with two variables named `git_branch` and `git_commit`. +- `$git_branch $git_commit` has the two variables separated with a space. + +#### Text Group + +A text group is made up of two different parts. + +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. + +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used style the first part. + +For example: + +- `[on](red bold)` will print a string `on` with bold text colored red. +- `[⬢ $version](bold green)` will print a symbol `⬢` followed by the content of variable `version`, with bold text colored green. +- `[a [b](red) c](green)` will print `a b c` with `b` red, and `a` and `c` green. + +#### 样式设定 Starship 中的大多数组件允许您为其设置显示样式。 显示样式可以通过一个字符串字段(一般是 `style`)来设置。 以下的例子给出了一些样式字符串并描述了它们的效果。 样式字符串的完整语法请查阅 [高级配置指南](/advanced-config/)。 @@ -63,80 +88,128 @@ Starship 中的大多数组件允许您为其设置显示样式。 显示样式 请注意,最终的显示样式将由您的终端模拟器控制。 例如,有的终端模拟器对于“bold”属性的文本是加亮颜色而不是加粗文字,有的颜色主题对“普通”和“明亮”两种属性的颜色使用相同的颜色值。 此外,要获得意大利体文本(一般设计为斜体),您的终端必须支持意大利体显示。 +#### Conditional Format Strings + +A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. + +For example: + +- `(@$region)` will show nothing if the variable `region` is `None`, otherwise `@` followed by the value of region. +- `(some text)` will always show nothing since there are no variables wrapped in the braces. +- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. + +#### Escapable characters + +The following symbols have special usage in a format string. If you want to print the following symbols, you have to escape them with a backslash (`\`). + +- $ +- \\ +- [ +- ] +- ( +- ) + +Note that `toml` has [its own escape syntax](https://github.com/toml-lang/toml#user-content-string). It is recommended to use a literal string (`''`) in your config. If you want to use a basic string (`""`), pay attention to escape the backslash `\`. + +For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: + +```toml +# with basic string +format = "\n\\$" + +# with multiline basic string +format = """ + +\\$""" + +# with literal string +format = ''' + +\$''' +``` + ## 提示符 以下是关于提示符的配置项。 ### 配置项 -| 字段 | 默认值 | 描述 | -| -------------- | ---------------------------- | -------------------------- | -| `add_newline` | `true` | 在提示符与提示信息间换行。 | -| `prompt_order` | [见下文](#default-prompt-order) | 配置各组件在提示信息中出现的顺序。 | -| `scan_timeout` | `30` | Starship 扫描文件的超时时间(单位:毫秒)。 | +| Option | 默认值 | 描述 | +| -------------- | ----------------------------- | ----------------------------------- | +| `format` | [见下文](#default-prompt-format) | Configure the format of the prompt. | +| `scan_timeout` | `30` | Starship 扫描文件的超时时间(单位:毫秒)。 | ### 示例 ```toml # ~/.config/starship.toml -# 不用在提示符前换行 -add_newline = false -# 使用自定义的组件顺序替换默认组件顺序 -prompt_order=["rust","line_break","package","line_break","character"] -# 当 starship 扫描当前目录下的文件和文件夹时,最多使用 10 毫秒 +# Disable the newline at the start of the prompt +format = "$all" + +# Use custom format +format = """ +[┌───────────────────>](bold green) +[│](bold green)$directory$rust$package +[└─>](bold green) """ + +# Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 ``` -### 默认的组件顺序 +### Default Prompt Format -如果 `prompt_order` 是空值或未设置,提示信息中组件的显示顺序会设置为 `prompt_order` 的默认值。 默认设置如下: +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. 默认设置如下: ```toml -prompt_order = [ - "username", - "hostname", - "kubernetes", - "directory", - "git_branch", - "git_commit", - "git_state", - "git_status", - "hg_branch", - "docker_context", - "package", - "dotnet", - "elixir", - "elm", - "erlang", - "golang", - "haskell", - "java", - "julia", - "nim", - "nodejs", - "ocaml", - "php", - "purescript", - "python", - "ruby", - "rust", - "terraform", - "zig", - "nix_shell", - "conda", - "memory_usage", - "aws", - "env_var", - "crystal", - "cmd_duration", - "custom", - "line_break", - "jobs", - "battery", - "time", - "character", -] +format = "\n$all" + +# Which is equivalent to +format = """ + +$username\ +$hostname\ +$kubernetes\ +$directory\ +$git_branch\ +$git_commit\ +$git_state\ +$git_status\ +$hg_branch\ +$docker_context\ +$package\ +$cmake\ +$dotnet\ +$elixir\ +$elm\ +$erlang\ +$golang\ +$helm\ +$java\ +$julia\ +$nim\ +$nodejs\ +$ocaml\ +$php\ +$purescript\ +$python\ +$ruby\ +$rust\ +$terraform\ +$zig\ +$nix_shell\ +$conda\ +$memory_usage\ +$aws\ +$env_var\ +$crystal\ +$cmd_duration\ +$custom\ +$line_break\ +$jobs\ +$battery\ +$time\ +$character""" ``` ## AWS @@ -147,41 +220,80 @@ When using [aws-vault](https://github.com/99designs/aws-vault) the profile is re ### 配置项 -| 字段 | 默认值 | 描述 | -| ----------------- | --------------- | --------------------------------------------- | -| `symbol` | `"☁️ "` | 这个字段的内容会显示在当前 AWS 配置信息之前。 | -| `displayed_items` | `all` | 选择要显示的字段。 可能的值有: [`all`, `profile`, `region`] | -| `region_aliases` | | 地区缩写列表,用来显示在 AWS 主机名之后。 | -| `style` | `"bold yellow"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `AWS` 组件。 | +| Option | 默认值 | 描述 | +| ---------------- | ---------------------------------------------------- | -------------------------- | +| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | The format for the module. | +| `symbol` | `"☁️ "` | 这个字段的内容会显示在当前 AWS 配置信息之前。 | +| `region_aliases` | | 地区缩写列表,用来显示在 AWS 主机名之后。 | +| `style` | `"bold yellow"` | 此组件的样式。 | +| `disabled` | `false` | 禁用 `AWS` 组件。 | -### 示例 +### Variables + +| 字段 | 示例 | 描述 | +| --------- | ---------------- | ------------------------------------ | +| region | `ap-northeast-1` | The current AWS region | +| profile | `astronauts` | The current AWS profile | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Examples + +#### Display everything ```toml # ~/.config/starship.toml [aws] +format = "on [$symbol$profile(\\($region\\))]($style) " style = "bold blue" symbol = "🅰 " -displayed_items = "region" [aws.region_aliases] ap-southeast-2 = "au" us-east-1 = "va" ``` +#### Display region + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$region]($style) " +style = "bold blue" +symbol = "🅰 " +[aws.region_aliases] +ap-southeast-2 = "au" +us-east-1 = "va" +``` + +#### Display profile + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$profile]($style) " +style = "bold blue" +symbol = "🅰 " +``` + ## Battery `battery` 组件显示电池充电情况和当前充电状态。 这个组件只会在当前电量低于 10% 时显示。 ### 配置项 -| 字段 | 默认值 | 描述 | -| -------------------- | ----------------------- | ---------------- | -| `full_symbol` | `"•"` | 显示于电池充满时。 | -| `charging_symbol` | `"⇡"` | 显示于正在充电时。 | -| `discharging_symbol` | `"⇣"` | 显示于电池放电时。 | -| `display` | [见下文](#battery-display) | 电量显示阈值和样式。 | -| `disabled` | `false` | 禁用 `battery` 组件。 | +| Option | 默认值 | 描述 | +| -------------------- | --------------------------------- | -------------------------- | +| `full_symbol` | `"•"` | 显示于电池充满时。 | +| `charging_symbol` | `"⇡"` | 显示于正在充电时。 | +| `discharging_symbol` | `"⇣"` | 显示于电池放电时。 | +| `format` | `"[$symbol$percentage]($style) "` | The format for the module. | +| `display` | [见下文](#battery-display) | 电量显示阈值和样式。 | +| `disabled` | `false` | 禁用 `battery` 组件。 |
也有一些给不常见的电源状态设立的字段。 @@ -244,31 +356,85 @@ style = "bold yellow" `character` 组件用于在您输入终端的文本旁显示一个字符(通常是一个箭头)。 -这个字符可以告诉您最后一个命令是否执行成功。 它可以用两种方式完成这一功能:改变字符颜色(红色/绿色)或者改变其形状(❯/✖)。 后者仅在 `use_symbol_for_status` 设置为 `true` 时才能实现。 +这个字符可以告诉您最后一个命令是否执行成功。 It can do this in two ways: + +- changing color (`red`/`green`) +- changing shape (`❯`/`✖`) + +By default it only changes color. If you also want to change it's shape take a look at [this example](#with-custom-error-shape). ### 配置项 -| 字段 | 默认值 | 描述 | -| ----------------------- | -------------- | --------------------------------------------- | -| `symbol` | `"❯"` | 提示符中在输入文本之前显示的符号。 | -| `error_symbol` | `"✖"` | 如果上一条命令失败,提示符中在输入文本之前显示的符号。 | -| `use_symbol_for_status` | `false` | 指示是否改变显示符号来指出错误状态。 | -| `vicmd_symbol` | `"❮"` | 如果 shell 处于 vim 的 normal 模式,提示符中在输入文本之前显示的符号。 | -| `style_success` | `"bold green"` | 上次命令成功时使用的样式。 | -| `style_failure` | `"bold red"` | 上次命令失败时使用的样式。 | -| `disabled` | `false` | 禁用 `character` 组件。 | +| Option | 默认值 | 描述 | +| ---------------- | ------------------- | -------------------------------------------------------------------------------- | +| `format` | `"$symbol "` | The format string used before the text input. | +| `success_symbol` | `"[❯](bold green)"` | The format string used before the text input if the previous command succeeded. | +| `error_symbol` | `"[❯](bold red)"` | The format string used before the text input if the previous command failed. | +| `vicmd_symbol` | `"[❮](bold green)"` | The format string used before the text input if the shell is in vim normal mode. | +| `disabled` | `false` | 禁用 `character` 组件。 | -### 示例 +### Variables + +| 字段 | 示例 | 描述 | +| ------ | -- | --------------------------------------------------------------------- | +| symbol | | A mirror of either `success_symbol`, `error_symbol` or `vicmd_symbol` | + +### Examples + +#### With custom error shape ```toml # ~/.config/starship.toml [character] -symbol = "➜" -error_symbol = "✗" -use_symbol_for_status = true +success_symbol = "[➜](bold green) " +error_symbol = "[✗](bold red) " ``` +#### Without custom error shape + +```toml +# ~/.config/starship.toml + +[character] +success_symbol = "[➜](bold green) " +error_symbol = "[➜](bold red) " +``` + +#### With custom vim shape + +```toml +# ~/.config/starship.toml + +[character] +vicmd_symbol = "[V](bold green) " +``` + +## CMake + +The `cmake` module shows the currently installed version of CMake if: + +- The current directory contains a `CMakeLists.txt` file + +### 配置项 + +| Option | 默认值 | 描述 | +| ---------- | ---------------------------------- | -------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🛆 "` | The symbol used before the version of cmake. | +| `style` | `"bold blue"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `cmake` module. | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | --------- | ------------------------------------ | +| version | `v3.17.3` | The version of cmake | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + ## Command Duration `cmd_duration` 组件显示上一个命令执行的时间。 此组件只在命令执行时间长于两秒时显示,或者当其 `min_time` 字段被设置时,按此值为执行时间的显示下限。 @@ -283,13 +449,22 @@ use_symbol_for_status = true ### 配置项 -| 字段 | 默认值 | 描述 | -| ------------------- | --------------- | ---------------------- | -| `min_time` | `2_000` | 显示此组件所需的最短执行时长(单位:毫秒)。 | -| `show_milliseconds` | `false` | 除了秒数外在执行时长中额外显示毫秒。 | -| `prefix` | `took` | 直接在执行时长前显示的前缀。 | -| `style` | `"bold yellow"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `cmd_duration` 组件。 | +| Option | 默认值 | 描述 | +| ------------------- | ----------------------------- | -------------------------- | +| `min_time` | `2_000` | 显示此组件所需的最短执行时长(单位:毫秒)。 | +| `show_milliseconds` | `false` | 除了秒数外在执行时长中额外显示毫秒。 | +| `format` | `"took [$duration]($style) "` | The format for the module. | +| `style` | `"bold yellow"` | 此组件的样式。 | +| `disabled` | `false` | 禁用 `cmd_duration` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | -------- | --------------------------------------- | +| duration | `16m40s` | The time it took to execute the command | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -298,7 +473,7 @@ use_symbol_for_status = true [cmd_duration] min_time = 500 -prefix = "underwent " +format = "underwent [$duration](bold yellow)" ``` ## Conda @@ -313,12 +488,23 @@ prefix = "underwent " ### 配置项 -| 字段 | 默认值 | 描述 | -| ------------------- | -------------- | ---------------------------------------------------------------------------------------------------------------- | -| `truncation_length` | `1` | 如果这个 conda 环境是通过 `conda create -p [path]` 创建的,环境路径的目录深度应该被截断到此数量。 `0` 表示不用截断。 另请参阅 [`directory`](#directory) 组件。 | -| `symbol` | `"C "` | 在环境名之前显示的符号。 | -| `style` | `"bold green"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `conda` 组件。 | +| Option | 默认值 | 描述 | +| ------------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `truncation_length` | `1` | 如果这个 conda 环境是通过 `conda create -p [path]` 创建的,环境路径的目录深度应该被截断到此数量。 `0` 表示不用截断。 另请参阅 [`directory`](#directory) 组件。 | +| `symbol` | `"🅒 "` | 在环境名之前显示的符号。 | +| `style` | `"bold green"` | 此组件的样式。 | +| `format` | `"[$symbol$environment]($style) "` | The format for the module. | +| `disabled` | `false` | 禁用 `conda` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| ----------- | ------------ | ------------------------------------ | +| environment | `astronauts` | The current conda environment | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -326,7 +512,7 @@ prefix = "underwent " # ~/.config/starship.toml [conda] -style = "dimmed green" +format = "[$symbol$environment](dimmed green) " ``` ## Crystal @@ -338,11 +524,22 @@ The `crystal` module shows the currently installed version of Crystal. 此组件 ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | ------------ | --------------------------------------------------------- | -| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. | -| `style` | `"bold red"` | 此组件的样式。 | -| `disabled` | `false` | Disables the `crystal` module. | +| Option | 默认值 | 描述 | +| ---------- | ---------------------------------- | --------------------------------------------------------- | +| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. | +| `style` | `"bold red"` | 此组件的样式。 | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `crystal` module. | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | --------- | ------------------------------------ | +| version | `v0.32.1` | The version of `crystal` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -350,8 +547,7 @@ The `crystal` module shows the currently installed version of Crystal. 此组件 # ~/.config/starship.toml [crystal] -symbol = "✨ " -style = "bold blue" +format = "via [✨ $version](bold blue) " ``` ## Directory @@ -364,18 +560,20 @@ style = "bold blue" ### 配置项 -| 字段 | 默认值 | 描述 | -| ------------------- | ------------- | ------------------------ | -| `truncation_length` | `3` | 当前目录路径被截断后最多保留的父目录数量。 | -| `truncate_to_repo` | `true` | 是否只截断到您当前处于的 git 仓库根目录下。 | -| `prefix` | `"in "` | 直接在显示路径前显示的前缀。 | -| `style` | `"bold cyan"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `directory` 组件。 | +| 字段 | 默认值 | 描述 | +| ------------------------ | ----------------------------------------------- | ----------------------------------------------------- | +| `truncation_length` | `3` | 当前目录路径被截断后最多保留的父目录数量。 | +| `truncate_to_repo` | `true` | 是否只截断到您当前处于的 git 仓库根目录下。 | +| `format` | `"[$path]($style)[$lock_symbol]($lock_style) "` | The format for the module. | +| `style` | `"bold cyan"` | 此组件的样式。 | +| `disabled` | `false` | 禁用 `directory` 组件。 | +| `read_only_symbol` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_symbol_style` | `"red"` | The style for the read only symbol. |
此组件有几个高级配置选项来控制当前目录路径的显示方式。 -| 字段 | 默认值 | 描述 | +| Advanced Option | 默认值 | 描述 | | --------------------------- | ------ | ------------------------------------------------ | | `substitutions` | | A table of substitutions to be made to the path. | | `fish_style_pwd_dir_length` | `0` | 使用 fish shell 当前目录路径逻辑时每个省略目录名使用的字符数。 | @@ -393,6 +591,15 @@ style = "bold blue"
+### Variables + +| 字段 | 示例 | 描述 | +| --------- | --------------------- | ----------------------------------- | +| path | `"D:/Projects"` | The current directory path | +| style\* | `"black bold dimmed"` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + ### 示例 ```toml @@ -408,12 +615,23 @@ The `docker_context` module shows the currently active [Docker context](https:// ### 配置项 -| 字段 | 默认值 | 描述 | -| ----------------- | ------------- | --------------------------------------------------------------------------------------- | -| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context . | -| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. | -| `style` | `"bold blue"` | 此组件的样式。 | -| `disabled` | `true` | Disables the `docker_context` module. | +| Option | 默认值 | 描述 | +| ----------------- | ---------------------------------- | --------------------------------------------------------------------------------------- | +| `format` | `"via [$symbol$context]($style) "` | The format for the module. | +| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context. | +| `style` | `"blue bold"` | 此组件的样式。 | +| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. | +| `disabled` | `true` | Disables the `docker_context` module. | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | -------------- | ------------------------------------ | +| context | `test_context` | The current docker context | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -421,25 +639,51 @@ The `docker_context` module shows the currently active [Docker context](https:// # ~/.config/starship.toml [docker_context] -symbol = "🐋 " +format = "via [🐋 $context](blue bold)" ``` ## Dotnet `dotnet` 模块显示与当前目录下使用的 .NET Core SDK 相关联的版本。 如果当前目录已被绑定了一个版本的 SDK,则显示被帮定的版本。 否则此组件将显示最新安装的 SDK 版本。 -此组件只会在以下文件之一出现在当前目录中时显示:`global.json`,`project.json`,`*.sln`,`*.csproj`,`*.fsproj`,`*.xproj`。 为了正确使用此组件,您还需要安装 .NET Core 命令行工具。 +This module will only be shown in your prompt when one or more of the following files are present in the current directory: + +- `global.json` +- `project.json` +- `Directory.Build.props` +- `Directory.Build.targets` +- `Packages.props` +- `*.sln` +- `*.csproj` +- `*.fsproj` +- `*.xproj` + +You'll also need the .NET Core SDK installed in order to use it correctly. 在内部,此组件使用自己的版本检测机制。 一般来说此组件是直接执行 `dotnet --version` 的两倍快,但当你的 .NET 项目使用了不常见的目录布局时此组件可能显示一个错误的版本。 如果相比于速度您更需要正确的版本号,您可以在组件设置中设置 `heuristic = false` 来禁用该机制。 +The module will also show the Target Framework Moniker () when there is a csproj file in the current directory. + ### 配置项 -| 字段 | 默认值 | 描述 | -| ----------- | ------------- | ------------------------------ | -| `symbol` | `"•NET "` | 这个字段的内容会显示在当前 .NET 版本之前。 | -| `heuristic` | `true` | 使用更快的版本探测机制以保证 starship 的运行速度。 | -| `style` | `"bold blue"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `dotnet` 组件。 | +| Option | 默认值 | 描述 | +| ----------- | ---------------------------------------- | ------------------------------ | +| `format` | `"v[$symbol$version( 🎯 $tfm)]($style) "` | The format for the module. | +| `symbol` | `"•NET "` | 这个字段的内容会显示在当前 .NET 版本之前。 | +| `heuristic` | `true` | 使用更快的版本探测机制以保证 starship 的运行速度。 | +| `style` | `"bold blue"` | 此组件的样式。 | +| `disabled` | `false` | 禁用 `dotnet` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | ---------------- | ------------------------------------------------------------------ | +| version | `v3.1.201` | The version of `dotnet` sdk | +| tfm | `netstandard2.0` | The Target Framework Moniker that the current project is targeting | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -460,11 +704,23 @@ 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"` | 此组件的样式。 | -| `disabled` | `false` | Disables the `elixir` module. | +| 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. | +| `disabled` | `false` | Disables the `elixir` module. | + +### Variables + +| 字段 | 示例 | 描述 | +| ----------- | ------- | ------------------------------------ | +| version | `v1.10` | The version of `elixir` | +| otp_version | | The otp version of `elixir` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -487,12 +743,22 @@ The `elm` module shows the currently installed version of Elm. 此组件将在 ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | ------------- | ----------------------------------------------------- | -| `symbol` | `"🌳 "` | The symbol used before displaying the version of Elm. | -| `style` | `"bold cyan"` | 此组件的样式。 | -| `disabled` | `false` | Disables the `elm` module. | +| Option | 默认值 | 描述 | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🌳 "` | A format string representing the symbol of Elm. | +| `style` | `"cyan bold"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `elm` module. | +### Variables + +| 字段 | 示例 | 描述 | +| --------- | --------- | ------------------------------------ | +| version | `v0.19.1` | The version of `elm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -500,7 +766,7 @@ The `elm` module shows the currently installed version of Elm. 此组件将在 # ~/.config/starship.toml [elm] -symbol = " " +format = "via [ $version](cyan bold) " ``` ## Environment Variable @@ -512,15 +778,23 @@ symbol = " " ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | --------------------- | ------------------- | -| `symbol` | | 这个字段的内容会显示在环境变量值之前。 | -| `variable` | | 要显示的环境变量。 | -| `default` | | 所选变量未定义时显示的默认值。 | -| `prefix` | `""` | 直接在显示环境变量值前显示的前缀。 | -| `suffix` | `""` | 直接在显示环境变量值后显示的后缀。 | -| `style` | `"dimmed bold black"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `env_var` 组件。 | +| Option | 默认值 | 描述 | +| ---------- | ------------------------------ | -------------------------- | +| `symbol` | | 这个字段的内容会显示在环境变量值之前。 | +| `variable` | | 要显示的环境变量。 | +| `default` | | 所选变量未定义时显示的默认值。 | +| `format` | `"with [$env_value]($style) "` | The format for the module. | +| `disabled` | `false` | 禁用 `env_var` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | ------------------------------------------- | ------------------------------------------ | +| env_value | `Windows NT` (if *variable* would be `$OS`) | The environment value of option `variable` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | `black bold dimmed` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -534,18 +808,29 @@ default = "unknown shell" ## Erlang -The `erlang` module shows the currently installed version of Erlang/OTP. 此组件只有满足以下条件之一时才会被显示: +The `erlang` module shows the currently installed version of Erlang/OTP. 此组件将在符合以下任意条件之一时显示: - 当前目录包含一个 `rebar.config` 文件. - 当前目录包含一个 `erlang.mk` 文件. ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | ---------- | -------------------------------------------------------- | -| `symbol` | `"🖧 "` | The symbol used before displaying the version of Erlang. | -| `style` | `bold red` | The style for this module. | -| `disabled` | `false` | Disables the `erlang` module. | +| Option | 默认值 | 描述 | +| ---------- | ---------------------------------- | -------------------------------------------------------- | +| `symbol` | `"🖧 "` | The symbol used before displaying the version of erlang. | +| `style` | `"bold red"` | 此组件的样式。 | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `erlang` module. | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | --------- | ------------------------------------ | +| version | `v22.1.3` | The version of `erlang` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -553,7 +838,7 @@ The `erlang` module shows the currently installed version of Erlang/OTP. 此组 # ~/.config/starship.toml [erlang] -symbol = "e " +format = "via [e $version](bold red) " ``` ## Git Branch @@ -562,13 +847,24 @@ symbol = "e " ### 配置项 -| 字段 | 默认值 | 描述 | -| ------------------- | --------------- | ------------------------------------- | -| `symbol` | `" "` | 该字段的内容显示于当前仓库活动分支名之前。 | -| `truncation_length` | `2^63 - 1` | 将显示的分支名截断到该数量的字素(graphemes) | -| `truncation_symbol` | `"…"` | 此字段的内容用来表示分支名称被截断。 您可以使用 "" 以不显示任何符号。 | -| `style` | `"bold purple"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `git_branch` 组件。 | +| Option | 默认值 | 描述 | +| ------------------- | -------------------------------- | -------------------------------------------------------------------------------- | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. Use `"$branch"` to refer to the current branch name. | +| `symbol` | `" "` | A format string representing the symbol of git branch. | +| `style` | `"bold purple"` | 此组件的样式。 | +| `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes. | +| `truncation_symbol` | `"…"` | 此字段的内容用来表示分支名称被截断。 You can use `""` for no symbol. | +| `disabled` | `false` | 禁用 `git_branch` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| branch | `master` | The current branch name, falls back to `HEAD` if there's no current branch (e.g. git detached HEAD). | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -587,14 +883,22 @@ truncation_symbol = "" ### 配置项 -| 字段 | 默认值 | 描述 | -| -------------------- | -------------- | ----------------------------------------------------- | -| `commit_hash_length` | `7` | 显示的 git 提交哈希值的长度。 | -| `prefix` | `"("` | 直接在 git 提交哈希值前显示的前缀。 | -| `suffix` | `")"` | 直接在 git 提交哈希值后显示的后缀。 | -| `style` | `"bold green"` | 此组件的样式。 | -| `only_detached` | `true` | Only show git commit hash when in detached HEAD state | -| `disabled` | `false` | 禁用 `git_commit` 组件。 | +| Option | 默认值 | 描述 | +| -------------------- | ------------------------------ | ----------------------------------------------------- | +| `commit_hash_length` | `7` | 显示的 git 提交哈希值的长度。 | +| `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` | 禁用 `git_commit` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | --------- | ----------------------------------- | +| hash | `b703eb3` | The current git commit hash | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -611,18 +915,29 @@ commit_hash_length = 4 ### 配置项 -| 字段 | 默认值 | 描述 | -| ------------------ | ------------------ | ----------------------------------------------------- | -| `rebase` | `"REBASING"` | `rebase` 时显示的文本。 | -| `merge` | `"MERGING"` | `merge` 时显示的文本。 | -| `revert` | `"REVERTING"` | `revert` 时显示的文本。 | -| `cherry_pick` | `"CHERRY-PICKING"` | `cherry-pick` 时显示的文本。 | -| `bisect` | `"BISECTING"` | `bisect` 时显示的文本。 | -| `am` | `"AM"` | 正在执行 `apply-mailbox`(`git am`)时显示的文本。 | -| `am_or_rebase` | `"AM/REBASE"` | 当无法分辨正在执行的是 `apply-mailbox` 还是 `rebase` 时显示的文本。 | -| `progress_divider` | `"/"` | 将当前进度与总进度分开的符号或文本。 (例如,设置为 `" of "` 时效果是 `"3 of 10"`) | -| `style` | `"bold yellow"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `git_state` 模块 | +| 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. | +| `cherry_pick` | `"CHERRY-PICKING"` | A format string displayed when a `cherry-pick` is in progress. | +| `bisect` | `"BISECTING"` | A format string displayed when a `bisect` is in progress. | +| `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. | +| `disabled` | `false` | 禁用 `git_state` 模块 | + +### Variables + +| 字段 | 示例 | 描述 | +| ---------------- | ---------- | ----------------------------------- | +| state | `REBASING` | The current state of the repo | +| progress_current | `1` | The current operation progress | +| progress_total | `2` | The total operation progress | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -630,8 +945,8 @@ commit_hash_length = 4 # ~/.config/starship.toml [git_state] -progress_divider = " of " -cherry_pick = "🍒 PICKING" +format = "[\\($state( $progress_current of $progress_total)\\)]($style) " +cherry_pick = "[🍒 PICKING](bold red)" ``` ## Git Status @@ -640,37 +955,54 @@ cherry_pick = "🍒 PICKING" ### 配置项 -| 字段 | 默认值 | 描述 | -| ------------------ | ------------------------- | ---------------------------- | -| `conflicted` | `"="` | 这个分支有合并冲突。 | -| `conflicted_count` | [见下文](#git-status-counts) | 显示冲突数量,设置冲突数量的显示样式。 | -| `ahead` | `"⇡"` | 这个分支领先于正在跟踪的分支。 | -| `behind` | `"⇣"` | 这个分支落后于正在跟踪的分支。 | -| `diverged` | `"⇕"` | 这个分支与正在跟踪的分支有分歧。 | -| `untracked` | `"?"` | 工作目录中有未跟踪的文件。 | -| `untracked_count` | [见下文](#git-status-counts) | 显示未跟踪文件的数量,设置该数量的显示样式。 | -| `stashed` | `"$"` | 本地 git 仓库中存在一个 stash 快照。 | -| `stashed_count` | [见下文](#git-status-counts) | 显示 stash 快照数量,设置快照数量的显示样式。 | -| `modified` | `"!"` | 工作目录中有文件修改。 | -| `modified_count` | [见下文](#git-status-counts) | 显示修改文件的数量,设置该数量的显示样式。 | -| `staged` | `"+"` | 一个新文件被添加到了暂存区(staging area)。 | -| `staged_count` | [见下文](#git-status-counts) | 显示暂存区中文件数量,设置该数量的显示样式。 | -| `renamed` | `"»"` | 一个重命名的文件被添加到了暂存区。 | -| `renamed_count` | [见下文](#git-status-counts) | 显示重命名文件的数量,设置该数量的显示样式。 | -| `deleted` | `"✘"` | 一个文件的删除记录被添加到了暂存区。 | -| `deleted_count` | [见下文](#git-status-counts) | 显示文件删除记录的数量,设置该数量的显示样式。 | -| `show_sync_count` | `false` | 显示领先/落后正在跟踪的分支的提交数。 | -| `prefix` | `[` | 直接在 git 状态前显示的前缀。 | -| `suffix` | `]` | 直接在 git 状态后显示的后缀。 | -| `style` | `"bold red"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `git_status` 组件。 | +| Option | 默认值 | 描述 | +| ----------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | "([\[$all_status$ahead_behind\]]($style) )" | The default format for `git_status` | +| `conflicted` | `"="` | 这个分支有合并冲突。 | +| `ahead` | `"⇡"` | The format of `ahead` | +| `behind` | `"⇣"` | The format of `behind` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `show_sync_count` | `false` | 显示领先/落后正在跟踪的分支的提交数。 | +| `style` | `"bold red"` | 此组件的样式。 | +| `disabled` | `false` | 禁用 `git_status` 组件。 | -#### Git Status 中的计数值 +### Variables -| 字段 | 默认值 | 描述 | -| --------- | ------- | ------------------------------- | -| `enabled` | `false` | 显示相应的文件数量 | -| `style` | | 可选字段,使计数值的显示风格不同于 git_status 组件 | +The following variables can be used in `format`: + +| 字段 | 描述 | +| -------------- | --------------------------------------------------------------------------------------------- | +| `all_status` | Shortcut for`$conflicted$stashed$deleted$renamed$modified$staged$untracked` | +| `ahead_behind` | Displays `diverged` `ahead` or `behind` format string based on the current status of the repo | +| `conflicted` | Displays `conflicted` when this branch has merge conflicts. | +| `untracked` | Displays `untracked` when there are untracked files in the working directory. | +| `stashed` | Displays `stashed` when a stash exists for the local repository. | +| `modified` | Displays `modified` when there are file modifications in the working directory. | +| `staged` | Displays `staged` when a new file has been added to the staging area. | +| `renamed` | Displays `renamed` when a renamed file has been added to the staging area. | +| `deleted` | Displays `deleted` when a file's deletion has been added to the staging area. | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +The following variables can be used in `diverged`: + +| 字段 | 描述 | +| -------------- | ---------------------------------------------- | +| `ahead_count` | Number of commits ahead of the tracking branch | +| `behind_count` | Number of commits behind the tracking branch | + +The following variables can be used in `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` and `deleted`: + +| 字段 | 描述 | +| ------- | --------- | +| `count` | 显示相应的文件数量 | ### 示例 @@ -685,10 +1017,7 @@ diverged = "😵" untracked = "🤷‍" stashed = "📦" modified = "📝" -staged.value = "++" -staged.style = "green" -staged_count.enabled = true -staged_count.style = "green" +staged = '[++\($count\)](green)' renamed = "👅" deleted = "🗑" ``` @@ -708,11 +1037,22 @@ deleted = "🗑" ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | ------------- | -------------------------- | -| `symbol` | `"🐹 "` | 这个字段的内容会显示在当前 Golang 版本之前。 | -| `style` | `"bold cyan"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `golang` 组件。 | +| Option | 默认值 | 描述 | +| ---------- | ---------------------------------- | ---------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐹 "` | A format string representing the symbol of Go. | +| `style` | `"bold cyan"` | 此组件的样式。 | +| `disabled` | `false` | 禁用 `golang` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | --------- | ------------------------------------ | +| version | `v1.12.1` | The version of `go` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -720,30 +1060,42 @@ deleted = "🗑" # ~/.config/starship.toml [golang] -symbol = "🏎💨 " +format = "via [🏎💨 $version](bold cyan) " ``` -## Haskell -`haskell` 组件显示当前安装的 Haskell Stack 版本。 此组件将在符合以下任意条件之一时显示: +## Helm -- 当前目录包含 `stack.yaml` 文件 +The `helm` module shows the currently installed version of Helm. 此组件将在符合以下任意条件之一时显示: + +- 当前目录包含一个 `helmfile.yaml` 文件 +- The current directory contains a `Chart.yaml` file ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | ------------ | --------------------------- | -| `symbol` | `"λ "` | 这个字段的内容会显示在当前 Haskell 版本之前。 | -| `style` | `"bold red"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `haskell` 组件。 | +| Option | 默认值 | 描述 | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⎈ "` | A format string representing the symbol of Helm. | +| `style` | `"bold white"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `helm` module. | +### Variables + +| 字段 | 示例 | 描述 | +| --------- | -------- | ------------------------------------ | +| version | `v3.1.1` | The version of `helm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 ```toml # ~/.config/starship.toml -[haskell] -symbol = " " +[helm] +format = "via [⎈ $version](bold white) " ``` ## Hostname @@ -752,14 +1104,23 @@ symbol = " " ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | --------------------- | ------------------------------------------------------------------ | -| `ssh_only` | `true` | 仅在连接到 SSH 会话时显示主机名。 | -| `prefix` | `""` | 直接在主机名前显示的前缀。 | -| `suffix` | `""` | 直接在主机名后显示的后缀。 | -| `trim_at` | `"."` | 当主机名过长被截断时,会截断成第一次匹配该字符串之前的主机名。 `"."` 会让主机名截断到第一个点处。 `""` 会禁用任何截断。 | -| `style` | `"bold dimmed green"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `hostname` 组件。 | +| Option | 默认值 | 描述 | +| ---------- | --------------------------- | ------------------------------------------------------------------ | +| `ssh_only` | `true` | 仅在连接到 SSH 会话时显示主机名。 | +| `trim_at` | `"."` | 当主机名过长被截断时,会截断成第一次匹配该字符串之前的主机名。 `"."` 会让主机名截断到第一个点处。 `""` 会禁用任何截断。 | +| `format` | `"on [$hostname]($style) "` | The format for the module. | +| `style` | `"bold dimmed green"` | 此组件的样式。 | +| `disabled` | `false` | 禁用 `hostname` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | --- | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -768,8 +1129,7 @@ symbol = " " [hostname] ssh_only = false -prefix = "⟪" -suffix = "⟫" +format = "on [$hostname](bold red) " trim_at = ".companyname.com" disabled = false ``` @@ -783,11 +1143,22 @@ disabled = false ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | -------------- | ------------------------ | -| `symbol` | `"☕ "` | 这个字段的内容会显示在当前 Java 版本之前。 | -| `style` | `"dimmed red"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `java` 组件。 | +| Option | 默认值 | 描述 | +| ---------- | -------------------------------------- | ----------------------------------------------- | +| `format` | `"via [${symbol}${version}]($style) "` | The format for the module. | +| `symbol` | `"☕ "` | A format string representing the symbol of Java | +| `style` | `"red dimmed"` | 此组件的样式。 | +| `disabled` | `false` | 禁用 `java` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | ----- | ------------------------------------ | +| version | `v14` | The version of `java` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -804,12 +1175,23 @@ symbol = "🌟 " ### 配置项 -| 字段 | 默认值 | 描述 | -| ----------- | ------------- | -------------------- | -| `symbol` | `"✦"` | 这个字段的内容会显示在当前作业数量之前。 | -| `threshold` | `1` | 如果超过此字段的值,显示任务数量。 | -| `style` | `"bold blue"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `jobs` 组件。 | +| Option | 默认值 | 描述 | +| ----------- | ----------------------------- | ------------------------------------------------ | +| `threshold` | `1` | 如果超过此字段的值,显示任务数量。 | +| `format` | `"[$symbol$number]($style) "` | The format for the module. | +| `symbol` | `"✦"` | A format string representing the number of jobs. | +| `style` | `"bold blue"` | 此组件的样式。 | +| `disabled` | `false` | 禁用 `jobs` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | --- | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -823,7 +1205,7 @@ threshold = 4 ## Julia -The `julia` module shows the currently installed version of Julia. 此组件将在符合以下条件之一时显示: +The `julia` module shows the currently installed version of Julia. 此组件将在符合以下任意条件之一时显示: - The current directory contains a `Project.toml` file - The current directory contains a `Manifest.toml` file @@ -831,11 +1213,22 @@ The `julia` module shows the currently installed version of Julia. 此组件将 ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | --------------- | ------------------------------------------------------- | -| `symbol` | `"ஃ "` | The symbol used before displaying the version of Julia. | -| `style` | `"bold purple"` | 此组件的样式。 | -| `disabled` | `false` | Disables the `julia` module. | +| Option | 默认值 | 描述 | +| ---------- | ---------------------------------- | ------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"ஃ "` | A format string representing the symbol of Julia. | +| `style` | `"bold purple"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `julia` module. | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | -------- | ------------------------------------ | +| version | `v1.4.0` | The version of `julia` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -845,9 +1238,10 @@ The `julia` module shows the currently installed version of Julia. 此组件将 [julia] symbol = "∴ " ``` + ## Kubernetes -显示当前的 Kubernetes 上下文名以及,如果有相关设置,则显示来自 kubeconig 文件的命名空间。 命名空间需要在 kubeconfig 文件中设置,这可以通过 `kubectl config set-context starship-cluster --namespace astronaut` 完成。 如果设置了环境变量 `$KUBECONFIG`,此组件将使用该值,否则会使用 `~/.kube/config`。 +Displays the current Kubernetes context name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`. ::: tip @@ -857,12 +1251,25 @@ symbol = "∴ " ### 配置项 -| 字段 | 默认值 | 描述 | -| ----------------- | ------------- | ----------------------------------- | -| `symbol` | `"☸ "` | 这个字段的内容会显示在当前集群信息之前。 | -| `context_aliases` | | Table of context aliases to display | -| `style` | `"bold blue"` | 此组件的样式。 | -| `disabled` | `true` | 禁用 `kubernetes` 组件。 | +| Option | 默认值 | 描述 | +| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- | +| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. | +| `format` | `"on [$symbol$context( \\($namespace\\))]($style) "` | 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. | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | -------------------- | ---------------------------------------- | +| context | `starship-cluster` | The current kubernetes context | +| namespace | `starship-namespace` | If set, the current kubernetes namespace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -870,8 +1277,7 @@ symbol = "∴ " # ~/.config/starship.toml [kubernetes] -symbol = "⛵ " -style = "dimmed green" +format = "on [⛵ $context \\($namespace\\)](dimmed green) " disabled = false [kubernetes.context_aliases] "dev.local.cluster.k8s" = "dev" @@ -883,7 +1289,7 @@ disabled = false ### 配置项 -| 字段 | 默认值 | 描述 | +| Option | 默认值 | 描述 | | ---------- | ------- | --------------------------- | | `disabled` | `false` | 禁用 `line_break` 组件,使提示成为单行。 | @@ -910,15 +1316,26 @@ disabled = true ### 配置项 -| 字段 | 默认值 | 描述 | -| ----------------- | --------------------- | -------------------------- | -| `show_percentage` | `false` | 用可用内存的百分比来显示内存使用情况。 | -| `show_swap` | `true` | 如果总交换区使用量为非零,则显示交换区使用情况。 | -| `threshold` | `75` | 隐藏内存使用情况,除非它超过这个百分比。 | -| `symbol` | `"🐏 "` | 这个字段的内容会显示在当前内存使用情况之前。 | -| `separator` | `" | "` | 此字段所设置的符号或文本会分隔内存和交换区使用情况。 | -| `style` | `"bold dimmed white"` | 此组件的样式。 | -| `disabled` | `true` | 禁用 `memory_usage` 模块 | +| Option | 默认值 | 描述 | +| ----------- | --------------------------------------------- | -------------------------- | +| `threshold` | `75` | 隐藏内存使用情况,除非它超过这个百分比。 | +| `format` | `"via $symbol [${ram}( | ${swap})]($style) "` | The format for the module. | +| `symbol` | `"🐏"` | 这个字段的内容会显示在当前内存使用情况之前。 | +| `style` | `"bold dimmed white"` | 此组件的样式。 | +| `disabled` | `true` | 禁用 `memory_usage` 模块 | + +### Variables + +| 字段 | 示例 | 描述 | +| ------------- | ------------- | ------------------------------------------------------------------ | +| ram | `31GiB/65GiB` | The usage/total RAM of the current system memory. | +| ram_pct | `48%` | The percentage of the current system memory. | +| swap\** | `1GiB/4GiB` | The swap memory size of the current system swap memory file. | +| swap_pct\** | `77%` | The swap memory percentage of the current system swap memory file. | +| symbol | `🐏` | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string \*\*: The SWAP file information is only displayed if detected on the current system ### 示例 @@ -941,13 +1358,24 @@ style = "bold dimmed green" ### 配置项 -| 字段 | 默认值 | 描述 | -| ------------------- | --------------- | ------------------------------- | -| `symbol` | `" "` | 该字段的内容显示于当前仓库的 hg 书签或活动分支名之前。 | -| `truncation_length` | `2^63 - 1` | 将显示的 hg 分支名截断到该数量的字素(graphemes) | -| `truncation_symbol` | `"…"` | 此字段的内容用来表示分支名称被截断。 | -| `style` | `"bold purple"` | 此组件的样式。 | -| `disabled` | `true` | 禁用 `hg_branch` 组件。 | +| Option | 默认值 | 描述 | +| ------------------- | -------------------------------- | ------------------------------- | +| `symbol` | `" "` | 该字段的内容显示于当前仓库的 hg 书签或活动分支名之前。 | +| `style` | `"bold purple"` | 此组件的样式。 | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. | +| `truncation_length` | `2^63 - 1` | 将显示的 hg 分支名截断到该数量的字素(graphemes) | +| `truncation_symbol` | `"…"` | 此字段的内容用来表示分支名称被截断。 | +| `disabled` | `true` | 禁用 `hg_branch` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | -------- | ------------------------------------ | +| branch | `master` | The active mercurial branch | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -955,26 +1383,38 @@ style = "bold dimmed green" # ~/.config/starship.toml [hg_branch] -symbol = "🌱 " +format = "on [🌱 $branch](bold purple)" truncation_length = 4 truncation_symbol = "" ``` ## Nim -The `nim` module shows the currently installed version of Nim. 此组件只有满足以下条件之一时才会被显示: -- The current directory contains a `nim.cfg` file +The `nim` module shows the currently installed version of Nim. 此组件将在符合以下任意条件之一时显示: + +- 当前目录包含一个 `nim.cfg` 文件 - The current directory contains a file with the `.nim` extension - The current directory contains a file with the `.nims` extension - The current directory contains a file with the `.nimble` extension ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | -| `style` | `"bold yellow"` | 此组件的样式。 | -| `disabled` | `false` | Disables the `nim` module. | +| Option | 默认值 | 描述 | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module | +| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | +| `style` | `"bold yellow"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `nim` module. | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | -------- | ------------------------------------ | +| version | `v1.2.0` | The version of `nimc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -992,14 +1432,25 @@ symbol = "🎣 " ### 配置项 -| 字段 | 默认值 | 描述 | -| ------------ | ------------- | ------------------------------------------------- | -| `use_name` | `false` | 显示 nix-shell 的名称。 | -| `impure_msg` | `"impure"` | 自定义“impure”消息。 | -| `pure_msg` | `"pure"` | 自定义“pure”消息。 | -| `symbol` | `"❄️ "` | The symbol used before displaying the shell name. | -| `style` | `"bold blue"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `nix_shell` 组件。 | +| Option | 默认值 | 描述 | +| ------------ | -------------------------------------------------- | ----------------------------------------------------- | +| `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. | +| `pure_msg` | `"pure"` | A format string shown when the shell is pure. | +| `disabled` | `false` | 禁用 `nix_shell` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | ------- | ------------------------------------ | +| state | `pure` | The state of the nix-shell | +| name | `lorri` | The name of the nix-shell | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -1008,28 +1459,39 @@ symbol = "🎣 " [nix_shell] disabled = true -use_name = true -impure_msg = "impure shell" -pure_msg = "pure shell" -symbol = "☃️ " +impure_msg = "[impure shell](bold red)" +pure_msg = "[pure shell](bold green)" +format = "via [☃️ $state( \\($name\\))](bold blue) " ``` ## NodeJS -`nodejs` 组件显示当前安装的 NodeJS 版本。 此组件将在符合以下任意条件时显示: +`nodejs` 组件显示当前安装的 NodeJS 版本。 此组件将在符合以下任意条件之一时显示: - 当前目录包含 `package.json` 文件 - The current directory contains a `.node-version` file - 当前目录包含 `node_modules` 目录 -- 当前目录包含一个使用 `.js` 扩展名的文件 +- The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension +- The current directory contains a file with the `.ts` extension ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | -------------- | -------------------------- | -| `symbol` | `"⬢ "` | 这个字段的内容会显示在当前 NodeJS 版本之前。 | -| `style` | `"bold green"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `nodejs` 组件。 | +| Option | 默认值 | 描述 | +| ---------- | ---------------------------------- | -------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⬢ "` | A format string representing the symbol of NodeJS. | +| `style` | `"bold green"` | 此组件的样式。 | +| `disabled` | `false` | 禁用 `nodejs` 组件。 | + +###  Variables + +| 字段 | 示例 | 描述 | +| --------- | ---------- | ------------------------------------ | +| version | `v13.12.0` | The version of `node` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -1037,7 +1499,7 @@ symbol = "☃️ " # ~/.config/starship.toml [nodejs] -symbol = "🤖 " +format = "via [🤖 $version](bold green) " ``` ## Package Version @@ -1056,12 +1518,23 @@ symbol = "🤖 " ### 配置项 -| 字段 | 默认值 | 描述 | -| ----------------- | ------------ | --------------------------------------------------------- | -| `symbol` | `"📦 "` | 这个字段的内容会显示在当前软件包版本之前。 | -| `style` | `"bold 208"` | 此组件的样式。 | -| `display_private` | `false` | Enable displaying version for packages marked as private. | -| `disabled` | `false` | 禁用 `package` 组件。 | +| Option | 默认值 | 描述 | +| ----------------- | ---------------------------------- | --------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"📦 "` | 这个字段的内容会显示在当前软件包版本之前。 | +| `style` | `"bold 208"` | 此组件的样式。 | +| `display_private` | `false` | Enable displaying version for packages marked as private. | +| `disabled` | `false` | 禁用 `package` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | -------- | ------------------------------------ | +| version | `v1.0.0` | The version of your package | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -1069,7 +1542,7 @@ symbol = "🤖 " # ~/.config/starship.toml [package] -symbol = "🎁 " +format = "via [🎁 $version](208 bold) " ``` ## OCaml @@ -1085,11 +1558,22 @@ The `ocaml` module shows the currently installed version of OCaml. 此组件将 ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | --------------- | ------------------------------------------------------- | -| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | -| `style` | `"bold yellow"` | 此组件的样式。 | -| `disabled` | `false` | Disables the `ocaml` module. | +| Option | 默认值 | 描述 | +| ---------- | ---------------------------------- | ------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format string for the module. | +| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | +| `style` | `"bold yellow"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `ocaml` module. | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | --------- | ------------------------------------ | +| version | `v4.10.0` | The version of `ocaml` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -1097,12 +1581,12 @@ The `ocaml` module shows the currently installed version of OCaml. 此组件将 # ~/.config/starship.toml [ocaml] -symbol = "🐪 " +format = "via [🐪 $version]($style) " ``` ## PHP -`php` 组件显示当前安装的 PHP 版本。 此组件只有满足以下条件之一时才会被显示: +`php` 组件显示当前安装的 PHP 版本。 此组件将在符合以下任意条件之一时显示: - 当前目录包含一个 `composer.json` 文件 - The current directory contains a `.php-version` file @@ -1110,11 +1594,22 @@ symbol = "🐪 " ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | ------------ | ----------------------- | -| `symbol` | `"🐘 "` | 这个字段的内容会显示在当前 PHP 版本之前。 | -| `style` | `"bold 147"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `php` 组件。 | +| Option | 默认值 | 描述 | +| ---------- | ---------------------------------- | -------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐘 "` | 这个字段的内容会显示在当前 PHP 版本之前。 | +| `style` | `"147 bold"` | 此组件的样式。 | +| `disabled` | `false` | 禁用 `php` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | -------- | ------------------------------------ | +| version | `v7.3.8` | The version of `php` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -1122,7 +1617,7 @@ symbol = "🐪 " # ~/.config/starship.toml [php] -symbol = "🔹 " +format = "via [🔹 $version](147 bold) " ``` ## Python @@ -1145,14 +1640,23 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name ### 配置项 -| 字段 | 默认值 | 描述 | -| -------------------- | --------------- | -------------------------------------------------------------------------- | -| `symbol` | `"🐍 "` | 这个字段的内容会显示在当前 Python 版本之前。 | -| `pyenv_version_name` | `false` | 使用 pyenv 获取 Python 版本 | -| `pyenv_prefix` | `"pyenv "` | 在 pyenv 版本前显示的前缀(默认显示 `pyenv MY_VERSION`) | -| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | -| `style` | `"bold yellow"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `python` 组件。 | +| Option | 默认值 | 描述 | +| -------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${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 版本 | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `disabled` | `false` | 禁用 `python` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| ---------- | --------------- | ------------------------------------ | +| version | `"v3.8.1"` | The version of `python` | +| symbol | `"🐍 "` | Mirrors the value of option `symbol` | +| style | `"yellow bold"` | Mirrors the value of option `style` | +| virtualenv | `"venv"` | The current `virtualenv` name |
This module has some advanced configuration options. @@ -1193,11 +1697,22 @@ pyenv_prefix = "foo " ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | ------------ | ------------------------------------------------------ | -| `symbol` | `"💎 "` | The symbol used before displaying the version of Ruby. | -| `style` | `"bold red"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `ruby` 组件。 | +| Option | 默认值 | 描述 | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"💎 "` | A format string representing the symbol of Ruby. | +| `style` | `"bold red"` | 此组件的样式。 | +| `disabled` | `false` | 禁用 `ruby` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | -------- | ------------------------------------ | +| version | `v2.5.1` | The version of `ruby` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -1217,11 +1732,22 @@ symbol = "🔺 " ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | ------------ | ------------------------ | -| `symbol` | `"🦀 "` | 这个字段的内容会显示在当前 Rust 版本之前。 | -| `style` | `"bold red"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `rust` 组件。 | +| Option | 默认值 | 描述 | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🦀 "` | A format string representing the symbol of Rust | +| `style` | `"bold red"` | 此组件的样式。 | +| `disabled` | `false` | 禁用 `rust` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | ----------------- | ------------------------------------ | +| version | `v1.43.0-nightly` | The version of `rustc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -1229,7 +1755,7 @@ symbol = "🔺 " # ~/.config/starship.toml [rust] -symbol = "⚙️ " +format = "via [⚙️ $version](red bold)" ``` ## Singularity @@ -1238,14 +1764,22 @@ The `singularity` module shows the current singularity image, if inside a contai ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | -------------------- | ------------------------------------------------ | -| `label` | `""` | Prefix before the image name display. | -| `prefix` | `"["` | Prefix to display immediately before image name. | -| `suffix` | `"]"` | Suffix to display immediately after image name. | -| `symbol` | `""` | The symbol used before the image name. | -| `style` | `"bold dimmed blue"` | 此组件的样式。 | -| `disabled` | `false` | Disables the `singularity` module. | +| Option | 默认值 | 描述 | +| ---------- | ------------------------------------ | ------------------------------------------------ | +| `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. | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | ------------ | ------------------------------------ | +| env | `centos.img` | The current singularity image | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -1253,32 +1787,54 @@ The `singularity` module shows the current singularity image, if inside a contai # ~/.config/starship.toml [singularity] -symbol = "📦 " +format = "[📦 \\[$env\\]]($style) " ``` ## Terraform -`terraform` 组件显示当前选定的 terraform 工作区和版本。 默认情况下不会显示 terraform 版本,因为当使用大量插件时,当前版本 terraform 查询版本号很慢。 此组件将在符合以下任意条件之一时显示: +`terraform` 组件显示当前选定的 terraform 工作区和版本。 默认情况下不会显示 terraform 版本,因为当使用大量插件时,当前版本 terraform 查询版本号很慢。 If you still want to enable it, [follow the example shown below](#with-version). 此组件将在符合以下任意条件之一时显示: - 当前目录包含 `.terraform` 目录 - 当前目录包含一个使用 `.tf` 扩展名的文件 ### 配置项 -| 字段 | 默认值 | 描述 | -| -------------- | ------------ | -------------------------------- | -| `symbol` | `"💠 "` | 这个字段的内容会显示在当前 terraform 工作区之前。 | -| `show_version` | `false` | 显示 terraform 版本信息。 在大型工作空间中非常缓慢。 | -| `style` | `"bold 105"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `terraform` 组件。 | +| Option | 默认值 | 描述 | +| ---------- | ------------------------------------ | ----------------------------------------------------- | +| `format` | `"via [$symbol$workspace]($style) "` | The format string for the module. | +| `symbol` | `"💠 "` | A format string shown before the terraform workspace. | +| `style` | `"bold 105"` | 此组件的样式。 | +| `disabled` | `false` | 禁用 `terraform` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | ---------- | ------------------------------------ | +| version | `v0.12.24` | The version of `terraform` | +| workspace | `default` | The current terraform workspace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 +#### With Version + ```toml # ~/.config/starship.toml [terraform] -symbol = "🏎💨 " +format = "[🏎💨 $version$workspace]($style) " +``` + +#### Without version + +```toml +# ~/.config/starship.toml + +[terraform] +format = "[🏎💨 $workspace]($style) " ``` ## Time @@ -1293,16 +1849,26 @@ symbol = "🏎💨 " ### 配置项 -| 字段 | 默认值 | 描述 | -| ----------------- | --------------- | ----------------------------------------------------------------------------------------------------- | -| `use_12hr` | `false` | 启用 12 小时格式. | -| `format` | 见下文解释 | 用来格式化时间显示的 [chrono 格式字符串](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) | -| `style` | `"bold yellow"` | The style for the module time. | -| `utc_time_offset` | `"local"` | 设置所用 UTC 偏移量。 范围是 -24 < x < 24。 允许使用浮点数来得到 30/45 分钟的时区偏移。 | -| `disabled` | `true` | 禁用 `time` 组件。 | -| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | +| Option | 默认值 | 描述 | +| ----------------- | ----------------------- | ----------------------------------------------------------------------------------------------------- | +| `format` | `"at [$time]($style) "` | The format string for the module. | +| `use_12hr` | `false` | 启用 12 小时格式 | +| `time_format` | 见下文解释 | 用来格式化时间显示的 [chrono 格式字符串](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) | +| `style` | `"bold yellow"` | 显示时间的样式。 | +| `utc_time_offset` | `"local"` | 设置所用 UTC 偏移量。 Range from -24 < x < 24. 允许使用浮点数来得到 30/45 分钟的时区偏移。 | +| `disabled` | `true` | 禁用 `time` 组件。 | +| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | -如果 `use_12hr` 为 `true`,则`format` 默认值为 `"%r"`。 否则,其默认值为 `"%T"`。 手动设置 `format` 将使 `use_12hr` 被忽略。 +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. 否则,其默认值为 `"%T"`。 Manually setting `time_format` will override the `use_12hr` setting. + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | ---------- | ----------------------------------- | +| time | `13:08:10` | The current time. | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -1311,7 +1877,8 @@ symbol = "🏎💨 " [time] disabled = false -format = "🕙[ %T ]" +format = "🕙[\\[ $time \\]]($style) " +time_format = "%T" utc_time_offset = "-5" time_range = "10:00:00-14:00:00" ``` @@ -1327,12 +1894,20 @@ time_range = "10:00:00-14:00:00" ### 配置项 -| 字段 | 默认值 | 描述 | -| ------------- | --------------- | ------------------- | -| `style_root` | `"bold red"` | 当前用户为 root 时使用的样式。 | -| `style_user` | `"bold yellow"` | 非 root 用户使用的样式。 | -| `show_always` | `false` | 总是显示 `username` 组件。 | -| `disabled` | `false` | 禁用 `username` 组件。 | +| Option | 默认值 | 描述 | +| ------------- | ------------------------ | -------------------------- | +| `style_root` | `"bold red"` | 当前用户为 root 时使用的样式。 | +| `style_user` | `"bold yellow"` | 非 root 用户使用的样式。 | +| `format` | `"via [$user]($style) "` | The format for the module. | +| `show_always` | `false` | 总是显示 `username` 组件。 | +| `disabled` | `false` | 禁用 `username` 组件。 | + +### Variables + +| 字段 | 示例 | 描述 | +| ------- | ------------ | ------------------------------------------------------------------------------------------- | +| `style` | `"red bold"` | Mirrors the value of option `style_root` when root is logged in and `style_user` otherwise. | +| `user` | `"matchai"` | The currently logged-in user ID. | ### 示例 @@ -1340,10 +1915,13 @@ time_range = "10:00:00-14:00:00" # ~/.config/starship.toml [username] -disabled = true +style_user = "white bold" +style_root = "black bold" +format = "user: [$user]($style) " +disabled = false +show_always = true ``` - ## Zig The `zig` module shows the currently installed version of Zig. 此组件将在符合以下任意条件之一时显示: @@ -1352,11 +1930,22 @@ The `zig` module shows the currently installed version of Zig. 此组件将在 ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | -| `style` | `"bold yellow"` | 此组件的样式。 | -| `disabled` | `false` | Disables the `zig` module. | +| Option | 默认值 | 描述 | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | +| `style` | `"bold yellow"` | 此组件的样式。 | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `zig` module. | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | -------- | ------------------------------------ | +| version | `v0.6.0` | The version of `zig` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -1372,6 +1961,7 @@ symbol = "⚡️ " The `custom` modules show the output of some arbitrary commands. These modules will be shown if any of the following conditions are met: + - The current directory contains a file whose name is in `files` - The current directory contains a directory whose name is in `directories` - The current directory contains a file whose extension is in `extensions` @@ -1391,24 +1981,34 @@ The order in which custom modules are shown can be individually set by setting ` ### 配置项 -| 字段 | 默认值 | 描述 | -| ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. | -| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | -| `shell` | | [See below](#custom-command-shell) | -| `描述` | `""` | The description of the module that is shown when running `starship explain`. | -| `files` | `[]` | The files that will be searched in the working directory for a match. | -| `directories` | `[]` | The directories that will be searched in the working directory for a match. | -| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | -| `symbol` | `""` | The symbol used before displaying the command output. | -| `style` | `"bold green"` | 此组件的样式。 | -| `prefix` | `""` | Prefix to display immediately before the command output. | -| `suffix` | `""` | Suffix to display immediately after the command output. | -| `disabled` | `false` | Disables this `custom` module. | +| Option | 默认值 | 描述 | +| ------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `command` | | The command whose output should be printed. | +| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | +| `shell` | | [See below](#custom-command-shell) | +| `描述` | `""` | The description of the module that is shown when running `starship explain`. | +| `files` | `[]` | The files that will be searched in the working directory for a match. | +| `directories` | `[]` | The directories that will be searched in the working directory for a match. | +| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | +| `symbol` | `""` | The symbol used before displaying the command output. | +| `style` | `"bold green"` | 此组件的样式。 | +| `format` | `"[$symbol$output]($style) "` | The format for the module. | +| `disabled` | `false` | Disables this `custom` module. | + +### Variables + +| 字段 | 描述 | +| --------- | -------------------------------------- | +| output | The output of shell command in `shell` | +| symbol | Mirrors the value of option `symbol` | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string #### Custom command shell `shell` accepts a non-empty list of strings, where: + - The first string is the path to the shell to use to execute the command. - Other following arguments are passed to the shell. @@ -1459,11 +2059,22 @@ The `purescript` module shows the currently installed version of PureScript vers ### 配置项 -| 字段 | 默认值 | 描述 | -| ---------- | -------------- | ------------------------------------------------------------ | -| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | -| `style` | `"bold white"` | 此组件的样式。 | -| `disabled` | `false` | Disables the `purescript` module. | +| Option | 默认值 | 描述 | +| ---------- | ---------------------------------- | ------------------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | +| `style` | `"bold white"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `purescript` module. | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | -------- | ------------------------------------ | +| version | `0.13.5` | The version of `purescript` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 示例 @@ -1471,5 +2082,5 @@ The `purescript` module shows the currently installed version of PureScript vers # ~/.config/starship.toml [purescript] -symbol = "<=> " +format = "via [$symbol$version](bold white)" ``` diff --git a/docs/zh-CN/faq/README.md b/docs/zh-CN/faq/README.md index 82506c2e..ffc08f85 100644 --- a/docs/zh-CN/faq/README.md +++ b/docs/zh-CN/faq/README.md @@ -5,9 +5,9 @@ - **终端模拟器**:[iTerm2](https://iterm2.com/) - **主题**:Minimal - **颜色方案**:[Snazzy](https://github.com/sindresorhus/iterm2-snazzy) - - **字体**:[Fira Code](https://github.com/tonsky/FiraCode) + - **Font**: [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads) - **Shell**:[Fish Shell](https://fishshell.com/) - - **fish 配置**:[matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/master/.config/fish/config.fish) + - **fish 配置**:[matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish) - **提示符工具**:[Starship](https://starship.rs/) ## `prompt_order` 和 `.disabled` 的效果是一样的吗? @@ -46,7 +46,7 @@ Starship 会处理所提供的全部上下文参数并在提示符中显示, ## How do I run Starship on Linux distributions with older versions of glibc? -If you get an error like "*version 'GLIBC_2.18' not found (required by starship)*" when using the prebuilt binary (for example, on CentOS 6 or 7), you can use a binary compiled with `musl` instead of `glibc`: +If you get an error like "_version 'GLIBC_2.18' not found (required by starship)_" when using the prebuilt binary (for example, on CentOS 6 or 7), you can use a binary compiled with `musl` instead of `glibc`: ```sh curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux-musl @@ -56,13 +56,13 @@ curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux- 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: - - 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 [powerline-patched font](https://github.com/powerline/fonts). +- 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/). To test your system, run the following commands in a terminal: -``` +```sh echo -e "\xf0\x9f\x90\x8d" echo -e "\xee\x82\xa0" ``` @@ -70,3 +70,19 @@ 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). 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) + +## How do I uninstall Starship? + +Starship is just as easy to uninstall as it is to install in the first place. + +1. Remove any lines in your shell config (e.g. `~/.bashrc`) used to initialize Starship. +1. Delete the Starship binary. + +If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. + +If Starship was installed using the `curl | bash` script, the following command will delete the binary: + +```sh +# Locate and delete the starship binary +rm "$(which starship)" +``` diff --git a/docs/zh-CN/guide/README.md b/docs/zh-CN/guide/README.md index d47a7516..8f61b2f0 100644 --- a/docs/zh-CN/guide/README.md +++ b/docs/zh-CN/guide/README.md @@ -121,7 +121,7 @@ ### 前置要求 -- 安装一种 [Powerline 字体](https://github.com/powerline/fonts)(如 [Fira Code](https://github.com/tonsky/FiraCode))并在您的终端启用 。 +- A [Nerd Font](https://www.nerdfonts.com/) installed and enabled in your terminal (for example, try the [Fira Code Nerd Font](https://www.nerdfonts.com/font-downloads)). ### 开始安装 @@ -224,7 +224,7 @@ ### Code Contributors -This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. +This project exists thanks to all the people who contribute. [[Contribute](https://github.com/starship/starship/blob/master/CONTRIBUTING.md)]. ### Financial Contributors diff --git a/docs/zh-TW/advanced-config/README.md b/docs/zh-TW/advanced-config/README.md index 0c118453..2f0519ac 100644 --- a/docs/zh-TW/advanced-config/README.md +++ b/docs/zh-TW/advanced-config/README.md @@ -57,7 +57,16 @@ starship_precmd_user_func="set_win_title" precmd_functions+=(set_win_title) ``` -如果你喜歡這個結果,把這幾行加入你的 shell 設定檔中(`~/.bashrc` 或 `~/.zsrhc`)來將此設為永久設定。 +If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. + +For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: + +```bash +function set_win_title(){ + echo -ne "\033]0; $(basename $PWD) \007" +} +starship_precmd_user_func="set_win_title" +``` ## 風格字串 diff --git a/docs/zh-TW/config/README.md b/docs/zh-TW/config/README.md index b4b31ad9..15868a0f 100644 --- a/docs/zh-TW/config/README.md +++ b/docs/zh-TW/config/README.md @@ -15,24 +15,26 @@ mkdir -p ~/.config && touch ~/.config/starship.toml 所有關於 Starship 的設定都在這個 [TOML](https://github.com/toml-lang/toml) 檔案內: ```toml -# 不要在提示字元的開頭換行 +# Don't print a new line at the start of the prompt add_newline = false -# 把提示字元中的 "❯" 符號換成 "➜" -[character] # 我們正在設定的模組叫做 "character" -symbol = "➜" # 設定 "symbol" 區段為 "➜" +# Replace the "❯" symbol in the prompt with "➜" +[character] # The name of the module we are configuring is "character" +success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green" -# 關閉 package 模組,把它完全從提示字元藏起來 +# Disable the package module, hiding it from the prompt completely [package] disabled = true ``` 你可以藉由修改 `STARSHIP_CONFIG`環境變數而改變預設的`starship.toml` 檔案位置 + ```sh export STARSHIP_CONFIG=~/.starship ``` Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: + ```ps1 $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` @@ -41,16 +43,39 @@ $ENV:STARSHIP_CONFIG = "$HOME\.starship" **模組 (Module)**: 提示字元中的一個元件,基於你的作業系統提供的背景資訊來提供訊息。 舉例來說,如果你現在的資料夾是一個 NodeJS 專案,"nodejs" 模組會顯示出現在安裝在你的電腦上的 NodeJS 版本。 -**區段 (Segment)**: 組成一個模組的子元件。 舉例來說,"nodejs" 模組內的 "symbol" 區段包含了一個會顯示在版本編號之前的字元 (預設是 ⬢)。 +**Variable**: Smaller sub-components that contains information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of NodeJS. -這是一個 node 模組的表示法。 在下面的例子裡,"symbol" 跟 "version" 都是模組內的區段。 每個模組也包含了使用預設終端機顏色的一個前綴 (prefix) 跟一個後綴 (suffix)。 +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. -``` -[prefix] [symbol] [version] [suffix] - "via " "⬢" "v10.4.1" "" -``` +### Format Strings -### 風格字串 +Format strings are the format that a module prints all its variables with. Most modules have an entry called `format` that configures the display format of the module. You can use texts, variables and text groups in a format string. + +#### 變數 + +A variable contains a `$` symbol followed by the name of the variable. The name of a variable only contains letters, numbers and `_`. + +For example: + +- `$version` is a format string with a variable named `version`. +- `$git_branch$git_commit` is a format string with two variables named `git_branch` and `git_commit`. +- `$git_branch $git_commit` has the two variables separated with a space. + +#### Text Group + +A text group is made up of two different parts. + +The first part, which is enclosed in a `[]`, is a [format string](#format-strings). You can add texts, variables, or even nested text groups in it. + +In the second part, which is enclosed in a `()`, is a [style string](#style-strings). This can be used style the first part. + +For example: + +- `[on](red bold)` will print a string `on` with bold text colored red. +- `[⬢ $version](bold green)` will print a symbol `⬢` followed by the content of variable `version`, with bold text colored green. +- `[a [b](red) c](green)` will print `a b c` with `b` red, and `a` and `c` green. + +#### 風格字串 Starship 內大多數的模組允許你設定他們的顯示風格。 這要透過一個條目 (通常叫做 `style`),這個條目使用一個字串來進行設定。 這裡給幾個風格字串的例子,以及這些字串的功用。 對於完整語法的詳細說明,請參照 [進階設定指南](/advanced-config/)。 @@ -63,17 +88,56 @@ Starship 內大多數的模組允許你設定他們的顯示風格。 這要透 注意風格產出的樣子取決於你的終端機模擬器。 例如,有些終端機模擬器會提升顏色的亮度而不是讓文字變粗體,而且有些色彩主題對一般與加亮顏色使用的是相同色碼。 除此之外,為了要有斜體字,你的終端機一定要支援斜體。 +#### Conditional Format Strings + +A conditional format string wrapped in `(` and `)` will not render if all variables inside are empty. + +For example: + +- `(@$region)` will show nothing if the variable `region` is `None`, otherwise `@` followed by the value of region. +- `(some text)` will always show nothing since there are no variables wrapped in the braces. +- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. + +#### Escapable characters + +The following symbols have special usage in a format string. If you want to print the following symbols, you have to escape them with a backslash (`\`). + +- $ +- \\ +- [ +- ] +- ( +- ) + +Note that `toml` has [its own escape syntax](https://github.com/toml-lang/toml#user-content-string). It is recommended to use a literal string (`''`) in your config. If you want to use a basic string (`""`), pay attention to escape the backslash `\`. + +For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: + +```toml +# with basic string +format = "\n\\$" + +# with multiline basic string +format = """ + +\\$""" + +# with literal string +format = ''' + +\$''' +``` + ## 提示字元 以下是針對提示字元內容的設定。 ### 選項 -| 變數 | 預設 | 說明 | -| -------------- | --------------------------- | ----------------------------------------------------- | -| `add_newline` | `true` | 在提示字元前面加上換行字元。 | -| `prompt_order` | [連結](#default-prompt-order) | 調整各個提示字元模組的顯示順序。 | -| `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). | +| Option | 預設 | 說明 | +| -------------- | ---------------------------- | ----------------------------------------------------- | +| `format` | [連結](#default-prompt-format) | Configure the format of the prompt. | +| `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). | ### 範例 @@ -81,62 +145,71 @@ Starship 內大多數的模組允許你設定他們的顯示風格。 這要透 # ~/.config/starship.toml # Disable the newline at the start of the prompt -add_newline = false -# Overwrite a default_prompt_order and use custom prompt_order -prompt_order=["rust","line_break","package","line_break","character"] +format = "$all" + +# Use custom format +format = """ +[┌───────────────────>](bold green) +[│](bold green)$directory$rust$package +[└─>](bold green) """ + # Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 ``` -### 預設的提示字元順序 +### Default Prompt Format -預設 `prompt_order` 是用來在 `prompt_order` 為空時或者沒有提供時定義模組顯示在提示字元的順序。 預設如下: +The default `format` is used to define the format of the prompt, if empty or no `format` is provided. 預設如下: ```toml -prompt_order = [ - "username", - "hostname", - "kubernetes", - "directory", - "git_branch", - "git_commit", - "git_state", - "git_status", - "hg_branch", - "docker_context", - "package", - "dotnet", - "elixir", - "elm", - "erlang", - "golang", - "haskell", - "java", - "julia", - "nim", - "nodejs", - "ocaml", - "php", - "purescript", - "python", - "ruby", - "rust", - "terraform", - "zig", - "nix_shell", - "conda", - "memory_usage", - "aws", - "env_var", - "crystal", - "cmd_duration", - "custom", - "line_break", - "jobs", - "battery", - "time", - "character", -] +format = "\n$all" + +# Which is equivalent to +format = """ + +$username\ +$hostname\ +$kubernetes\ +$directory\ +$git_branch\ +$git_commit\ +$git_state\ +$git_status\ +$hg_branch\ +$docker_context\ +$package\ +$cmake\ +$dotnet\ +$elixir\ +$elm\ +$erlang\ +$golang\ +$helm\ +$java\ +$julia\ +$nim\ +$nodejs\ +$ocaml\ +$php\ +$purescript\ +$python\ +$ruby\ +$rust\ +$terraform\ +$zig\ +$nix_shell\ +$conda\ +$memory_usage\ +$aws\ +$env_var\ +$crystal\ +$cmd_duration\ +$custom\ +$line_break\ +$jobs\ +$battery\ +$time\ +$character""" ``` ## AWS @@ -147,41 +220,80 @@ prompt_order = [ ### 選項 -| 變數 | 預設 | 說明 | -| ----------------- | --------------- | ------------------------------------------------------ | -| `symbol` | `"☁️ "` | 顯示在目前 AWS 配置之前的符號。 | -| `displayed_items` | `all` | 選擇預顯示的項目 Possible values: [`all`, `profile`, `region`] | -| `region_aliases` | | 除了AWS名稱外,顯示區域別名表 | -| `style` | `"bold yellow"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `AWS` 模組。 | +| Option | 預設 | 說明 | +| ---------------- | ---------------------------------------------------- | -------------------------- | +| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | The format for the module. | +| `symbol` | `"☁️ "` | 顯示在目前 AWS 配置之前的符號。 | +| `region_aliases` | | 除了AWS名稱外,顯示區域別名表 | +| `style` | `"bold yellow"` | 這個模組的風格。 | +| `disabled` | `false` | 停用 `AWS` 模組。 | -### 範例 +### Variables + +| 變數 | 範例 | 說明 | +| --------- | ---------------- | ------------------------------------ | +| region | `ap-northeast-1` | The current AWS region | +| profile | `astronauts` | The current AWS profile | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Examples + +#### Display everything ```toml # ~/.config/starship.toml [aws] +format = "on [$symbol$profile(\\($region\\))]($style) " style = "bold blue" symbol = "🅰 " -displayed_items = "region" [aws.region_aliases] ap-southeast-2 = "au" us-east-1 = "va" ``` +#### Display region + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$region]($style) " +style = "bold blue" +symbol = "🅰 " +[aws.region_aliases] +ap-southeast-2 = "au" +us-east-1 = "va" +``` + +#### Display profile + +```toml +# ~/.config/starship.toml + +[aws] +format = "on [$symbol$profile]($style) " +style = "bold blue" +symbol = "🅰 " +``` + ## 電池 `battery` 模組顯示電池的電量以及現在的充電狀態。 這個模組只會在裝置的電量低於 10% 的時候看見。 ### 選項 -| 變數 | 預設 | 說明 | -| -------------------- | ---------------------- | ---------------- | -| `full_symbol` | `"•"` | 當電池充飽時顯示的符號。 | -| `charging_symbol` | `"⇡"` | 當電池正在充電時顯示的符號。 | -| `discharging_symbol` | `"⇣"` | 當電池正在放電時顯示的符號。 | -| `display` | [連結](#battery-display) | 顯示的門檻與模組的風格。 | -| `disabled` | `false` | 停用 `battery` 模組。 | +| Option | 預設 | 說明 | +| -------------------- | --------------------------------- | -------------------------- | +| `full_symbol` | `"•"` | 當電池充飽時顯示的符號。 | +| `charging_symbol` | `"⇡"` | 當電池正在充電時顯示的符號。 | +| `discharging_symbol` | `"⇣"` | 當電池正在放電時顯示的符號。 | +| `format` | `"[$symbol$percentage]($style) "` | The format for the module. | +| `display` | [連結](#battery-display) | 顯示的門檻與模組的風格。 | +| `disabled` | `false` | 停用 `battery` 模組。 |
也有些針對不常見的電池狀態設定的選項。 @@ -244,31 +356,85 @@ style = "bold yellow" `character` 模組在你的文字輸入處旁顯示一個字元 (通常是箭頭)。 -這個字元會告訴你最後的指令是成功還是失敗。 他會用兩種方式告訴你:改變他的顏色 (紅色/綠色) 或是改變他的形狀 (❯/✖)。 後者只會在 `use_symbol_for_status` 被設定為 `true` 時出現。 +這個字元會告訴你最後的指令是成功還是失敗。 It can do this in two ways: + +- changing color (`red`/`green`) +- changing shape (`❯`/`✖`) + +By default it only changes color. If you also want to change it's shape take a look at [this example](#with-custom-error-shape). ### 選項 -| 變數 | 預設 | 說明 | -| ----------------------- | -------------- | ----------------------------------------- | -| `symbol` | `"❯"` | 使用在提示字元文字輸入處前的符號。 | -| `error_symbol` | `"✖"` | 如果前一個指令失敗時,使用在文字輸入處前的符號。 | -| `use_symbol_for_status` | `false` | 是否透過改變符號來提示錯誤狀態。 | -| `vicmd_symbol` | `"❮"` | 如果 shell 正在 vim 正常模式內,在提示字元的文字輸入處前的使用的符號。 | -| `style_success` | `"bold green"` | 最後的指令成功時使用的風格。 | -| `style_failure` | `"bold red"` | 最後的指令失敗時使用的風格。 | -| `disabled` | `false` | 停用 `character` 模組。 | +| Option | 預設 | 說明 | +| ---------------- | ------------------- | -------------------------------------------------------------------------------- | +| `format` | `"$symbol "` | The format string used before the text input. | +| `success_symbol` | `"[❯](bold green)"` | The format string used before the text input if the previous command succeeded. | +| `error_symbol` | `"[❯](bold red)"` | The format string used before the text input if the previous command failed. | +| `vicmd_symbol` | `"[❮](bold green)"` | The format string used before the text input if the shell is in vim normal mode. | +| `disabled` | `false` | 停用 `character` 模組。 | -### 範例 +### Variables + +| 變數 | 範例 | 說明 | +| ------ | -- | --------------------------------------------------------------------- | +| symbol | | A mirror of either `success_symbol`, `error_symbol` or `vicmd_symbol` | + +### Examples + +#### With custom error shape ```toml # ~/.config/starship.toml [character] -symbol = "➜" -error_symbol = "✗" -use_symbol_for_status = true +success_symbol = "[➜](bold green) " +error_symbol = "[✗](bold red) " ``` +#### Without custom error shape + +```toml +# ~/.config/starship.toml + +[character] +success_symbol = "[➜](bold green) " +error_symbol = "[➜](bold red) " +``` + +#### With custom vim shape + +```toml +# ~/.config/starship.toml + +[character] +vicmd_symbol = "[V](bold green) " +``` + +## CMake + +The `cmake` module shows the currently installed version of CMake if: + +- The current directory contains a `CMakeLists.txt` file + +### 選項 + +| Option | 預設 | 說明 | +| ---------- | ---------------------------------- | -------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🛆 "` | The symbol used before the version of cmake. | +| `style` | `"bold blue"` | 這個模組的風格。 | +| `disabled` | `false` | Disables the `cmake` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | --------- | ------------------------------------ | +| version | `v3.17.3` | The version of cmake | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + ## 指令持續時間 `cmd_duration` 模組顯示最後一個指令執行所花費的時間。 這個模組只會在指令花費超過兩秒或是有設定 `min_time` 時,超過設定值時出現。 @@ -283,13 +449,22 @@ use_symbol_for_status = true ### 選項 -| 變數 | 預設 | 說明 | -| ------------------- | --------------- | ----------------------------------------------------- | -| `min_time` | `2_000` | Shortest duration to show time for (in milliseconds). | -| `show_milliseconds` | `false` | 顯示時間除了以秒為單位外,亦以毫秒顯示 | -| `prefix` | `took` | 在指令持續時間正前方顯示的前綴。 | -| `style` | `"bold yellow"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `cmd_duration` 模組。 | +| Option | 預設 | 說明 | +| ------------------- | ----------------------------- | ----------------------------------------------------- | +| `min_time` | `2_000` | Shortest duration to show time for (in milliseconds). | +| `show_milliseconds` | `false` | 顯示時間除了以秒為單位外,亦以毫秒顯示 | +| `format` | `"took [$duration]($style) "` | The format for the module. | +| `style` | `"bold yellow"` | 這個模組的風格。 | +| `disabled` | `false` | 停用 `cmd_duration` 模組。 | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | -------- | --------------------------------------- | +| duration | `16m40s` | The time it took to execute the command | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -298,7 +473,7 @@ use_symbol_for_status = true [cmd_duration] min_time = 500 -prefix = "underwent " +format = "underwent [$duration](bold yellow)" ``` ## Conda @@ -313,12 +488,23 @@ This does not suppress conda's own prompt modifier, you may want to run `conda c ### 選項 -| 變數 | 預設 | 說明 | -| ------------------- | -------------- | ----------------------------------------------------------------------------------------------- | -| `truncation_length` | `1` | 如果環境變數由所`conda create -p [path]`產生時,環境變數的資料夾需要截斷的數目。 `0` 表示不截斷 也請參考 [`directory`](#directory)模組 | -| `symbol` | `"C "` | 環境名稱前使用的符號。 | -| `style` | `"bold green"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `conda` 模組。 | +| Option | 預設 | 說明 | +| ------------------- | ---------------------------------- | ----------------------------------------------------------------------------------------------- | +| `truncation_length` | `1` | 如果環境變數由所`conda create -p [path]`產生時,環境變數的資料夾需要截斷的數目。 `0` 表示不截斷 也請參考 [`directory`](#directory)模組 | +| `symbol` | `"🅒 "` | 環境名稱前使用的符號。 | +| `style` | `"bold green"` | 這個模組的風格。 | +| `format` | `"[$symbol$environment]($style) "` | The format for the module. | +| `disabled` | `false` | 停用 `conda` 模組。 | + +### Variables + +| 變數 | 範例 | 說明 | +| ----------- | ------------ | ------------------------------------ | +| environment | `astronauts` | The current conda environment | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -326,7 +512,7 @@ This does not suppress conda's own prompt modifier, you may want to run `conda c # ~/.config/starship.toml [conda] -style = "dimmed green" +format = "[$symbol$environment](dimmed green) " ``` ## Crystal @@ -338,11 +524,22 @@ style = "dimmed green" ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | ------------ | --------------------------------------------------------- | -| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. | -| `style` | `"bold red"` | 這個模組的風格。 | -| `disabled` | `false` | Disables the `crystal` module. | +| Option | 預設 | 說明 | +| ---------- | ---------------------------------- | --------------------------------------------------------- | +| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. | +| `style` | `"bold red"` | 這個模組的風格。 | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `crystal` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | --------- | ------------------------------------ | +| version | `v0.32.1` | The version of `crystal` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -350,8 +547,7 @@ style = "dimmed green" # ~/.config/starship.toml [crystal] -symbol = "✨ " -style = "bold blue" +format = "via [✨ $version](bold blue) " ``` ## 資料夾 @@ -364,18 +560,20 @@ style = "bold blue" ### 選項 -| 變數 | 預設 | 說明 | -| ------------------- | ------------- | --------------------------------------------------- | -| `truncation_length` | `3` | 到達現在資料夾的路徑中,要被裁減掉的資料夾數目。 | -| `truncate_to_repo` | `true` | 是否要裁減到你現在所在的 git 儲存庫的根目錄。 | -| `prefix` | `"in "` | Prefix to display immediately before the directory. | -| `style` | `"bold cyan"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `directory` 模組。 | +| 變數 | 預設 | 說明 | +| ------------------------ | ----------------------------------------------- | ----------------------------------------------------- | +| `truncation_length` | `3` | 到達現在資料夾的路徑中,要被裁減掉的資料夾數目。 | +| `truncate_to_repo` | `true` | 是否要裁減到你現在所在的 git 儲存庫的根目錄。 | +| `format` | `"[$path]($style)[$lock_symbol]($lock_style) "` | The format for the module. | +| `style` | `"bold cyan"` | 這個模組的風格。 | +| `disabled` | `false` | 停用 `directory` 模組。 | +| `read_only_symbol` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_symbol_style` | `"red"` | The style for the read only symbol. |
這個模組有些進階設定選項可以控制顯示資料夾。 -| 變數 | 預設 | 說明 | +| Advanced Option | 預設 | 說明 | | --------------------------- | ------ | ------------------------------------------------ | | `substitutions` | | A table of substitutions to be made to the path. | | `fish_style_pwd_dir_length` | `0` | 當使用 fish shell 的 pwd 路徑邏輯時使用的字元數量。 | @@ -393,6 +591,15 @@ style = "bold blue"
+### Variables + +| 變數 | 範例 | 說明 | +| --------- | --------------------- | ----------------------------------- | +| path | `"D:/Projects"` | The current directory path | +| style\* | `"black bold dimmed"` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + ### 範例 ```toml @@ -408,12 +615,23 @@ The `docker_context` module shows the currently active [Docker context](https:// ### 選項 -| 變數 | 預設 | 說明 | -| ----------------- | ------------- | --------------------------------------------------------------------------------------- | -| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context . | -| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. | -| `style` | `"bold blue"` | 這個模組的風格。 | -| `disabled` | `true` | Disables the `docker_context` module. | +| Option | 預設 | 說明 | +| ----------------- | ---------------------------------- | --------------------------------------------------------------------------------------- | +| `format` | `"via [$symbol$context]($style) "` | The format for the module. | +| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context. | +| `style` | `"blue bold"` | 這個模組的風格。 | +| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. | +| `disabled` | `true` | Disables the `docker_context` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | -------------- | ------------------------------------ | +| context | `test_context` | The current docker context | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -421,25 +639,51 @@ The `docker_context` module shows the currently active [Docker context](https:// # ~/.config/starship.toml [docker_context] -symbol = "🐋 " +format = "via [🐋 $context](blue bold)" ``` ## Dotnet `dotnet` 模組顯示現在資料夾使用的 .NET Core SDK 的版本。 如果這個資料夾已經選定一個 SDK,則顯示這個 SDK 的版本。 如果沒有的話,則顯示最新安裝的 SDK 版本。 -這個模組只會在下列檔案出現在你的現在資料夾中時,顯示在你的提示字元:`global.json`、`project.json`、`*.sln`、`*.csproj`、`*.fsproj`、`*.xproj`。 你也會需要安裝 .NET Core 文字命令工具來正確使用這個模組。 +This module will only be shown in your prompt when one or more of the following files are present in the current directory: + +- `global.json` +- `project.json` +- `Directory.Build.props` +- `Directory.Build.targets` +- `Packages.props` +- `*.sln` +- `*.csproj` +- `*.fsproj` +- `*.xproj` + +You'll also need the .NET Core SDK installed in order to use it correctly. 這個模組內部是使用它自己的機制來偵測版本。 一般來說這個模組有 `dotnet --version` 的兩倍快,但是它可能會在你的 .NET 專案有不尋常的資料夾結構時顯示不正確的版本。 如果精確度比速度更重要的話,你可以藉由設定模組中的 `heuristic = false` 選項來停用這個功能。 +The module will also show the Target Framework Moniker () when there is a csproj file in the current directory. + ### 選項 -| 變數 | 預設 | 說明 | -| ----------- | ------------- | ---------------------------- | -| `symbol` | `"•NET "` | 在顯示 dotnet 版本之前用的符號。 | -| `heuristic` | `true` | 使用更快速的版本偵測法來保持 starship 的速度。 | -| `style` | `"bold blue"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `dotnet` 模組。 | +| Option | 預設 | 說明 | +| ----------- | ---------------------------------------- | ---------------------------- | +| `format` | `"v[$symbol$version( 🎯 $tfm)]($style) "` | The format for the module. | +| `symbol` | `"•NET "` | 在顯示 dotnet 版本之前用的符號。 | +| `heuristic` | `true` | 使用更快速的版本偵測法來保持 starship 的速度。 | +| `style` | `"bold blue"` | 這個模組的風格。 | +| `disabled` | `false` | 停用 `dotnet` 模組。 | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | ---------------- | ------------------------------------------------------------------ | +| version | `v3.1.201` | The version of `dotnet` sdk | +| tfm | `netstandard2.0` | The Target Framework Moniker that the current project is targeting | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -460,11 +704,23 @@ 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"` | 這個模組的風格。 | -| `disabled` | `false` | Disables the `elixir` module. | +| 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. | +| `disabled` | `false` | Disables the `elixir` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| ----------- | ------- | ------------------------------------ | +| version | `v1.10` | The version of `elixir` | +| otp_version | | The otp version of `elixir` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -487,12 +743,22 @@ The `elm` module shows the currently installed version of Elm. 這個模組在 ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | ------------- | ----------------------------------------------------- | -| `symbol` | `"🌳 "` | The symbol used before displaying the version of Elm. | -| `style` | `"bold cyan"` | 這個模組的風格。 | -| `disabled` | `false` | Disables the `elm` module. | +| Option | 預設 | 說明 | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🌳 "` | A format string representing the symbol of Elm. | +| `style` | `"cyan bold"` | 這個模組的風格。 | +| `disabled` | `false` | Disables the `elm` module. | +### Variables + +| 變數 | 範例 | 說明 | +| --------- | --------- | ------------------------------------ | +| version | `v0.19.1` | The version of `elm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -500,7 +766,7 @@ The `elm` module shows the currently installed version of Elm. 這個模組在 # ~/.config/starship.toml [elm] -symbol = " " +format = "via [ $version](cyan bold) " ``` ## 環境變數 @@ -512,15 +778,23 @@ symbol = " " ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | --------------------- | -------------------- | -| `symbol` | | 顯示在變數數值之前的符號。 | -| `variable` | | 要顯示的環境變數。 | -| `default` | | 在選擇的變數值沒有定義時,顯示的預設值。 | -| `prefix` | `""` | 在變數值正前方顯示的前綴。 | -| `suffix` | `""` | 在變數值正後方顯示的後綴。 | -| `style` | `"dimmed bold black"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `env_var` 模組。 | +| Option | 預設 | 說明 | +| ---------- | ------------------------------ | -------------------------- | +| `symbol` | | 顯示在變數數值之前的符號。 | +| `variable` | | 要顯示的環境變數。 | +| `default` | | 在選擇的變數值沒有定義時,顯示的預設值。 | +| `format` | `"with [$env_value]($style) "` | The format for the module. | +| `disabled` | `false` | 停用 `env_var` 模組。 | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | ------------------------------------------- | ------------------------------------------ | +| env_value | `Windows NT` (if *variable* would be `$OS`) | The environment value of option `variable` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | `black bold dimmed` | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -541,11 +815,22 @@ The `erlang` module shows the currently installed version of Erlang/OTP. 這個 ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | ---------- | -------------------------------------------------------- | -| `symbol` | `"🖧 "` | The symbol used before displaying the version of Erlang. | -| `style` | `bold red` | The style for this module. | -| `disabled` | `false` | Disables the `erlang` module. | +| Option | 預設 | 說明 | +| ---------- | ---------------------------------- | -------------------------------------------------------- | +| `symbol` | `"🖧 "` | The symbol used before displaying the version of erlang. | +| `style` | `"bold red"` | 這個模組的風格。 | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `erlang` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | --------- | ------------------------------------ | +| version | `v22.1.3` | The version of `erlang` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -553,7 +838,7 @@ The `erlang` module shows the currently installed version of Erlang/OTP. 這個 # ~/.config/starship.toml [erlang] -symbol = "e " +format = "via [e $version](bold red) " ``` ## Git 分支 @@ -562,13 +847,24 @@ symbol = "e " ### 選項 -| 變數 | 預設 | 說明 | -| ------------------- | --------------- | -------------------------------- | -| `symbol` | `" "` | 在你現在資料夾之中的儲存庫的分支名稱前使用的符號。 | -| `truncation_length` | `2^63 - 1` | 裁減一個 git 分支到 X 字素 (grapheme)。 | -| `truncation_symbol` | `"…"` | 用來指示分支名稱被縮減的符號。 你可以用 "" 來表示不要顯示。 | -| `style` | `"bold purple"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `git_branch` 模組。 | +| Option | 預設 | 說明 | +| ------------------- | -------------------------------- | -------------------------------------------------------------------------------- | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. Use `"$branch"` to refer to the current branch name. | +| `symbol` | `" "` | A format string representing the symbol of git branch. | +| `style` | `"bold purple"` | 這個模組的風格。 | +| `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes. | +| `truncation_symbol` | `"…"` | 用來指示分支名稱被縮減的符號。 You can use `""` for no symbol. | +| `disabled` | `false` | 停用 `git_branch` 模組。 | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| branch | `master` | The current branch name, falls back to `HEAD` if there's no current branch (e.g. git detached HEAD). | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -587,14 +883,22 @@ The `git_commit` module shows the current commit hash of the repo in your curren ### 選項 -| 變數 | 預設 | 說明 | -| -------------------- | -------------- | ----------------------------------------------------- | -| `commit_hash_length` | `7` | The length of the displayed git commit hash. | -| `prefix` | `"("` | Prefix to display immediately before git commit. | -| `suffix` | `")"` | Suffix to display immediately after git commit. | -| `style` | `"bold green"` | 這個模組的風格。 | -| `only_detached` | `true` | Only show git commit hash when in detached HEAD state | -| `disabled` | `false` | Disables the `git_commit` module. | +| Option | 預設 | 說明 | +| -------------------- | ------------------------------ | ----------------------------------------------------- | +| `commit_hash_length` | `7` | The length of the displayed git commit hash. | +| `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. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | --------- | ----------------------------------- | +| hash | `b703eb3` | The current git commit hash | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -611,18 +915,29 @@ commit_hash_length = 4 ### 選項 -| 變數 | 預設 | 說明 | -| ------------------ | ------------------ | -------------------------------------------------- | -| `rebase` | `"REBASING"` | `rebase` 進行中顯示的文字。 | -| `merge` | `"MERGING"` | `merge` 進行中顯示的文字。 | -| `revert` | `"REVERTING"` | `revert` 進行中顯示的文字。 | -| `cherry_pick` | `"CHERRY-PICKING"` | `cherry-pick` 進行中顯示的文字。 | -| `bisect` | `"BISECTING"` | `bisect` 進行中顯示的文字。 | -| `am` | `"AM"` | `apply-mailbox` (`git am`) 進行中顯示的文字。 | -| `am_or_rebase` | `"AM/REBASE"` | 當不容易分辨是 `apply-mailbox` 或 `rebase` 正在進行中時顯示的文字。 | -| `progress_divider` | `"/"` | 用來分開現在與總共進度量的符號。 (例如:`" of "` 會得到 `"3 of 10"` 的效果) | -| `style` | `"bold yellow"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `git_state` 模組。 | +| 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. | +| `cherry_pick` | `"CHERRY-PICKING"` | A format string displayed when a `cherry-pick` is in progress. | +| `bisect` | `"BISECTING"` | A format string displayed when a `bisect` is in progress. | +| `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. | +| `disabled` | `false` | 停用 `git_state` 模組。 | + +### Variables + +| 變數 | 範例 | 說明 | +| ---------------- | ---------- | ----------------------------------- | +| state | `REBASING` | The current state of the repo | +| progress_current | `1` | The current operation progress | +| progress_total | `2` | The total operation progress | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -630,8 +945,8 @@ commit_hash_length = 4 # ~/.config/starship.toml [git_state] -progress_divider = " of " -cherry_pick = "🍒 PICKING" +format = "[\\($state( $progress_current of $progress_total)\\)]($style) " +cherry_pick = "[🍒 PICKING](bold red)" ``` ## Git Status @@ -640,37 +955,54 @@ cherry_pick = "🍒 PICKING" ### 選項 -| 變數 | 預設 | 說明 | -| ------------------ | ------------------------ | ------------------------------------------------ | -| `conflicted` | `"="` | 這個分支有合併衝突。 | -| `conflicted_count` | [連結](#git-status-counts) | Show and style the number of conflicts. | -| `ahead` | `"⇡"` | 這個分支超前正在追蹤的分支。 | -| `behind` | `"⇣"` | 這個分支落後正在追蹤的分支。 | -| `diverged` | `"⇕"` | 這個分支偏離正在追蹤的分支。 | -| `untracked` | `"?"` | 工作資料夾中有沒有追蹤的檔案。 | -| `untracked_count` | [連結](#git-status-counts) | Show and style the number of untracked files. | -| `stashed` | `"$"` | 本地儲存庫有 stash。 | -| `stashed_count` | [連結](#git-status-counts) | Show and style the number of stashes. | -| `modified` | `"!"` | 工作資料夾中有修改過的檔案。 | -| `modified_count` | [連結](#git-status-counts) | Show and style the number of modified files. | -| `staged` | `"+"` | 一個新檔案被加入了暫存區 (staging area)。 | -| `staged_count` | [連結](#git-status-counts) | Show and style the number of files staged files. | -| `renamed` | `"»"` | 一個被改名的檔案被加入了暫存區 (staging area)。 | -| `renamed_count` | [連結](#git-status-counts) | Show and style the number of renamed files. | -| `deleted` | `"✘"` | 一個刪除檔案的動作被加入了暫存區 (staging area)。 | -| `deleted_count` | [連結](#git-status-counts) | Show and style the number of deleted files. | -| `show_sync_count` | `false` | 顯示超前/落後追蹤的分支的數量。 | -| `prefix` | `[` | 在 git 狀態正前方顯示的前綴。 | -| `suffix` | `]` | 在 git 狀態正後方顯示的後綴。 | -| `style` | `"bold red"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `git_status` 模組。 | +| Option | 預設 | 說明 | +| ----------------- | ----------------------------------------------- | ----------------------------------- | +| `format` | "([\[$all_status$ahead_behind\]]($style) )" | The default format for `git_status` | +| `conflicted` | `"="` | 這個分支有合併衝突。 | +| `ahead` | `"⇡"` | The format of `ahead` | +| `behind` | `"⇣"` | The format of `behind` | +| `diverged` | `"⇕"` | The format of `diverged` | +| `untracked` | `"?"` | The format of `untracked` | +| `stashed` | `"$"` | The format of `stashed` | +| `modified` | `"!"` | The format of `modified` | +| `staged` | `"+"` | The format of `staged` | +| `renamed` | `"»"` | The format of `renamed` | +| `deleted` | `"✘"` | The format of `deleted` | +| `show_sync_count` | `false` | 顯示超前/落後追蹤的分支的數量。 | +| `style` | `"bold red"` | 這個模組的風格。 | +| `disabled` | `false` | 停用 `git_status` 模組。 | -#### Git Status Counts +### Variables -| 變數 | 預設 | 說明 | -| --------- | ------- | ------------------------------------------------------ | -| `enabled` | `false` | Show the number of files | -| `style` | | Optionally style the count differently than the module | +The following variables can be used in `format`: + +| 變數 | 說明 | +| -------------- | --------------------------------------------------------------------------------------------- | +| `all_status` | Shortcut for`$conflicted$stashed$deleted$renamed$modified$staged$untracked` | +| `ahead_behind` | Displays `diverged` `ahead` or `behind` format string based on the current status of the repo | +| `conflicted` | Displays `conflicted` when this branch has merge conflicts. | +| `untracked` | Displays `untracked` when there are untracked files in the working directory. | +| `stashed` | Displays `stashed` when a stash exists for the local repository. | +| `modified` | Displays `modified` when there are file modifications in the working directory. | +| `staged` | Displays `staged` when a new file has been added to the staging area. | +| `renamed` | Displays `renamed` when a renamed file has been added to the staging area. | +| `deleted` | Displays `deleted` when a file's deletion has been added to the staging area. | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +The following variables can be used in `diverged`: + +| 變數 | 說明 | +| -------------- | ---------------------------------------------- | +| `ahead_count` | Number of commits ahead of the tracking branch | +| `behind_count` | Number of commits behind the tracking branch | + +The following variables can be used in `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` and `deleted`: + +| 變數 | 說明 | +| ------- | ------------------------ | +| `count` | Show the number of files | ### 範例 @@ -685,10 +1017,7 @@ diverged = "😵" untracked = "🤷‍" stashed = "📦" modified = "📝" -staged.value = "++" -staged.style = "green" -staged_count.enabled = true -staged_count.style = "green" +staged = '[++\($count\)](green)' renamed = "👅" deleted = "🗑" ``` @@ -708,11 +1037,22 @@ deleted = "🗑" ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | ------------- | ------------------- | -| `symbol` | `"🐹 "` | 顯示在 Golang 版本之前的符號。 | -| `style` | `"bold cyan"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `golang` 模組。 | +| Option | 預設 | 說明 | +| ---------- | ---------------------------------- | ---------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐹 "` | A format string representing the symbol of Go. | +| `style` | `"bold cyan"` | 這個模組的風格。 | +| `disabled` | `false` | 停用 `golang` 模組。 | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | --------- | ------------------------------------ | +| version | `v1.12.1` | The version of `go` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -720,30 +1060,42 @@ deleted = "🗑" # ~/.config/starship.toml [golang] -symbol = "🏎💨 " +format = "via [🏎💨 $version](bold cyan) " ``` -## Haskell -The `haskell` module shows the currently installed version of Haskell Stack version. 這個模組在下列其中一個條件達成時顯示: +## Helm -- 現在資料夾中含有一個 `stack.yaml` 檔案 +The `helm` module shows the currently installed version of Helm. 這個模組在下列其中一個條件達成時顯示: + +- 現在資料夾中包含一個 `helmfile.yaml` 檔案 +- The current directory contains a `Chart.yaml` file ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | ------------ | --------------------------------------------------------- | -| `symbol` | `"λ "` | The symbol used before displaying the version of Haskell. | -| `style` | `"bold red"` | 這個模組的風格。 | -| `disabled` | `false` | Disables the `haskell` module. | +| Option | 預設 | 說明 | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⎈ "` | A format string representing the symbol of Helm. | +| `style` | `"bold white"` | 這個模組的風格。 | +| `disabled` | `false` | Disables the `helm` module. | +### Variables + +| 變數 | 範例 | 說明 | +| --------- | -------- | ------------------------------------ | +| version | `v3.1.1` | The version of `helm` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 ```toml # ~/.config/starship.toml -[haskell] -symbol = " " +[helm] +format = "via [⎈ $version](bold white) " ``` ## 主機名稱 @@ -752,14 +1104,23 @@ symbol = " " ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | --------------------- | ---------------------------------------------------------- | -| `ssh_only` | `true` | 只在連接到一個 SSH session 時顯示主機名稱。 | -| `prefix` | `""` | 在主機名稱正前方顯示的前綴。 | -| `suffix` | `""` | 在主機名稱正後方顯示的後綴。 | -| `trim_at` | `"."` | 擷取出主機名稱的斷點,以第一個符合的為準。 `"."` 會讓它停在第一個點的符號。 `""` 會停用任何的截斷功能。 | -| `style` | `"bold dimmed green"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `hostname` 模組。 | +| Option | 預設 | 說明 | +| ---------- | --------------------------- | ---------------------------------------------------------- | +| `ssh_only` | `true` | 只在連接到一個 SSH session 時顯示主機名稱。 | +| `trim_at` | `"."` | 擷取出主機名稱的斷點,以第一個符合的為準。 `"."` 會讓它停在第一個點的符號。 `""` 會停用任何的截斷功能。 | +| `format` | `"on [$hostname]($style) "` | The format for the module. | +| `style` | `"bold dimmed green"` | 這個模組的風格。 | +| `disabled` | `false` | 停用 `hostname` 模組。 | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | --- | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -768,8 +1129,7 @@ symbol = " " [hostname] ssh_only = false -prefix = "⟪" -suffix = "⟫" +format = "on [$hostname](bold red) " trim_at = ".companyname.com" disabled = false ``` @@ -783,11 +1143,22 @@ disabled = false ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | -------------- | ----------------- | -| `symbol` | `"☕ "` | 顯示在 Java 版本之前的符號。 | -| `style` | `"dimmed red"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `java` 模組。 | +| Option | 預設 | 說明 | +| ---------- | -------------------------------------- | ----------------------------------------------- | +| `format` | `"via [${symbol}${version}]($style) "` | The format for the module. | +| `symbol` | `"☕ "` | A format string representing the symbol of Java | +| `style` | `"red dimmed"` | 這個模組的風格。 | +| `disabled` | `false` | 停用 `java` 模組。 | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | ----- | ------------------------------------ | +| version | `v14` | The version of `java` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -804,12 +1175,23 @@ symbol = "🌟 " ### 選項 -| 變數 | 預設 | 說明 | -| ----------- | ------------- | -------------- | -| `symbol` | `"✦"` | 在顯示工作數量之前用的符號。 | -| `threshold` | `1` | 在超過指定值時顯示工作數量。 | -| `style` | `"bold blue"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `jobs` 模組。 | +| Option | 預設 | 說明 | +| ----------- | ----------------------------- | ------------------------------------------------ | +| `threshold` | `1` | 在超過指定值時顯示工作數量。 | +| `format` | `"[$symbol$number]($style) "` | The format for the module. | +| `symbol` | `"✦"` | A format string representing the number of jobs. | +| `style` | `"bold blue"` | 這個模組的風格。 | +| `disabled` | `false` | 停用 `jobs` 模組。 | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | --- | ------------------------------------ | +| number | `1` | The number of jobs | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -831,11 +1213,22 @@ The `julia` module shows the currently installed version of Julia. 這個模組 ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | --------------- | ------------------------------------------------------- | -| `symbol` | `"ஃ "` | The symbol used before displaying the version of Julia. | -| `style` | `"bold purple"` | 這個模組的風格。 | -| `disabled` | `false` | Disables the `julia` module. | +| Option | 預設 | 說明 | +| ---------- | ---------------------------------- | ------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"ஃ "` | A format string representing the symbol of Julia. | +| `style` | `"bold purple"` | 這個模組的風格。 | +| `disabled` | `false` | Disables the `julia` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | -------- | ------------------------------------ | +| version | `v1.4.0` | The version of `julia` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -845,9 +1238,10 @@ The `julia` module shows the currently installed version of Julia. 這個模組 [julia] symbol = "∴ " ``` + ## Kubernetes -顯示現在 Kubernetes 主體名稱以及從 kubeconfig 檔案來的名稱空間 (如果有設定的話)。 The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. 如果有設定 `$KUBECONFIG` 環境變數,這個模組就會使用設定值;如果沒有,它就會使用 `~/.kube/config`。 +Displays the current Kubernetes context name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via `kubectl config set-context starship-cluster --namespace astronaut`. If the `$KUBECONFIG` env var is set the module will use that if not it will use the `~/.kube/config`. ::: tip @@ -857,12 +1251,25 @@ symbol = "∴ " ### 選項 -| 變數 | 預設 | 說明 | -| ----------------- | ------------- | ----------------------------------- | -| `symbol` | `"☸ "` | 顯示在叢集 (cluster) 資訊之前的符號。 | -| `context_aliases` | | Table of context aliases to display | -| `style` | `"bold blue"` | 這個模組的風格。 | -| `disabled` | `true` | 停用 `kubernetes` 模組。 | +| Option | 預設 | 說明 | +| ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- | +| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. | +| `format` | `"on [$symbol$context( \\($namespace\\))]($style) "` | 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. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | -------------------- | ---------------------------------------- | +| context | `starship-cluster` | The current kubernetes context | +| namespace | `starship-namespace` | If set, the current kubernetes namespace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -870,8 +1277,7 @@ symbol = "∴ " # ~/.config/starship.toml [kubernetes] -symbol = "⛵ " -style = "dimmed green" +format = "on [⛵ $context \\($namespace\\)](dimmed green) " disabled = false [kubernetes.context_aliases] "dev.local.cluster.k8s" = "dev" @@ -883,7 +1289,7 @@ disabled = false ### 選項 -| 變數 | 預設 | 說明 | +| Option | 預設 | 說明 | | ---------- | ------- | ----------------------------- | | `disabled` | `false` | 停用 `line_break` 模組,讓提示字元變成一行。 | @@ -910,15 +1316,26 @@ disabled = true ### 選項 -| 變數 | 預設 | 說明 | -| ----------------- | --------------------- | ------------------------------------------------------------- | -| `show_percentage` | `false` | 以剩餘記憶體佔有的百分比的方式顯示記憶體使用狀況。 | -| `show_swap` | `true` | 如果總 swap 使用量不為零的話,顯示 swap 使用量 | -| `threshold` | `75` | 將記憶體使用量隱藏,除非使用量超過指定值。 | -| `symbol` | `"🐏 "` | 顯示在記憶體使用量之前的符號。 | -| `separator` | `" | "` | The symbol or text that will seperate the ram and swap usage. | -| `style` | `"bold dimmed white"` | 這個模組的風格。 | -| `disabled` | `true` | 停用 `memory_usage` 模組。 | +| Option | 預設 | 說明 | +| ----------- | --------------------------------------------- | -------------------------- | +| `threshold` | `75` | 將記憶體使用量隱藏,除非使用量超過指定值。 | +| `format` | `"via $symbol [${ram}( | ${swap})]($style) "` | The format for the module. | +| `symbol` | `"🐏"` | 顯示在記憶體使用量之前的符號。 | +| `style` | `"bold dimmed white"` | 這個模組的風格。 | +| `disabled` | `true` | 停用 `memory_usage` 模組。 | + +### Variables + +| 變數 | 範例 | 說明 | +| ------------- | ------------- | ------------------------------------------------------------------ | +| ram | `31GiB/65GiB` | The usage/total RAM of the current system memory. | +| ram_pct | `48%` | The percentage of the current system memory. | +| swap\** | `1GiB/4GiB` | The swap memory size of the current system swap memory file. | +| swap_pct\** | `77%` | The swap memory percentage of the current system swap memory file. | +| symbol | `🐏` | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string \*\*: The SWAP file information is only displayed if detected on the current system ### 範例 @@ -941,13 +1358,24 @@ The `hg_branch` module shows the active branch of the repo in your current direc ### 選項 -| 變數 | 預設 | 說明 | -| ------------------- | --------------- | -------------------------------------------------------------------------------------------- | -| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. | -| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes | -| `truncation_symbol` | `"…"` | 用來指示分支名稱被縮減的符號。 | -| `style` | `"bold purple"` | 這個模組的風格。 | -| `disabled` | `true` | Disables the `hg_branch` module. | +| Option | 預設 | 說明 | +| ------------------- | -------------------------------- | -------------------------------------------------------------------------------------------- | +| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. | +| `style` | `"bold purple"` | 這個模組的風格。 | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. | +| `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes | +| `truncation_symbol` | `"…"` | 用來指示分支名稱被縮減的符號。 | +| `disabled` | `true` | Disables the `hg_branch` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | -------- | ------------------------------------ | +| branch | `master` | The active mercurial branch | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -955,7 +1383,7 @@ The `hg_branch` module shows the active branch of the repo in your current direc # ~/.config/starship.toml [hg_branch] -symbol = "🌱 " +format = "on [🌱 $branch](bold purple)" truncation_length = 4 truncation_symbol = "" ``` @@ -963,18 +1391,30 @@ truncation_symbol = "" ## Nim The `nim` module shows the currently installed version of Nim. 這個模組在下列其中一個條件達成時顯示: -- The current directory contains a `nim.cfg` file + +- 現在資料夾中包含一個 `nim.cfg` 檔案 - The current directory contains a file with the `.nim` extension - The current directory contains a file with the `.nims` extension - The current directory contains a file with the `.nimble` extension ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | -| `style` | `"bold yellow"` | 這個模組的風格。 | -| `disabled` | `false` | Disables the `nim` module. | +| Option | 預設 | 說明 | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module | +| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | +| `style` | `"bold yellow"` | 這個模組的風格。 | +| `disabled` | `false` | Disables the `nim` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | -------- | ------------------------------------ | +| version | `v1.2.0` | The version of `nimc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -992,14 +1432,25 @@ symbol = "🎣 " ### 選項 -| 變數 | 預設 | 說明 | -| ------------ | ------------- | ------------------------------------------------- | -| `use_name` | `false` | 顯示 nix-shell 的名稱。 | -| `impure_msg` | `"impure"` | 自定義「impure」訊息。 | -| `pure_msg` | `"pure"` | 自定義「pure」訊息。 | -| `symbol` | `"❄️ "` | The symbol used before displaying the shell name. | -| `style` | `"bold blue"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `nix_shell` 模組。 | +| Option | 預設 | 說明 | +| ------------ | -------------------------------------------------- | ----------------------------------------------------- | +| `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. | +| `pure_msg` | `"pure"` | A format string shown when the shell is pure. | +| `disabled` | `false` | 停用 `nix_shell` 模組。 | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | ------- | ------------------------------------ | +| state | `pure` | The state of the nix-shell | +| name | `lorri` | The name of the nix-shell | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -1008,10 +1459,9 @@ symbol = "🎣 " [nix_shell] disabled = true -use_name = true -impure_msg = "impure shell" -pure_msg = "pure shell" -symbol = "☃️ " +impure_msg = "[impure shell](bold red)" +pure_msg = "[pure shell](bold green)" +format = "via [☃️ $state( \\($name\\))](bold blue) " ``` ## NodeJS @@ -1021,15 +1471,27 @@ symbol = "☃️ " - 現在資料夾中包含一個 `package.json` 檔案 - The current directory contains a `.node-version` file - 現在資料夾中包含一個 `node_modules` 資料夾 -- 現在資料夾中包含一個檔案具有 `.js` 副檔名 +- The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension +- The current directory contains a file with the `.ts` extension ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | -------------- | -------------------- | -| `symbol` | `"⬢ "` | 在顯示 NodeJS 版本之前用的符號。 | -| `style` | `"bold green"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `nodejs` 模組。 | +| Option | 預設 | 說明 | +| ---------- | ---------------------------------- | -------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"⬢ "` | A format string representing the symbol of NodeJS. | +| `style` | `"bold green"` | 這個模組的風格。 | +| `disabled` | `false` | 停用 `nodejs` 模組。 | + +###  Variables + +| 變數 | 範例 | 說明 | +| --------- | ---------- | ------------------------------------ | +| version | `v13.12.0` | The version of `node` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -1037,7 +1499,7 @@ symbol = "☃️ " # ~/.config/starship.toml [nodejs] -symbol = "🤖 " +format = "via [🤖 $version](bold green) " ``` ## 套件版本 @@ -1056,12 +1518,23 @@ The `package` 模組在現在資料夾是一個套件的儲藏庫時出現,並 ### 選項 -| 變數 | 預設 | 說明 | -| ----------------- | ------------ | --------------------------------------------------------- | -| `symbol` | `"📦 "` | 顯示在套件的版本之前的符號。 | -| `style` | `"bold 208"` | 這個模組的風格。 | -| `display_private` | `false` | Enable displaying version for packages marked as private. | -| `disabled` | `false` | 停用 `package` 模組。 | +| Option | 預設 | 說明 | +| ----------------- | ---------------------------------- | --------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"📦 "` | 顯示在套件的版本之前的符號。 | +| `style` | `"bold 208"` | 這個模組的風格。 | +| `display_private` | `false` | Enable displaying version for packages marked as private. | +| `disabled` | `false` | 停用 `package` 模組。 | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | -------- | ------------------------------------ | +| version | `v1.0.0` | The version of your package | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -1069,7 +1542,7 @@ The `package` 模組在現在資料夾是一個套件的儲藏庫時出現,並 # ~/.config/starship.toml [package] -symbol = "🎁 " +format = "via [🎁 $version](208 bold) " ``` ## OCaml @@ -1085,11 +1558,22 @@ The `ocaml` module shows the currently installed version of OCaml. 這個模組 ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | --------------- | ------------------------------------------------------- | -| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | -| `style` | `"bold yellow"` | 這個模組的風格。 | -| `disabled` | `false` | Disables the `ocaml` module. | +| Option | 預設 | 說明 | +| ---------- | ---------------------------------- | ------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format string for the module. | +| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | +| `style` | `"bold yellow"` | 這個模組的風格。 | +| `disabled` | `false` | Disables the `ocaml` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | --------- | ------------------------------------ | +| version | `v4.10.0` | The version of `ocaml` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -1097,24 +1581,35 @@ The `ocaml` module shows the currently installed version of OCaml. 這個模組 # ~/.config/starship.toml [ocaml] -symbol = "🐪 " +format = "via [🐪 $version]($style) " ``` ## PHP The `php` module shows the currently installed version of PHP. 這個模組在下列其中一個條件達成時顯示: -- The current directory contains a `composer.json` file +- 現在資料夾中包含一個 `composer.json` 檔案 - The current directory contains a `.php-version` file - The current directory contains a `.php` file ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | ------------ | ----------------------------------------------------- | -| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. | -| `style` | `"bold 147"` | 這個模組的風格。 | -| `disabled` | `false` | Disables the `php` module. | +| Option | 預設 | 說明 | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. | +| `style` | `"147 bold"` | 這個模組的風格。 | +| `disabled` | `false` | Disables the `php` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | -------- | ------------------------------------ | +| version | `v7.3.8` | The version of `php` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -1122,7 +1617,7 @@ The `php` module shows the currently installed version of PHP. 這個模組在 # ~/.config/starship.toml [php] -symbol = "🔹 " +format = "via [🔹 $version](147 bold) " ``` ## Python @@ -1145,14 +1640,23 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name ### 選項 -| 變數 | 預設 | 說明 | -| -------------------- | --------------- | -------------------------------------------------------------------------- | -| `symbol` | `"🐍 "` | 顯示在 Python 版本之前的符號。 | -| `pyenv_version_name` | `false` | 使用 pyenv 取得 Python 的版本。 | -| `pyenv_prefix` | `"pyenv "` | 顯示在 pyenv 版本之前的前綴 (預設顯示是 `pyenv MY_VERSION`)。 | -| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | -| `style` | `"bold yellow"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `python` 模組。 | +| Option | 預設 | 說明 | +| -------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${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 的版本。 | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `disabled` | `false` | 停用 `python` 模組。 | + +### Variables + +| 變數 | 範例 | 說明 | +| ---------- | --------------- | ------------------------------------ | +| version | `"v3.8.1"` | The version of `python` | +| symbol | `"🐍 "` | Mirrors the value of option `symbol` | +| style | `"yellow bold"` | Mirrors the value of option `style` | +| virtualenv | `"venv"` | The current `virtualenv` name |
This module has some advanced configuration options. @@ -1193,11 +1697,22 @@ pyenv_prefix = "foo " ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | ------------ | ----------------- | -| `symbol` | `"💎 "` | 顯示在 Ruby 版本之前的符號。 | -| `style` | `"bold red"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `ruby` 模組。 | +| Option | 預設 | 說明 | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"💎 "` | A format string representing the symbol of Ruby. | +| `style` | `"bold red"` | 這個模組的風格。 | +| `disabled` | `false` | 停用 `ruby` 模組。 | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | -------- | ------------------------------------ | +| version | `v2.5.1` | The version of `ruby` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -1217,11 +1732,22 @@ symbol = "🔺 " ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | ------------ | ----------------- | -| `symbol` | `"🦀 "` | 顯示在 Rust 版本之前的符號。 | -| `style` | `"bold red"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `rust` 模組。 | +| Option | 預設 | 說明 | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🦀 "` | A format string representing the symbol of Rust | +| `style` | `"bold red"` | 這個模組的風格。 | +| `disabled` | `false` | 停用 `rust` 模組。 | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | ----------------- | ------------------------------------ | +| version | `v1.43.0-nightly` | The version of `rustc` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -1229,7 +1755,7 @@ symbol = "🔺 " # ~/.config/starship.toml [rust] -symbol = "⚙️ " +format = "via [⚙️ $version](red bold)" ``` ## Singularity @@ -1238,14 +1764,22 @@ The `singularity` module shows the current singularity image, if inside a contai ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | -------------------- | ------------------------------------------------ | -| `label` | `""` | Prefix before the image name display. | -| `prefix` | `"["` | Prefix to display immediately before image name. | -| `suffix` | `"]"` | Suffix to display immediately after image name. | -| `symbol` | `""` | The symbol used before the image name. | -| `style` | `"bold dimmed blue"` | 這個模組的風格。 | -| `disabled` | `false` | Disables the `singularity` module. | +| Option | 預設 | 說明 | +| ---------- | ------------------------------------ | ------------------------------------------------ | +| `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. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | ------------ | ------------------------------------ | +| env | `centos.img` | The current singularity image | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -1253,32 +1787,54 @@ The `singularity` module shows the current singularity image, if inside a contai # ~/.config/starship.toml [singularity] -symbol = "📦 " +format = "[📦 \\[$env\\]]($style) " ``` ## Terraform -The `terraform` module shows the currently selected terraform workspace and version. By default the terraform version is not shown, since this is slow on current versions of terraform when a lot of plugins are in use. 這個模組在下列其中一個條件達成時顯示: +The `terraform` module shows the currently selected terraform workspace and version. By default the terraform version is not shown, since this is slow on current versions of terraform when a lot of plugins are in use. If you still want to enable it, [follow the example shown below](#with-version). 這個模組在下列其中一個條件達成時顯示: - The current directory contains a `.terraform` folder - Current directory contains a file with the `.tf` extension ### 選項 -| 變數 | 預設 | 說明 | -| -------------- | ------------ | ----------------------------------------------------------- | -| `symbol` | `"💠 "` | The symbol used before displaying the terraform workspace. | -| `show_version` | `false` | Shows the terraform version. Very slow on large workspaces. | -| `style` | `"bold 105"` | 這個模組的風格。 | -| `disabled` | `false` | Disables the `terraform` module. | +| Option | 預設 | 說明 | +| ---------- | ------------------------------------ | ----------------------------------------------------- | +| `format` | `"via [$symbol$workspace]($style) "` | The format string for the module. | +| `symbol` | `"💠 "` | A format string shown before the terraform workspace. | +| `style` | `"bold 105"` | 這個模組的風格。 | +| `disabled` | `false` | Disables the `terraform` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | ---------- | ------------------------------------ | +| version | `v0.12.24` | The version of `terraform` | +| workspace | `default` | The current terraform workspace | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 +#### With Version + ```toml # ~/.config/starship.toml [terraform] -symbol = "🏎💨 " +format = "[🏎💨 $version$workspace]($style) " +``` + +#### Without version + +```toml +# ~/.config/starship.toml + +[terraform] +format = "[🏎💨 $workspace]($style) " ``` ## 時間 @@ -1293,16 +1849,26 @@ symbol = "🏎💨 " ### 選項 -| 變數 | 預設 | 說明 | -| ----------------- | --------------- | ----------------------------------------------------------------------------------------------------- | -| `use_12hr` | `false` | Enables 12 hour formatting. | -| `format` | 請看下列 | 用來顯示時間的 [chrono 格式字串](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html)。 | -| `style` | `"bold yellow"` | The style for the module time. | -| `utc_time_offset` | `"local"` | 設定相對於 UTC 的時差。 範圍 -24 < x < 24。 允許使用浮點數來表示 30/45 分鐘時差的時區。 | -| `disabled` | `true` | 停用 `time` 模組。 | -| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | +| Option | 預設 | 說明 | +| ----------------- | ----------------------- | ----------------------------------------------------------------------------------------------------- | +| `format` | `"at [$time]($style) "` | The format string for the module. | +| `use_12hr` | `false` | 啟用 12 小時格式。 | +| `time_format` | 請看下列 | 用來顯示時間的 [chrono 格式字串](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html)。 | +| `style` | `"bold yellow"` | 這個模組的時間的風格。 | +| `utc_time_offset` | `"local"` | 設定相對於 UTC 的時差。 Range from -24 < x < 24. 允許使用浮點數來表示 30/45 分鐘時差的時區。 | +| `disabled` | `true` | 停用 `time` 模組。 | +| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | -如果 `use_12hr` 是 `true` 的話,`format` 會被預設為 `"%r"`。 不然的話,它會被預設為 `"%T"`。 手動設定 `format` 的設定值會覆寫 `use_12hr` 的設定。 +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. 不然的話,它會被預設為 `"%T"`。 Manually setting `time_format` will override the `use_12hr` setting. + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | ---------- | ----------------------------------- | +| 時間 | `13:08:10` | The current time. | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -1311,7 +1877,8 @@ symbol = "🏎💨 " [time] disabled = false -format = "🕙[ %T ]" +format = "🕙[\\[ $time \\]]($style) " +time_format = "%T" utc_time_offset = "-5" time_range = "10:00:00-14:00:00" ``` @@ -1327,12 +1894,20 @@ time_range = "10:00:00-14:00:00" ### 選項 -| 變數 | 預設 | 說明 | -| ------------- | --------------- | ------------------- | -| `style_root` | `"bold red"` | 使用者為 root 時使用的風格。 | -| `style_user` | `"bold yellow"` | 非 root 使用者時使用的風格。 | -| `show_always` | `false` | 總是顯示 `username` 模組。 | -| `disabled` | `false` | 停用 `username` 模組。 | +| Option | 預設 | 說明 | +| ------------- | ------------------------ | -------------------------- | +| `style_root` | `"bold red"` | 使用者為 root 時使用的風格。 | +| `style_user` | `"bold yellow"` | 非 root 使用者時使用的風格。 | +| `format` | `"via [$user]($style) "` | The format for the module. | +| `show_always` | `false` | 總是顯示 `username` 模組。 | +| `disabled` | `false` | 停用 `username` 模組。 | + +### Variables + +| 變數 | 範例 | 說明 | +| ------- | ------------ | ------------------------------------------------------------------------------------------- | +| `style` | `"red bold"` | Mirrors the value of option `style_root` when root is logged in and `style_user` otherwise. | +| `user` | `"matchai"` | The currently logged-in user ID. | ### 範例 @@ -1340,10 +1915,13 @@ time_range = "10:00:00-14:00:00" # ~/.config/starship.toml [username] -disabled = true +style_user = "white bold" +style_root = "black bold" +format = "user: [$user]($style) " +disabled = false +show_always = true ``` - ## Zig The `zig` module shows the currently installed version of Zig. 這個模組在下列其中一個條件達成時顯示: @@ -1352,11 +1930,22 @@ The `zig` module shows the currently installed version of Zig. 這個模組在 ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | --------------- | ----------------------------------------------------- | -| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | -| `style` | `"bold yellow"` | 這個模組的風格。 | -| `disabled` | `false` | Disables the `zig` module. | +| Option | 預設 | 說明 | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | +| `style` | `"bold yellow"` | 這個模組的風格。 | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `zig` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | -------- | ------------------------------------ | +| version | `v0.6.0` | The version of `zig` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -1372,6 +1961,7 @@ symbol = "⚡️ " The `custom` modules show the output of some arbitrary commands. These modules will be shown if any of the following conditions are met: + - The current directory contains a file whose name is in `files` - The current directory contains a directory whose name is in `directories` - The current directory contains a file whose extension is in `extensions` @@ -1391,24 +1981,34 @@ The order in which custom modules are shown can be individually set by setting ` ### 選項 -| 變數 | 預設 | 說明 | -| ------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. | -| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | -| `shell` | | [See below](#custom-command-shell) | -| `說明` | `""` | The description of the module that is shown when running `starship explain`. | -| `files` | `[]` | The files that will be searched in the working directory for a match. | -| `directories` | `[]` | The directories that will be searched in the working directory for a match. | -| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | -| `symbol` | `""` | The symbol used before displaying the command output. | -| `style` | `"bold green"` | 這個模組的風格。 | -| `prefix` | `""` | Prefix to display immediately before the command output. | -| `suffix` | `""` | Suffix to display immediately after the command output. | -| `disabled` | `false` | Disables this `custom` module. | +| Option | 預設 | 說明 | +| ------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `command` | | The command whose output should be printed. | +| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | +| `shell` | | [See below](#custom-command-shell) | +| `說明` | `""` | The description of the module that is shown when running `starship explain`. | +| `files` | `[]` | The files that will be searched in the working directory for a match. | +| `directories` | `[]` | The directories that will be searched in the working directory for a match. | +| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. | +| `symbol` | `""` | The symbol used before displaying the command output. | +| `style` | `"bold green"` | 這個模組的風格。 | +| `format` | `"[$symbol$output]($style) "` | The format for the module. | +| `disabled` | `false` | Disables this `custom` module. | + +### Variables + +| 變數 | 說明 | +| --------- | -------------------------------------- | +| output | The output of shell command in `shell` | +| symbol | Mirrors the value of option `symbol` | +| style\* | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string #### Custom command shell `shell` accepts a non-empty list of strings, where: + - The first string is the path to the shell to use to execute the command. - Other following arguments are passed to the shell. @@ -1459,11 +2059,22 @@ The `purescript` module shows the currently installed version of PureScript vers ### 選項 -| 變數 | 預設 | 說明 | -| ---------- | -------------- | ------------------------------------------------------------ | -| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | -| `style` | `"bold white"` | 這個模組的風格。 | -| `disabled` | `false` | Disables the `purescript` module. | +| Option | 預設 | 說明 | +| ---------- | ---------------------------------- | ------------------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | +| `style` | `"bold white"` | 這個模組的風格。 | +| `disabled` | `false` | Disables the `purescript` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | -------- | ------------------------------------ | +| version | `0.13.5` | The version of `purescript` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string ### 範例 @@ -1471,5 +2082,5 @@ The `purescript` module shows the currently installed version of PureScript vers # ~/.config/starship.toml [purescript] -symbol = "<=> " +format = "via [$symbol$version](bold white)" ``` diff --git a/docs/zh-TW/faq/README.md b/docs/zh-TW/faq/README.md index e6daa985..84be958c 100644 --- a/docs/zh-TW/faq/README.md +++ b/docs/zh-TW/faq/README.md @@ -5,9 +5,9 @@ - **Terminal Emulator**: [iTerm2](https://iterm2.com/) - **Theme**: Minimal - **Color Scheme**: [Snazzy](https://github.com/sindresorhus/iterm2-snazzy) - - **Font**: [Fira Code](https://github.com/tonsky/FiraCode) + - **Font**: [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads) - **Shell**: [Fish Shell](https://fishshell.com/) - - **Configuration**: [matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/master/.config/fish/config.fish) + - **Configuration**: [matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish) - **Prompt**: [Starship](https://starship.rs/) ## Do `prompt_order` and `.disabled` do the same thing? @@ -46,7 +46,7 @@ The prompt will use as much context as is provided, but no flags are "required". ## How do I run Starship on Linux distributions with older versions of glibc? -If you get an error like "*version 'GLIBC_2.18' not found (required by starship)*" when using the prebuilt binary (for example, on CentOS 6 or 7), you can use a binary compiled with `musl` instead of `glibc`: +If you get an error like "_version 'GLIBC_2.18' not found (required by starship)_" when using the prebuilt binary (for example, on CentOS 6 or 7), you can use a binary compiled with `musl` instead of `glibc`: ```sh curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux-musl @@ -56,13 +56,13 @@ curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux- 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: - - 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 [powerline-patched font](https://github.com/powerline/fonts). +- 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/). To test your system, run the following commands in a terminal: -``` +```sh echo -e "\xf0\x9f\x90\x8d" echo -e "\xee\x82\xa0" ``` @@ -70,3 +70,19 @@ 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). 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) + +## How do I uninstall Starship? + +Starship is just as easy to uninstall as it is to install in the first place. + +1. Remove any lines in your shell config (e.g. `~/.bashrc`) used to initialize Starship. +1. Delete the Starship binary. + +If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. + +If Starship was installed using the `curl | bash` script, the following command will delete the binary: + +```sh +# Locate and delete the starship binary +rm "$(which starship)" +``` diff --git a/docs/zh-TW/guide/README.md b/docs/zh-TW/guide/README.md index da6b08ed..f2142f91 100644 --- a/docs/zh-TW/guide/README.md +++ b/docs/zh-TW/guide/README.md @@ -121,7 +121,7 @@ ### 先決要求 -- 一個已經安裝並在你的終端機內啟動的 [Powerline 字型](https://github.com/powerline/fonts) (例如,試試看 [Fira Code](https://github.com/tonsky/FiraCode))。 +- A [Nerd Font](https://www.nerdfonts.com/) installed and enabled in your terminal (for example, try the [Fira Code Nerd Font](https://www.nerdfonts.com/font-downloads)). ### 入門 @@ -224,7 +224,7 @@ ### Code Contributors -This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. +This project exists thanks to all the people who contribute. [[Contribute](https://github.com/starship/starship/blob/master/CONTRIBUTING.md)]. ### Financial Contributors