diff --git a/docs/de-DE/config/README.md b/docs/de-DE/config/README.md index fe12ce53..fe803aa9 100644 --- a/docs/de-DE/config/README.md +++ b/docs/de-DE/config/README.md @@ -1,18 +1,12 @@ # Konfiguration -::: tip - -🔥 Die Konfiguration befindet sich derzeit noch in der Entwicklung. Viele neue Konfigurationsoptionen werden in den kommenden Versionen verfügbar sein. - -::: - -Um mit der Konfiguration von Starship zu beginnen, musst du die folgende Datei erstellen: `~/.config/starship.toml`. +To get started configuring starship, create the following file: `~/.config/starship.toml`. ```sh 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: +All configuration for starship is done in this [TOML](https://github.com/toml-lang/toml) file: ```toml # Don't print a new line at the start of the prompt @@ -27,7 +21,7 @@ success_symbol = "[➜](bold green)" # The "success_symbol" segment is being disabled = true ``` -Sie können den Pfad zur `starship.toml` mit der `STARSHIP_CONFIG` Umgebungsvariable ändern: +You can change default `starship.toml` file location with `STARSHIP_CONFIG` environment variable: ```sh export STARSHIP_CONFIG=~/.starship @@ -39,9 +33,23 @@ Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` -### Terminologie +### Logging -**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. +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: + +```sh +export STARSHIP_CACHE=~/.starship/cache +``` + +Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: + +```ps1 +$ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" +``` + +### Terminology + +**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. **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. @@ -77,7 +85,7 @@ For example: #### 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/). +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/). - `"fg:green bg:blue"` setzt grünen Text auf blauen Hintergrund - `"bg:blue fg:bright-green"` setzt hell-grünen Text auf blauen Hintergrund @@ -86,7 +94,7 @@ Die meisten Module in Starship lassen dich den Darstellungsstil verändern. Dies - `"bold italic fg:purple"` setzt dicke lila Kursivschrift - `""` deaktiviert explizit jeden Stil -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. +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 @@ -102,7 +110,7 @@ For example: 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 (`\`). -- $ +- \$ - \\ - [ - ] @@ -130,23 +138,21 @@ format = ''' ## Prompt -Dies ist eine Liste mit Prompt-weiten Konfigurationsoptionen. +This is the list of prompt-wide configuration options. ### Optionen -| 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). | +| Option | Standardwert | Beschreibung | +| -------------- | ------------------------------ | ----------------------------------------------------- | +| `format` | [link](#default-prompt-format) | Configure the format of the prompt. | +| `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). | +| `add_newline` | `true` | Add a new line before the start of the prompt. | ### Beispiel ```toml # ~/.config/starship.toml -# Disable the newline at the start of the prompt -format = "$all" - # Use custom format format = """ [┌───────────────────>](bold green) @@ -155,20 +161,23 @@ format = """ # Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 + +# Disable the newline at the start of the prompt +add_newline = false ``` ### Default Prompt Format -The default `format` is used to define the format of the prompt, if empty or no `format` is provided. Die Standardwerte sind folgende: +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 -format = "\n$all" +format = "$all" # Which is equivalent to format = """ - $username\ $hostname\ +$shlvl\ $kubernetes\ $directory\ $git_branch\ @@ -179,6 +188,7 @@ $hg_branch\ $docker_context\ $package\ $cmake\ +$dart\ $dotnet\ $elixir\ $elm\ @@ -190,17 +200,20 @@ $julia\ $nim\ $nodejs\ $ocaml\ +$perl\ $php\ $purescript\ $python\ $ruby\ $rust\ +$swift\ $terraform\ $zig\ $nix_shell\ $conda\ $memory_usage\ $aws\ +$gcloud\ $env_var\ $crystal\ $cmd_duration\ @@ -209,12 +222,13 @@ $line_break\ $jobs\ $battery\ $time\ +$status\ $character""" ``` ## AWS -Das `aws`-Modul zeigt das aktuelle AWS-Profil an. Dies basiert auf den Umgebungsvariablen: `AWS_REGION`, `AWS_DEFAULT_REGION`, `AWS_PROFILE` und der `~/.aws/config` Datei. +The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var. @@ -282,7 +296,7 @@ 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. +The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%. ### Optionen @@ -296,7 +310,7 @@ Das `battery` Modul zeigt, wie hoch der Akku des Geräts geladen ist und den akt | `disabled` | `false` | Wenn der Wert auf `true` steht, wird das Akkustand-Modul deaktiviert. |
-Das Batterie-Modul unterstützt auch einige untypische Zustände. +There are also options for some uncommon battery states. | Variable | Beschreibung | | ---------------- | --------------------------------------------------- | @@ -318,9 +332,9 @@ charging_symbol = "⚡️" discharging_symbol = "💀" ``` -### Anzeige des Akkustandes +### Battery Display -Die `display` Konfiguration "threshold" stellt ein ab wann die Akkuanzeige eingeblendet wird. Mit "style" wird das Erscheinungsbild festgelegt. Wenn `display` nicht angegeben ist. Die Standardwerte sind folgende: +The `display` configuration option is used to define when the battery indicator should be shown (threshold) and what it looks like (style). If no `display` is provided. The default is as shown: ```toml [[battery.display]] @@ -330,7 +344,7 @@ style = "bold red" #### Optionen -Die `display`-Option beinhaltet ein Array mit den folgenden Werten. +The `display` option is an array of the following table. | Variable | Beschreibung | | ----------- | ------------------------------------------------------- | @@ -340,23 +354,23 @@ Die `display`-Option beinhaltet ein Array mit den folgenden Werten. #### Beispiel ```toml -[[battery.display]] # "bold red" bei Akkustand zwischen 0–10% +[[battery.display]] # "bold red" style when capacity is between 0% and 10% threshold = 10 style = "bold red" -[[battery.display]] # "bold yellow" bei Akkustand zwischen 10–30% +[[battery.display]] # "bold yellow" style when capacity is between 10% and 30% threshold = 30 style = "bold yellow" -# Bei Akkustand über 30% wird der Akkustand nicht angezeigt +# when capacity is over 30%, the battery indicator will not be displayed ``` ## Zeichen -Das `character` Modul zeigt ein Zeichen ( meistens einen Pfeil "❯") vor der Texteingabe an. +The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal. -Das Zeichen zeigt an ob der letzte Befehl erfolgreich war, oder einen Fehler erzeugt hat. It can do this in two ways: +The character will tell you whether the last command was successful or not. It can do this in two ways: - changing color (`red`/`green`) - changing shape (`❯`/`✖`) @@ -437,15 +451,15 @@ The `cmake` module shows the currently installed version of CMake if: ## 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. +The `cmd_duration` module shows how long the last command took to execute. The module will be shown only if the command took longer than two seconds, or the `min_time` config value, if it exists. -::: warning Nicht die DEBUG-trap in der Bash hooken +::: warning Do not hook the DEBUG trap in Bash -Ist `bash` die Konsole der Wahl, dann nicht die `DEBUG`-trap nach der Ausführung von `eval $(starship init $0)` hooken, andernfalls **wird** dieses Modul unweigerlich untergehen. +If you are running Starship in `bash`, do not hook the `DEBUG` trap after running `eval $(starship init $0)`, or this module **will** break. ::: -Bash Nutzer, die eine "preexec" ähnliche Funktion benötigen, können [rcaloras bash_preexec Framework](https://github.com/rcaloras/bash-preexec) verwenden. Definieren Sie einfach die Arrays `preexec_functions` und `precmd_functions` bevor sie `eval $(starship init $0)` ausführen, und fahren Sie dann wie gewohnt fort. +Bash users who need preexec-like functionality can use [rcaloras's bash_preexec framework](https://github.com/rcaloras/bash-preexec). Simply define the arrays `preexec_functions` and `precmd_functions` before running `eval $(starship init $0)`, and then proceed as normal. ### Optionen @@ -478,11 +492,11 @@ format = "underwent [$duration](bold yellow)" ## Conda -Das `conda`-Modul zeigt dessen aktuelle Umgebung an, sofern `$CONDA_DEFAULT_ENV` gesetzt ist. +The `conda` module shows the current conda environment, if `$CONDA_DEFAULT_ENV` is set. -::: Tipp +::: tip -Hinweis: Dies unterdrückt nicht conda's eigenen Prompt-Modifikator, sie können jedoch conda mit `conda config --set changeps1 False` konfigurieren, um die Ausgabe von conda selbst auszuschalten. +This does not suppress conda's own prompt modifier, you may want to run `conda config --set changeps1 False`. ::: @@ -494,7 +508,8 @@ Hinweis: Dies unterdrückt nicht conda's eigenen Prompt-Modifikator, sie können | `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. | +| `ignore_base` | `true` | Ignores `base` environment when activated. | +| `disabled` | `false` | Disables the `conda` module. | ### Variables @@ -550,9 +565,45 @@ The `crystal` module shows the currently installed version of Crystal. Das Modul format = "via [✨ $version](bold blue) " ``` -## Verzeichnis +## Dart -Das `directory` -Modul zeigt den Pfad zu Ihrem aktuellen Verzeichnis an, abgeschnitten auf drei übergeordnete Ordner. Your directory will also be truncated to the root of the git repo that you're currently in. +The `dart` module shows the currently installed version of Dart. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: + +- The current directory contains a file with `.dart` extension +- The current directory contains a `.dart_tool` directory +- The current directory contains a `pubspec.yaml` or `pubspec.lock` file + +### Optionen + +| Variable | Standartwert | Beschreibung | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🎯 "` | A format string representing the symbol of Dart | +| `style` | `"bold blue"` | Stil für dieses Modul. | +| `disabled` | `false` | Disables the `dart` module. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ------------------------------------ | +| version | `v2.8.4` | The version of `dart` | +| symbol | | Mirrors the 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 + +[dart] +format = "via [🔰 $version](bold red) " +``` + +## Directory + +The `directory` module shows the path to your current directory, truncated to three parent folders. Your directory will also be truncated to the root of the git repo that you're currently in. When using the fish style pwd option, instead of hiding the path that is truncated, you will see a shortened name of each directory based on the number you enable for the option. @@ -560,18 +611,18 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an ### Optionen -| Variable | Standartwert | Beschreibung | +| Variable | Standardwert | Beschreibung | | ------------------------ | ----------------------------------------------- | -------------------------------------------------------------------------------- | -| `truncation_length` | `3` | Die Anzahl der übergeordneten Ordner, die angezeigt werden. | +| `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"` | Stil für dieses Modul. | -| `disabled` | `false` | Deaktiviert das `directory`-Modul. | +| `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. |
-Dieses Modul hat einige erweiterte Konfigurationsoptionen, welche die Darstellung von Verzeichnissen steuern. +This module has a few advanced configuration options that control how the directory is displayed. | Advanced Option | Standardwert | Beschreibung | | --------------------------- | ------------ | ---------------------------------------------------------------------------------------- | @@ -666,13 +717,13 @@ The module will also show the Target Framework Moniker ( ⚠️ Die angezeigte Version ist die des Pakets, dessen Quellcode im Verzeichnis liegt, nicht die des Paketmanagers. ### Optionen -| 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. | +| Option | Standartwert | Beschreibung | +| ----------------- | ---------------------------------- | ---------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"📦 "` | The symbol used before displaying the version the package. | +| `style` | `"bold 208"` | Stil für dieses Modul. | +| `display_private` | `false` | Enable displaying version for packages marked as private. | +| `disabled` | `false` | Disables the `package` module. | ### Variables @@ -1584,22 +1705,58 @@ The `ocaml` module shows the currently installed version of OCaml. Das Modul wir format = "via [🐪 $version]($style) " ``` -## PHP +## Perl -Das `php`-Modul zeigt die aktuell installierte Version von PHP. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: +The `perl` module shows the currently installed version of Perl. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: -- 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 +- The current directory contains a `Makefile.PL` or `Build.PL` file +- The current directory contains a `cpanfile` or `cpanfile.snapshot` file +- The current directory contains a `META.json` file or `META.yml` file +- The current directory contains a `.perl-version` file +- The current directory contains a `.pl`, `.pm` or `.pod` ### Optionen -| 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. | +| Variable | Standartwert | Beschreibung | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format string for the module. | +| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl | +| `style` | `"bold 149"` | Stil für dieses Modul. | +| `disabled` | `false` | Disables the `perl` module. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | --------- | ------------------------------------ | +| version | `v5.26.1` | The version of `perl` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +### Beispiel + +```toml +# ~/.config/starship.toml + +[perl] +format = "via [🦪 $version]($style) " +``` + +## PHP + +The `php` module shows the currently installed version of PHP. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: + +- The current directory contains a `composer.json` file +- The current directory contains a `.php-version` file +- The current directory contains a `.php` file + +### Optionen + +| Option | Standardwert | Beschreibung | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. | +| `style` | `"147 bold"` | Stil für dieses Modul. | +| `disabled` | `false` | Disables the `php` module. | ### Variables @@ -1628,40 +1785,42 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: -- Das aktuelle Verzeichnis enthält eine `.python-version`-Datei -- Das aktuelle Verzeichnis enthält eine `requirements.txt`-Datei -- Das aktuelle Verzeichnis enthält eine `pyproject.toml`-Datei +- The current directory contains a `.python-version` file +- The current directory contains a `requirements.txt` file +- The current directory contains a `pyproject.toml` file - The current directory contains a file with the `.py` extension (and `scan_for_pyfiles` is true) -- Das aktuelle Verzeichnis enthält eine `Pipfile`-Datei -- Das aktuelle Verzeichnis enthält eine `tox.ini`-Datei -- Das aktuelle Verzeichnis enthält eine `setup.py`-Datei +- The current directory contains a `Pipfile` file +- The current directory contains a `tox.ini` file +- The current directory contains a `setup.py` file - The current directory contains a `__init__.py` file -- Ein virtualenv ist momentan aktiv +- A virtual environment is currently activated ### Optionen -| 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. | +| Option | Standardwert | Beschreibung | +| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | The format for the module. | +| `symbol` | `"🐍 "` | A format string representing the symbol of Python | +| `style` | `"yellow bold"` | Stil für dieses Modul. | +| `pyenv_version_name` | `false` | Use pyenv to get Python version | +| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `disabled` | `false` | Disables the `python` module. | ### 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 | +| 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` | +| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` | +| virtualenv | `"venv"` | The current `virtualenv` name |
This module has some advanced configuration options. -| Variable | Standartwert | Beschreibung | +| Variable | Standardwert | Beschreibung | | --------------- | ------------ | ----------------------------------------------------------------------------- | | `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. | @@ -1684,16 +1843,15 @@ python_binary = "python3" [python] symbol = "👾 " pyenv_version_name = true -pyenv_prefix = "foo " ``` ## Ruby -Das `ruby` Modul zeigt die derzeit installierte Version von Ruby an. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: +The `ruby` module shows the currently installed version of Ruby. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: -- Das aktuelle Verzeichnis enthält eine `Gemfile`-Datei +- The current directory contains a `Gemfile` file - The current directory contains a `.ruby-version` file -- Das aktuelle Verzeichnis enthält eine `.rb`-Datei +- The current directory contains a `.rb` file ### Optionen @@ -1702,7 +1860,7 @@ Das `ruby` Modul zeigt die derzeit installierte Version von Ruby an. Das Modul w | `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. | +| `disabled` | `false` | Disables the `ruby` module. | ### Variables @@ -1725,10 +1883,10 @@ symbol = "🔺 " ## Rust -Das `rust` Modul zeigt die derzeit installierte Version von Rust an. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: +The `rust` module shows the currently installed version of Rust. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: -- Das aktuelle Verzeichnis enthält eine `Cargo.toml`-Datei -- Das aktuelle Verzeichnis enthält eine Datei mit der `.rs`-Erweiterung +- The current directory contains a `Cargo.toml` file +- The current directory contains a file with the `.rs` extension ### Optionen @@ -1737,7 +1895,7 @@ Das `rust` Modul zeigt die derzeit installierte Version von Rust an. Das Modul w | `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. | +| `disabled` | `false` | Disables the `rust` module. | ### Variables @@ -1758,6 +1916,41 @@ Das `rust` Modul zeigt die derzeit installierte Version von Rust an. Das Modul w format = "via [⚙️ $version](red bold)" ``` +## SHLVL + +The `shlvl` module shows the current SHLVL ("shell level") environment variable, if it is set to a number and meets or exceeds the specified threshold. + +### Optionen + +| Variable | Standartwert | Beschreibung | +| ----------- | ---------------------------- | --------------------------------------- | +| `threshold` | `2` | Display threshold. | +| `format` | `"[$symbol$shlvl]($style) "` | The format for the module. | +| `symbol` | `"↕️ "` | The symbol used to represent the SHLVL. | +| `style` | `"bold yellow"` | Stil für dieses Modul. | +| `disabled` | `true` | Disables the `shlvl` module. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ------------------------------------ | +| shlvl | `3` | The current value of SHLVL | +| symbol | | Mirrors the 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 + +[shlvl] +disabled = false +format = "$shlvl level(s) down" +threshold = 3 +``` + ## Singularity The `singularity` module shows the current singularity image, if inside a container and `$SINGULARITY_NAME` is set. @@ -1790,21 +1983,98 @@ The `singularity` module shows the current singularity image, if inside a contai format = "[📦 \\[$env\\]]($style) " ``` -## Terraform +## Swift -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: +The `swift` module shows the currently installed version of Swift. 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 +- The current directory contains a `Package.swift` file +- The current directory contains a file with the `.swift` extension ### Optionen -| Option | Standartwert | Beschreibung | +| Option | Standartwert | Beschreibung | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐦 "` | A format string representing the symbol of Swift | +| `style` | `"bold 202"` | Stil für dieses Modul. | +| `disabled` | `false` | Disables the `swift` module. | + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ------------------------------------ | +| version | `v5.2.4` | The version of `swift` | +| symbol | | Mirrors the 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 + +[swift] +format = "via [🏎 $version](red bold)" +``` + +## Status + +The `status` module displays the exit code of the previous command. The module will be shown only if the exit code is not `0`. + +::: tip + +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: + +### Optionen + +| Variable | Standartwert | Beschreibung | +| ---------- | -------------------------- | ------------------------------------------------------ | +| `format` | `[$symbol$status]($style)` | The format of the module | +| `symbol` | `"✖"` | A format string representing the symbol for the status | +| `style` | `"bold red"` | Stil für dieses Modul. | +| `disabled` | `true` | Disables the `status` module. | + + +### Variables + +| Variable | Beispiel | Beschreibung | +| --------- | -------- | ------------------------------------ | +| status | `127` | The exit code of the last command | +| symbol | | Mirrors the 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 + +[status] +style = "bg:blue" +symbol = "💣 " +format = "[\\[$symbol$status\\]]($style) " +disabled = false + +``` + +## 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. 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: + +- The current directory contains a `.terraform` folder +- Current directory contains a file with the `.tf` extension + +### Optionen + +| Option | Standardwert | 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. | +| `disabled` | `false` | Disables the `terraform` module. | ### Variables @@ -1837,35 +2107,35 @@ format = "[🏎💨 $version$workspace]($style) " format = "[🏎💨 $workspace]($style) " ``` -## Zeit +## Time -Das `time` Modul zeigt die aktuelle **lokale** Zeit an. Der `format` Wert wird von der crate [`chrono`](https://crates.io/crates/chrono) benutzt um die Zeit zu formatieren. Schau dir [die chrono strftime Dokumentation](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) an, um die möglichen Optionen zu sehen. +The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available. -::: Tipp +::: tip -Dieses Modul ist standardmäßig deaktiviert. Setze in deiner Konfiguration `disabled` auf `false` um es zu aktivieren. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: ### Optionen -| Option | 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 | +| Option | Standardwert | Beschreibung | +| ----------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `format` | `"at [$time]($style) "` | The format string for the module. | +| `use_12hr` | `false` | Enables 12 hour formatting | +| `time_format` | see below | The [chrono format string](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) used to format the time. | +| `style` | `"bold yellow"` | The style for the module time | +| `utc_time_offset` | `"local"` | Sets the UTC offset to use. Range from -24 < 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 `time_format` defaults to `"%r"`. Andernfalls ist es standardmäßig `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. ### Variables | Variable | Beispiel | Beschreibung | | --------- | ---------- | ----------------------------------- | -| zeit | `13:08:10` | The current time. | +| time | `13:08:10` | The current time. | | style\* | | Mirrors the value of option `style` | \*: This variable can only be used as a part of a style string @@ -1885,22 +2155,22 @@ time_range = "10:00:00-14:00:00" ## Username -Das `username` Modul zeigt den Namen des aktiven Benutzers. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: +The `username` module shows active user's username. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: -- Der aktuelle Benutzer ist root -- Der aktuelle Benutzer ist nicht der eingeloggte Benutzer -- Der Benutzer ist aktuell via SSH verbunden -- Die Variable `show_always` ist auf true gesetzt +- The current user is root +- The current user isn't the same as the one that is logged in +- The user is currently connected as an SSH session +- The variable `show_always` is set to true ### Optionen -| 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. | +| Option | Standardwert | Beschreibung | +| ------------- | ----------------------- | ------------------------------------- | +| `style_root` | `"bold red"` | The style used when the user is root. | +| `style_user` | `"bold yellow"` | The style used for non-root users. | +| `format` | `"[$user]($style) in "` | The format for the module. | +| `show_always` | `false` | Always shows the `username` module. | +| `disabled` | `false` | Disables the `username` module. | ### Variables @@ -1930,7 +2200,7 @@ The `zig` module shows the currently installed version of Zig. Das Modul wird ge ### Optionen -| Option | Standartwert | Beschreibung | +| Option | Standardwert | Beschreibung | | ---------- | ---------------------------------- | ----------------------------------------------------- | | `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | | `style` | `"bold yellow"` | Stil für dieses Modul. | @@ -1967,33 +2237,39 @@ These modules will be shown if any of the following conditions are met: - The current directory contains a file whose extension is in `extensions` - The `when` command returns 0 -::: Tipp +::: tip Multiple custom modules can be defined by using a `.`. ::: -::: Tipp +::: tip -The order in which custom modules are shown can be individually set by setting `custom.foo` in `prompt_order`. By default, the `custom` module will simply show all custom modules in the order they were defined. +The order in which custom modules are shown can be individually set by including `${custom.foo}` in the top level `format` (as it includes a dot, you need to use `${...}`). By default, the `custom` module will simply show all custom modules in the order they were defined. + +::: + +::: tip + +[Issue #1252](https://github.com/starship/starship/discussions/1252) contains examples of custom modules. If you have an interesting example not covered there, feel free to share it there! ::: ### Optionen -| 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. | +| Option | Standardwert | Beschreibung | +| ------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `command` | | The command whose output should be printed. The command will be passed on stdin to the shell. | +| `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | +| `shell` | | [See below](#custom-command-shell) | +| `description` | `""` | 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 @@ -2014,6 +2290,8 @@ The order in which custom modules are shown can be individually set by setting ` If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows. +The `command` will be passed in on stdin. + If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g. ```toml @@ -2041,12 +2319,11 @@ Automatic detection of shells and proper parameters addition are currently imple command = "echo foo" # shows output of command files = ["foo"] # can specify filters when = """ test "$HOME" == "$PWD" """ -prefix = " transcending " +format = " transcending [$output]($style)" [custom.time] command = "time /T" files = ["*.pst"] -prefix = "transcending " shell = ["pwsh.exe", "-NoProfile", "-Command", "-"] ``` @@ -2054,12 +2331,12 @@ shell = ["pwsh.exe", "-NoProfile", "-Command", "-"] The `purescript` module shows the currently installed version of PureScript version. Das Modul wird gezeigt, wenn mindestens einer der folgenden Punkte erfüllt ist: -- Das aktuelle Verzeichnis enthält eine `spago.dhall`-Datei +- The current directory contains a `spago.dhall` file - The current directory contains a \*.purs files ### Optionen -| Option | Standartwert | Beschreibung | +| Option | Standardwert | Beschreibung | | ---------- | ---------------------------------- | ------------------------------------------------------------ | | `format` | `"via [$symbol$version]($style) "` | The format for the module. | | `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | diff --git a/docs/de-DE/faq/README.md b/docs/de-DE/faq/README.md index a99c33c6..f8dddf85 100644 --- a/docs/de-DE/faq/README.md +++ b/docs/de-DE/faq/README.md @@ -10,11 +10,11 @@ - **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? +## Do top level `format` and `.disabled` do the same thing? Ja, beide können benutzt werden, um Module in der Prompt zu deaktivieren. Wenn nur Module deaktiviert werden wollen, sollte `.disabled` benutzt werden, aus den folgenden Gründen: -- Das Deaktivieren von Modulen ist expliziter als das Auslassen von Modulen in der prompt_order +- Disabling modules is more explicit than omitting them from the top level `format` - Mit der Aktualisierung von Starship werden neu erstellte Module an die Eingabezeile angefügt ## Laut Dokumentation ist Starship cross-shell, aber es läuft nicht auf shell X. Warum? diff --git a/docs/de-DE/guide/README.md b/docs/de-DE/guide/README.md index 5f2f4022..0d6aab75 100644 --- a/docs/de-DE/guide/README.md +++ b/docs/de-DE/guide/README.md @@ -112,7 +112,7 @@ - **Easy:** quick to install – start using it in minutes.

-Explore the Starship docs  ▶ +Explore the Starship docs  ▶

diff --git a/docs/de-DE/migrating-to-0.45.0/README.md b/docs/de-DE/migrating-to-0.45.0/README.md new file mode 100644 index 00000000..8257d47d --- /dev/null +++ b/docs/de-DE/migrating-to-0.45.0/README.md @@ -0,0 +1,265 @@ +# Migrating to v0.45.0 + +Starship v0.45.0 is a release containing breaking changes, in preparation for the big v1.0.0. We have made some major changes around how configuration is done on the prompt, to allow for a greater degree of customization. + +This guide is intended to walk you through the breaking changes. + +## `prompt_order` has been replaced by a root-level `format` + +Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship. + +Starship v0.45.0 will instead be accepting a `format` value, allowing for customization of the prompt outside of the modules themselves. + +**Example pre-v0.45.0 configuration** + +```toml +prompt_order = [ + "username", + "hostname", + "directory", + "git_branch", + "git_commit", + "git_state", + "git_status", + "cmd_duration", + "custom", + "line_break", + "jobs", + "battery", + "time", + "character", +] +``` + +**Example v0.45.0 configuration** + +```toml +format = """\ + $username\ + $hostname\ + $directory\ + $git_branch\ + $git_commit\ + $git_state\ + $git_status\ + $cmd_duration\ + $custom\ + $line_break\ + $jobs\ + $battery\ + $time\ + $character\ + """ +``` + +## Module `prefix` and `suffix` will be replaced by `format` + +Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered. + +Starship v0.45.0 will instead be accepting a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output. + +**Example pre-v0.45.0 configuration** + +```toml +[cmd_duration] +prefix = "took " +``` + +**Example v0.45.0 configuration** + +```toml +[cmd_duration] +# $duration – The command duration (e.g. "15s") +# $style – The default style of the module (e.g. "bold yellow") +format = "took [$duration]($style)" +``` + +### Affected Modules + +#### Zeichen + +| Removed Property | Replacement | +| ----------------------- | ---------------- | +| `symbol` | `success_symbol` | +| `use_symbol_for_status` | `error_symbol` | +| `style_success` | `success_symbol` | +| `style_failure` | `error_symbol` | + +**Changes to the Default Configuration** + +```diff +[character] +-- symbol = "❯" +-- error_symbol = "✖" +-- use_symbol_for_status = true +-- vicmd_symbol = "❮" +++ success_symbol = "[❯](bold green) " +++ error_symbol = "[❯](bold red) " +++ vicmd_symbol = "[❮](bold green)" +``` + +Previously, the `use_symbol_for_status` property was used to configure the prompt to show the `error_symbol` when the last command resulted in a non-zero status code. + +With the release of v0.45.0, we now always use `error_symbol` after non-zero status codes, unifying `use_symbol_for_status` and `error_symbol` properties. + +To configure the prompt to use the older `use_symbol_for_status = true` configuration, add the following to your config file: + +```toml +[character] +error_symbol = "[✖](bold red) " +``` + +#### Befehlsdauer + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | + +**Changes to the Default Configuration** + +```diff +[cmd_duration] +-- prefix = "took " +++ format = "took [$duration]($style)" +``` + +#### Directory + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | + +**Changes to the Default Configuration** + +```diff +[directory] +-- prefix = "in " +++ format = "[$path]($style)[$lock_symbol]($lock_style)" +``` + +#### Environment Variable + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[env_var] +-- prefix = "" +-- suffix = "" +++ format = "with [$env_value]($style) " +``` + +#### Git Commit + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[git_commit] +-- prefix = "(" +-- suffix = ")" +++ format = "[\\($hash\\)]($style) " +``` + +#### Git Status + +| Removed Property | Replacement | +| ----------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | +| `show_sync_count` | `format` | + +**Changes to the Default Configuration** + +```diff +[git_status] +-- prefix = "[" +-- suffix = "]" +-- show_sync_count = false +++ format = "([$all_status$ahead_behind] )" +``` + +Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch. + +With the release of v0.45.0, this has been replaced with the + +To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file: + +```toml +[git_status] +ahead = "⇡${count}" +diverged = "⇕⇡${ahead_count}⇣${behind_count}" +behind = "⇣${count}" +``` + +#### Hostname + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[hostname] +-- prefix = "" +-- suffix = "" +++ format = "[$hostname]($style) in " +``` + +#### Singularity + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `label` | `format` | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[singularity] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol\\[$env\\]]($style) " +``` + +#### Time + +| Removed Property | Replacement | +| ---------------- | ------------- | +| `format` | `time_format` | + +**Changes to the Default Configuration** + +```diff +[time] +-- format = "🕙[ %T ]" +++ time_format = "%T" +++ format = "at 🕙[$time]($style) +``` + +#### Custom Commands + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[custom.example] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol$output]($style) " +``` diff --git a/docs/de-DE/presets/README.md b/docs/de-DE/presets/README.md index 109eeda7..56cdb0c0 100644 --- a/docs/de-DE/presets/README.md +++ b/docs/de-DE/presets/README.md @@ -26,6 +26,9 @@ discharging_symbol = "" [conda] symbol = " " +[dart] +symbol = " " + [docker] symbol = " " @@ -68,6 +71,9 @@ symbol = " " [package] symbol = " " +[perl] +symbol = " " + [php] symbol = " " @@ -79,4 +85,7 @@ symbol = " " [rust] symbol = " " + +[swift] +symbol = "ﯣ " ``` diff --git a/docs/es-ES/README.md b/docs/es-ES/README.md index 5ed0a561..b38b0ff3 100644 --- a/docs/es-ES/README.md +++ b/docs/es-ES/README.md @@ -2,13 +2,13 @@ home: true heroImage: /logo.svg heroText: -tagline: El símbolo de sistema minimalista, ultrarápido e infinitamente customizable para cualquier intérprete de comandos. -actionText: Empezar → +tagline: '¡El prompt minimalista, increíblemente rápido, e infinitamente personalizable para cualquier shell!' +actionText: Comenzar → actionLink: ./guide/ features: - title: Compatibilidad primero - details: Funciona en las interfaces de líneas de comando (shells) más comunes en los sistemas operativos más comunes. ¡Úsalo donde sea! + details: Funciona en las shells más comunes en los sistemas operativos más comunes. ¡Úsalo en todas partes! - title: Desarrollado en Rust details: Obtén la mayor velocidad y seguridad de Rust, para hacer tu prompt lo más rápida y segura posible. diff --git a/docs/es-ES/advanced-config/README.md b/docs/es-ES/advanced-config/README.md index a3d3eae5..08ee7b37 100644 --- a/docs/es-ES/advanced-config/README.md +++ b/docs/es-ES/advanced-config/README.md @@ -1,16 +1,16 @@ # Configuración Avanzada -Mientras que Starship es un versátil intérprete de comandos, a veces necesitas más que editar `starhip.toml` para que haga ciertas cosas. Esta página detalla algunas de las técnicas de configuración más avanzadas en starship. +Mientras que Starship es un prompt versátil, a veces necesitas más que editar `starhip.toml` para que haga ciertas cosas. Esta página detalla algunas de las técnicas de configuración más avanzadas en starship. ::: aviso -Las configuraciones de esta sección pueden sufrir cambios en futuras versiones de Starship. +Las configuraciones de esta sección están sujetos a cambios en futuras versiones de Starship. ::: ## Comandos pre-prompt y pre-ejecucucióne personalizados en Bash -Bash no posee un framework oficial de preexec/precmd como la mayoría de las demás shells. Por lo tanto, es complicado proveer una personalización completa en `bash`. Sin embargo, Starship te da la posibilidad de insertar de forma limitada tus propias funciones en el proceso de renderizado del prompt: +Bash no posee un framework formal de preexec/precmd como la mayoría de las demás shells. Por lo tanto, es complicado proveer una personalización completa en `bash`. Sin embargo, Starship te da la posibilidad de insertar de forma limitada tus propias funciones en el proceso de renderizado del prompt: - Para ejecutar una función personalizada previa al renderizado del prompt, defina una nueva función y asigne su nombre a `starship_precmd_user_func`. Por ejemplo, para renderizar un cohete antes del prompt, se puede realizar así: @@ -21,7 +21,7 @@ function blastoff(){ starship_precmd_user_func="blastoff" ``` -- Para ejecutar una función personalizada antes de que un comando sea ejecutado, es posible usar el [mecanismo `DEBUG` trap](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). No obstante, ¡es **necesario** atrapar la señal DEBUG *antes* de inicializar Starship! Starship puede preservar el valor del mecanismo, pero si el mecanismo es reemplazado después de que Starship se inicie, algunas funcionalidades fallarán. +- Para ejecutar una función personalizada antes de que un comando sea ejecutado, es posible usar el [mecanismo trap `DEBUG`](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). No obstante, ¡**debes** atrapar la señal DEBUG *antes* de inicializar Starship! Starship puede preservar el valor de la trampa DEBUG, pero si el trampa es reemplazada después de que Starship inicie, alguna funcionalidad fallará. ```bash function blastoff(){ @@ -33,9 +33,9 @@ eval $(starship init bash) ## Cambiar el título de la ventana -Algunos shell prompts van a cambiar automáticamente el título de la ventana por ti. (Por ejemplo, para mostrar tu directorio actual). Fish incluso lo hace de forma predeterminada. Starship no hace esto, pero es bastante sencillo añadir esta funcionalidad a `bash` o `zsh`. +Algunas shells van a cambiar automáticamente el título de la ventana por ti. (por ejemplo, para mostrar tu directorio actual). Fish incluso lo hace de forma predeterminada. Starship no hace esto, pero es bastante sencillo añadir esta funcionalidad a `bash` o `zsh`. -Primero defina una función para el cambio de titulo de la ventana (idéntico en bash y zsh): +Primero, define una función para el cambio de titulo de la ventana (idéntico en bash y zsh): ```bash function set_win_title(){ @@ -43,9 +43,9 @@ function set_win_title(){ } ``` -Puede usar variables para personalizar este titulo (`$USER`, `$HOSTNAME` y `$PWD` son opciones populares). +Puedes usar variables para personalizar este titulo (`$USER`, `$HOSTNAME` y `$PWD` son opciones populares). -En `bash`, establezca que esta función sea la función precmd de Starship: +En `bash`, establece que esta función sea la función precmd de Starship: ```bash starship_precmd_user_func="set_win_title" @@ -57,9 +57,9 @@ En `zsh`, añade esto al array `precmd_functions`: precmd_functions+=(set_win_title) ``` -If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. +Si te gusta el resultado, añade estas líneas a tu archivo de configuración del shell (`~/.bashrc` o `~/.zsrhc`) para hacerlo permanente. -For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: +Por ejemplo, si quieres mostrar tu directorio actual en el título de la pestaña de la terminal, añade el siguiente fragmento a tu `~/.ashrc` o `~/.zshrc`: ```bash function set_win_title(){ @@ -68,9 +68,9 @@ function set_win_title(){ starship_precmd_user_func="set_win_title" ``` -## Cadenas de estilo +## Estilo de cadenas de texto -Las cadenas de estilo son una lista de palabras, separadas por espacios en blanco. Las palabras no son sensibles a mayúsculas (es decir, `negrita` y `NeGriTa` se consideran la misma cadena). Cada palabra puede ser una de las siguientes: +Los estilos de cadenas de texto son una lista de palabras, separadas por espacios en blanco. Las palabras no son sensibles a mayúsculas (es decir, `negrita` y `NeGriTa` se consideran la misma cadena). Cada palabra puede ser una de las siguientes: - `bold` - `underline` @@ -82,12 +82,12 @@ Las cadenas de estilo son una lista de palabras, separadas por espacios en blanc donde `` es un especificador de color (discutido a continuación). `fg:` y `` hacen actualmente lo mismo, aunque esto puede cambiar en el futuro. El orden de las palabras en la cadena no importa. -El token `none` anula todas las otras fichas en una cadena, por lo que, por ejemplo, `fg:red none fg:blue` creará una cadena sin ningún tipo de estilo. Puede convertirse en un error usar `none` junto con otros tokens en el futuro. +El estilo `none` anula todas los otros estilos en una cadena de texto, por lo que, por ejemplo, `fg:red none fg:blue` creará una cadena de texto sin ningún tipo de estilo. Puede convertirse en un error usar `none` junto con otros estilos en el futuro. Un especificador de color puede ser uno de los siguientes: - - Uno de los colores estándar del terminal: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. Opcionalmente puedes prefijar estos con `bright-` para obtener la versión brillante (por ejemplo, `bright-white`). + - Uno de los colores estándar del terminal: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. Opcionalmente puedes agregar el prefijo `bright-` para obtener la versión brillante (por ejemplo, `bright-white`). - Un `#` seguido de un número hexadecimal de seis dígitos. Esto especifica un [código hexadecimal de color RGB](https://www.w3schools.com/colors/colors_hexadecimal.asp). - - Un número entre 0-255. Esto especifica un [Código ANSI de color de 8-bits](https://i.stack.imgur.com/KTSQa.png). + - Un número entre 0-255. Esto especifica un [Código de color ANSI de 8-bits](https://i.stack.imgur.com/KTSQa.png). Si se especifican varios colores para el primer plano/fondo, el último en la cadena tendrá prioridad. diff --git a/docs/es-ES/config/README.md b/docs/es-ES/config/README.md index 368b8fdf..0a54a6e8 100644 --- a/docs/es-ES/config/README.md +++ b/docs/es-ES/config/README.md @@ -1,33 +1,28 @@ # Configuración -::: tip - -🔥 Este apartado está bajo construcción. Habrá nuevas opciones de configuración disponibles en próximas versiones. - -::: - -Para iniciar la configuración de starship, crea el siguiente fichero: `~/.config.toml`. +Para comenzar a configurar starship, crea el siguiente archivo: `~/.config/starship.toml`. ```sh 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): +Toda la configuración de starship se realiza en este archivo [TOML](https://github.com/toml-lang/toml): ```toml -# Don't print a new line at the start of the prompt +# Evita imprimir una nueva linea al inicio del prompt add_newline = false -# 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" +# Reemplaza el símbolo "❯" por "➜" del prompt +[character] # El nombre del módulo que se está configurando es "character" +symbol = "➜" # El segmento "symbol" es reemplazado por "➜" +success_symbol = "[➜](bold green)" # El segmento "success_symbol" es reemplazado por "➜" con el color "bold green" -# Disable the package module, hiding it from the prompt completely +# Desactiva el gestor de paquetes, ocultándolo por completo del prompt [package] disabled = true ``` -Puedes modificar la ubicación por defecto del fichero `starship.toml` con la variable de entorno `STARSHIP_CONFIG`: +Puedes cambiar la ubicación predeterminada del archivo `starship.toml` con la variable de entorno `STARSHIP_CONFIG`: ```sh export STARSHIP_CONFIG=~/.starship @@ -39,9 +34,23 @@ El equivalente en PowerShell (Windows) es añadir esta línea a tu `$PROFILE`: $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` -### Terminología +### Logging -**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. +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: + +```sh +export STARSHIP_CACHE=~/.starship/cache +``` + +El equivalente en PowerShell (Windows) es añadir esta línea a tu `$PROFILE`: + +```ps1 +$ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" +``` + +### Terminology + +**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. **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. @@ -57,11 +66,11 @@ A variable contains a `$` symbol followed by the name of the variable. The name 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. +- `$version` es un formato de cadena de texto con una variable llamada `version`. +- `$git_branch$git_commit` es un formato de cadena de texto con dos variables nombradas `git_branch` y `git_commit`. +- `$git_branch $git_commit` tiene las dos variables separadas por un espacio. -#### Text Group +#### Grupo de texto A text group is made up of two different parts. @@ -71,13 +80,13 @@ In the second part, which is enclosed in a `()`, is a [style string](#style-stri 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. +- `[on](bold red)` imprimirá una cadena `en` con texto en negrita color rojo. +- `[⬢ $version](bold green)` imprimirá un símbolo `⬢` seguido por el contenido de la variable `version`, con texto en negrita color verde. +- `[a [b](red) c](green)` imprimirá `a b c` con `b` rojo. y `a` y `c` verde. #### 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/). +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/). - `"fg:green bg:blue"` pone texto verde sobre un fondo azul - `"bg:blue fg:bright-green"` pone texto verde claro sobre un fondo azul @@ -86,23 +95,23 @@ La mayoría de los módulos de starship permiten configurar los estilos de su ca - `"bold italic fg:purple"` pone texto color morado, en negrita y cursiva - `""` desactiva explícitamente cualquier estilo -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. +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 +#### Cadenas de formato condicionales 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\] )`. +- `(@$region)` no mostrará nada si la variable `region` es `None`, de lo contrario `@` seguido por el valor de la región. +- `(algún texto)` siempre mostrará nada ya que no hay variables envueltas entre llaves. +- Cuando `$all` es un atajo de teclado para `\[$a$b\]`, `($all)` no mostrará nada solo si `$a` y `$b` ambos son `None`. Esto funciona igual que `(\[$a$b\] )`. -#### Escapable characters +#### Carácteres de escape 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 (`\`). -- $ +- \$ - \\ - [ - ] @@ -128,25 +137,23 @@ format = ''' \$''' ``` -## Símbolo del sistema +## Prompt -Esta es la lista de opciones de configuración. +This is the list of prompt-wide configuration options. ### Opciones -| 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). | +| Opción | Por defecto | Descripción | +| -------------- | ------------------------------ | ----------------------------------------------------------------------------- | +| `format` | [link](#default-prompt-format) | Configura el formato del prompt. | +| `scan_timeout` | `30` | Tiempo de espera tras el que starship escanea los archivos (en milisegundos). | +| `add_newline` | `true` | Añade una nueva línea antes del prompt. | ### Ejemplo ```toml # ~/.config/starship.toml -# Disable the newline at the start of the prompt -format = "$all" - # Use custom format format = """ [┌───────────────────>](bold green) @@ -155,20 +162,23 @@ format = """ # Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 + +# Disable the newline at the start of the prompt +add_newline = false ``` ### Default Prompt Format -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: +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 -format = "\n$all" +format = "$all" # Which is equivalent to format = """ - $username\ $hostname\ +$shlvl\ $kubernetes\ $directory\ $git_branch\ @@ -179,6 +189,7 @@ $hg_branch\ $docker_context\ $package\ $cmake\ +$dart\ $dotnet\ $elixir\ $elm\ @@ -190,17 +201,20 @@ $julia\ $nim\ $nodejs\ $ocaml\ +$perl\ $php\ $purescript\ $python\ $ruby\ $rust\ +$swift\ $terraform\ $zig\ $nix_shell\ $conda\ $memory_usage\ $aws\ +$gcloud\ $env_var\ $crystal\ $cmd_duration\ @@ -209,20 +223,21 @@ $line_break\ $jobs\ $battery\ $time\ +$status\ $character""" ``` ## AWS -El módulo `aws` muestra la región actual de AWS y el perfil. Éste se basa en las variables de entorno `AWS_REGION`, `AWS_DEFAULT_REGION`, y `AWS_PROFILE` del fichero `~/.aws/config`. +The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. -Cuando uses [aws-vault](https://github.com/99designs/aws-vault) el perfil se obtiene de la variable de entorno `AWS_VAULT`. +When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var. ### Opciones -| Option | Por defecto | Descripción | +| Opción | Por defecto | Descripción | | ---------------- | ---------------------------------------------------- | ------------------------------------------------------------ | -| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | The format for the module. | +| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | El formato del módulo. | | `symbol` | `"☁️ "` | El símbolo que se muestra antes del perfil de AWS. | | `region_aliases` | | Tabla de alias de región para mostrar además del nombre AWS. | | `style` | `"bold yellow"` | El estilo del módulo. | @@ -230,18 +245,18 @@ Cuando uses [aws-vault](https://github.com/99designs/aws-vault) el perfil se obt ### 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` | +| Variable | Ejemplo | Descripción | +| --------- | ---------------- | -------------------------------------- | +| region | `ap-northeast-1` | La región actual de AWS | +| profile | `astronauts` | El perfil actual de AWS | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo ### Examples -#### Display everything +#### Mostrar todo ```toml # ~/.config/starship.toml @@ -255,7 +270,7 @@ ap-southeast-2 = "au" us-east-1 = "va" ``` -#### Display region +#### Mostrar región ```toml # ~/.config/starship.toml @@ -269,7 +284,7 @@ ap-southeast-2 = "au" us-east-1 = "va" ``` -#### Display profile +#### Mostrar perfil ```toml # ~/.config/starship.toml @@ -282,21 +297,21 @@ 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%. +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%. ### Opciones -| Option | Por defecto | Descripción | +| Opción | 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. | +| `format` | `"[$symbol$percentage]($style) "` | El formato del módulo. | | `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. +There are also options for some uncommon battery states. | Variable | Descripción | | ---------------- | --------------------------------------------------- | @@ -318,9 +333,9 @@ charging_symbol = "⚡️" discharging_symbol = "💀" ``` -### Indicador de batería +### Battery Display -La configuración de la opción `display` es usada para definir cuándo se debe mostrar el indicador de batería y cómo debe mostrarse. Si no se provee ningún valor para `display` El valor por defecto es el siguiente: +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: ```toml [[battery.display]] @@ -330,7 +345,7 @@ style = "bold red" #### Opciones -La opción `display` es un array de la siguiente tabla. +The `display` option is an array of the following table. | Variable | Descripción | | ----------- | --------------------------------------------------------------- | @@ -340,48 +355,48 @@ La opción `display` es un array de la siguiente tabla. #### Ejemplo ```toml -[[battery.display]] # "bold red" cuando la carga está entre 0% y 10% +[[battery.display]] # "bold red" style when capacity is between 0% and 10% threshold = 10 style = "bold red" -[[battery.display]] # "bold yellow" cuando la carga está entre 10% y 30% +[[battery.display]] # "bold yellow" style when capacity is between 10% and 30% threshold = 30 style = "bold yellow" -# cuando la carga está por encima del 30% el indicador no se mostrará +# when capacity is over 30%, the battery indicator will not be displayed ``` ## Character -El módulo `character` muestra un carater (normalmente una flecha) tras el texto que introduces en el terminal. +The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal. -El carácter te dirá si el último comando funcionó o no. It can do this in two ways: +The character will tell you whether the last command was successful or not. It can do this in two ways: -- changing color (`red`/`green`) -- changing shape (`❯`/`✖`) +- cambiando el color (`red`/`green`) +- cambiando la forma (`.`/`✖`) 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 -| 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`. | +| Opción | Por defecto | Descripción | +| ---------------- | ------------------- | ------------------------------------------------------------------------------------------ | +| `format` | `"$symbol "` | La cadena de formato usada antes de la entrada de texto. | +| `success_symbol` | `"[❯](bold green)"` | La cadena de formato usada antes de la entrada de texto si el comando anterior tuvo éxito. | +| `error_symbol` | `"[❯](bold red)"` | La cadena de formato usada antes de la entrada de texto si el comando anterior falló. | +| `vicmd_symbol` | `"[❮](bold green)"` | El cadena de formato antes de la entrada de texto si la shell está en modo vim normal. | +| `disabled` | `false` | Desactiva el módulo `character`. | ### Variables -| Variable | Ejemplo | Descripción | -| -------- | ------- | --------------------------------------------------------------------- | -| symbol | | A mirror of either `success_symbol`, `error_symbol` or `vicmd_symbol` | +| Variable | Ejemplo | Descripción | +| -------- | ------- | -------------------------------------------------------------- | +| symbol | | Un espejo de `success_symbol`, `error_symbol` o `vicmd_symbol` | ### Examples -#### With custom error shape +#### Con forma de error personalizada ```toml # ~/.config/starship.toml @@ -391,7 +406,7 @@ success_symbol = "[➜](bold green) " error_symbol = "[✗](bold red) " ``` -#### Without custom error shape +#### Sin forma de error personalizada ```toml # ~/.config/starship.toml @@ -401,7 +416,7 @@ success_symbol = "[➜](bold green) " error_symbol = "[➜](bold red) " ``` -#### With custom vim shape +#### Con forma vim personalizada ```toml # ~/.config/starship.toml @@ -414,57 +429,57 @@ vicmd_symbol = "[V](bold green) " The `cmake` module shows the currently installed version of CMake if: -- The current directory contains a `CMakeLists.txt` file +- El directorio actual contiene un archivo `CMakeLists.txt` ### 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. | +| Opción | Por defecto | Descripción | +| ---------- | ---------------------------------- | ---------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | El formato del módulo. | +| `symbol` | `"🛆 "` | El símbolo usado antes de la versión de cmake. | +| `style` | `"bold blue"` | El estilo del módulo. | +| `disabled` | `false` | Deshabilita el módulo `cmake`. | ### 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` | +| Variable | Ejemplo | Descripción | +| --------- | --------- | -------------------------------------- | +| version | `v3.17.3` | La versión de cmake | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo ## 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. +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 No utilizar DEBUG en Bash +::: warning Do not hook the DEBUG trap in Bash -Si estás usando Starship con `bash`, no uses `DEBUG` después de ejecutar `eval $(starship init $0)`, o el módulo **se romperá**. +If you are running Starship in `bash`, do not hook the `DEBUG` trap after running `eval $(starship init $0)`, or this module **will** break. ::: -Los usuarios de bash que necesiten la funcionalidad preexec-like pueden usar el framework rcaloras's bash_preexec. Simplemente define los arrays preexec_functions y precmd_functions antes de ejecutar eval $(starship init $0), y continúa con normalidad. Basta con definir los arrays `preexec_functions` y `precmd_functions` antes de ejecutar `eval $(starship init $0)`, y luego proceder como siempre. +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. ### Opciones -| Option | Por defecto | Descripción | +| Opción | 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. | +| `format` | `"took [$duration]($style) "` | El formato del módulo. | | `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` | +| Variable | Ejemplo | Descripción | +| --------- | -------- | ------------------------------------------ | +| duration | `16m40s` | El tiempo que tardó en ejecutar el comando | +| style\* | | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo ### Ejemplo @@ -478,33 +493,34 @@ format = "underwent [$duration](bold yellow)" ## Conda -El módulo `conda` muestra el actual entorno conda, si la variable `$CONDA_DEFAULT_ENV` existe. +The `conda` module shows the current conda environment, if `$CONDA_DEFAULT_ENV` is set. ::: tip -Esto no modifica el propio símbolo de sistema de conda. En caso de querer suprimirlo, ejecuta `conda config --set changeps1 False`. +This does not suppress conda's own prompt modifier, you may want to run `conda config --set changeps1 False`. ::: ### Opciones -| Option | Por defecto | Descripción | +| Opción | 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`. | +| `format` | `"[$symbol$environment]($style) "` | El formato del módulo. | +| `ignore_base` | `true` | Ignora el entorno `base` cuando se activa. | +| `disabled` | `false` | Deshabilita 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` | +| Variable | Ejemplo | Descripción | +| ----------- | ------------ | -------------------------------------- | +| environment | `astronauts` | El entorno conda actual | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo ### Ejemplo @@ -517,29 +533,29 @@ format = "[$symbol$environment](dimmed green) " ## Crystal -El módulo `crystal` muestra la versión actual de Crystal. El módulo se muestra si algunas de las siguientes condiciones se cumplen: +The `crystal` module shows the currently installed version of Crystal. El módulo se muestra si algunas de las siguientes condiciones se cumplen: - El directorio actual contiene un fichero `shard.yml` - El directorio actual contiene un fichero `.cr` ### Opciones -| Option | Por defecto | Descripción | +| Opción | 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. | +| `format` | `"via [$symbol$version]($style) "` | El formato del módulo. | | `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` | +| Variable | Ejemplo | Descripción | +| --------- | --------- | -------------------------------------- | +| version | `v0.32.1` | La versión de `crystal` | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo ### Ejemplo @@ -550,28 +566,64 @@ El módulo `crystal` muestra la versión actual de Crystal. El módulo se muestr format = "via [✨ $version](bold blue) " ``` -## Directory +## Dart -El módulo `directory` muestra la ruta hasta el directorio actual, mostrando tres directorios padre como máximo. Tu directorio se truncará a la raíz del repositorio git en el que estés. +The `dart` module shows the currently installed version of Dart. El módulo se muestra si algunas de las siguientes condiciones se cumplen: -Cuando usas el estilo fish de la opción pwd, en lugar de ocultar la ruta truncada, verás una versión acortada del nombre de cada directorio basada en el número que activa la opción. - -Por ejemplo, dado `~/Dev/Nix/nixpkgs/pkgs` donde `nixpkgs` es la raíz del repositorio y el valor de la opción es `1`. En ese caso, verás `~/D/N/nixpkgs/pkgs`, cuando antes hubiera sido `nixpkgs/pkgs`. +- El directorio actual contiene un archivo con la extensión `.dart` +- El directorio actual contiene un directorio `.dart_tool` +- El directorio actual contiene un archivo `pubspec.yaml` o `pubspec.lock` ### 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. | -| `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. | +| Variable | Por defecto | Descripción | +| ---------- | ---------------------------------- | ------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | El formato del módulo. | +| `symbol` | `"🎯 "` | Una cadena de formato que representa el símbolo de Dart | +| `style` | `"bold blue"` | El estilo del módulo. | +| `disabled` | `false` | Deshabilita el módulo `dart`. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | -------- | -------------------------------------- | +| version | `v2.8.4` | La versión de `dart` | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | + +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo + +### Ejemplo + +```toml +# ~/.config/starship.toml + +[dart] +format = "via [🔰 $version](bold red) " +``` + +## Directory + +The `directory` module shows the path to your current directory, truncated to three parent folders. Your directory will also be truncated to the root of the git repo that you're currently in. + +When using the fish style pwd option, instead of hiding the path that is truncated, you will see a shortened name of each directory based on the number you enable for the option. + +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`. + +### Opciones + +| Variable | Por defecto | Descripción | +| ------------------------ | ----------------------------------------------- | --------------------------------------------------------------------- | +| `truncation_length` | `3` | El número de carpetas a las que se debe truncar el directorio actual. | +| `truncate_to_repo` | `true` | Truncar o no hasta la raíz del repositorio git en el que se esté. | +| `format` | `"[$path]($style)[$lock_symbol]($lock_style) "` | El formato del módulo. | +| `style` | `"bold cyan"` | El estilo del módulo. | +| `disabled` | `false` | Deshabilita el módulo `directory`. | +| `read_only_symbol` | `"🔒"` | El símbolo que indica si el directorio actual es de sólo lectura. | +| `read_only_symbol_style` | `"red"` | El estilo para el símbolo de sólo lectura. |
-Este módulo tiene algunas opciones avanzadas de configuración que controlan cómo se muestra el directorio. +This module has a few advanced configuration options that control how the directory is displayed. | Advanced Option | Por defecto | Descripción | | --------------------------- | ----------- | ---------------------------------------------------------------------------------------- | @@ -593,12 +645,12 @@ 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` | +| Variable | Ejemplo | Descripción | +| --------- | --------------------- | ------------------------------------- | +| path | `"D:/Projects"` | La ruta de directorio actual | +| style\* | `"black bold dimmed"` | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo ### Ejemplo @@ -609,29 +661,29 @@ Por ejemplo, dado `~/Dev/Nix/nixpkgs/pkgs` donde `nixpkgs` es la raíz del repos truncation_length = 8 ``` -## Docker context +## Docker Context -El módulo `docker_context` muestra el [Docker context](https://docs.docker.com/engine/context/working-with-contexts/) activo si no está a `default`. +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`. ### Opciones -| 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`. | +| Opción | Por defecto | Descripción | +| ----------------- | ---------------------------------- | --------------------------------------------------------------------------------------- | +| `format` | `"via [$symbol$context]($style) "` | El formato del módulo. | +| `symbol` | `"🐳 "` | El símbolo usado antes de mostrar el contexto de Docker. | +| `style` | `"blue bold"` | El estilo del módulo. | +| `only_with_files` | `false` | Mostrar solo cuando hay un `docker-compose.yml` o `Dockerfile` en el directorio actual. | +| `disabled` | `true` | Deshabilita 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` | +| Variable | Ejemplo | Descripción | +| --------- | -------------- | -------------------------------------- | +| context | `test_context` | El contexto actual de docker | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo ### Ejemplo @@ -644,14 +696,14 @@ 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. +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 or more of the following files are present in the current directory: - `global.json` - `project.json` -- `Directory.Build.props` -- `Directory.Build.targets` +- `Directoria.Build.props` +- `Directorio.Build.targets` - `Packages.props` - `*.sln` - `*.csproj` @@ -666,24 +718,24 @@ The module will also show the Target Framework Moniker ( ⚠️ The version being shown is that of the package whose source code is in your current directory, not your package manager. ### Opciones -| Option | Por defecto | Descripción | +| Opción | Por defecto | Descripción | | ----------------- | ---------------------------------- | ---------------------------------------------------------- | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `format` | `"via [$symbol$version]($style) "` | El formato del módulo. | | `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. | @@ -1528,13 +1650,13 @@ The `package` module is shown when the current directory is the repository for a ### 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` | +| Variable | Ejemplo | Descripción | +| --------- | -------- | -------------------------------------- | +| version | `v1.0.0` | The version of your package | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo ### Ejemplo @@ -1558,7 +1680,7 @@ The `ocaml` module shows the currently installed version of OCaml. El módulo se ### Opciones -| Option | Por defecto | Descripción | +| Opción | Por defecto | Descripción | | ---------- | ---------------------------------- | ------------------------------------------------------- | | `format` | `"via [$symbol$version]($style) "` | The format string for the module. | | `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | @@ -1567,13 +1689,13 @@ The `ocaml` module shows the currently installed version of OCaml. El módulo se ### 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` | +| Variable | Ejemplo | Descripción | +| --------- | --------- | -------------------------------------- | +| version | `v4.10.0` | The version of `ocaml` | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo ### Ejemplo @@ -1584,32 +1706,68 @@ The `ocaml` module shows the currently installed version of OCaml. El módulo se format = "via [🐪 $version]($style) " ``` +## Perl + +The `perl` module shows the currently installed version of Perl. El módulo se muestra si algunas de las siguientes condiciones se cumplen: + +- The current directory contains a `Makefile.PL` or `Build.PL` file +- The current directory contains a `cpanfile` or `cpanfile.snapshot` file +- The current directory contains a `META.json` file or `META.yml` file +- The current directory contains a `.perl-version` file +- The current directory contains a `.pl`, `.pm` or `.pod` + +### Opciones + +| Variable | Por defecto | Descripción | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format string for the module. | +| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl | +| `style` | `"bold 149"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `perl` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | --------- | -------------------------------------- | +| version | `v5.26.1` | The version of `perl` | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | + +### Ejemplo + +```toml +# ~/.config/starship.toml + +[perl] +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: -- El directorio actual contiene un fichero `composer.json` +- The current directory contains a `composer.json` file - The current directory contains a `.php-version` file - The current directory contains a `.php` file ### Opciones -| Option | Por defecto | Descripción | +| Opción | Por defecto | Descripción | | ---------- | ---------------------------------- | ----------------------------------------------------- | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `format` | `"via [$symbol$version]($style) "` | El formato del módulo. | | `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` | +| Variable | Ejemplo | Descripción | +| --------- | -------- | -------------------------------------- | +| version | `v7.3.8` | The version of `php` | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo ### Ejemplo @@ -1629,34 +1787,36 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name El módulo se muestra si algunas de las siguientes condiciones se cumplen: - The current directory contains a `.python-version` file -- El directorio actual contiene un fichero `requirements.txt` -- El directorio actual contiene un fichero `pyproject.toml` +- The current directory contains a `requirements.txt` file +- The current directory contains a `pyproject.toml` file - The current directory contains a file with the `.py` extension (and `scan_for_pyfiles` is true) - The current directory contains a `Pipfile` file -- El directorio actual contiene un fichero `tox.ini` -- El directorio actual contiene un fichero `setup.py` +- The current directory contains a `tox.ini` file +- The current directory contains a `setup.py` file - The current directory contains a `__init__.py` file - A virtual environment is currently activated ### Opciones -| 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. | +| Opción | Por defecto | Descripción | +| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | El formato del módulo. | +| `symbol` | `"🐍 "` | A format string representing the symbol of Python | +| `style` | `"yellow bold"` | El estilo del módulo. | +| `pyenv_version_name` | `false` | Use pyenv to get Python version | +| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `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 | +| Variable | Ejemplo | Descripción | +| ------------ | --------------- | ------------------------------------------ | +| version | `"v3.8.1"` | The version of `python` | +| symbol | `"🐍 "` | Refleja el valor de la opción `symbol` | +| style | `"yellow bold"` | Refleja el valor de la opción `style` | +| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` | +| virtualenv | `"venv"` | The current `virtualenv` name |
This module has some advanced configuration options. @@ -1684,7 +1844,6 @@ python_binary = "python3" [python] symbol = "👾 " pyenv_version_name = true -pyenv_prefix = "foo " ``` ## Ruby @@ -1697,22 +1856,22 @@ The `ruby` module shows the currently installed version of Ruby. El módulo se m ### Opciones -| Option | Por defecto | Descripción | +| Opción | Por defecto | Descripción | | ---------- | ---------------------------------- | ------------------------------------------------ | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `format` | `"via [$symbol$version]($style) "` | El formato del módulo. | | `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` | +| Variable | Ejemplo | Descripción | +| --------- | -------- | -------------------------------------- | +| version | `v2.5.1` | The version of `ruby` | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo ### Ejemplo @@ -1732,22 +1891,22 @@ The `rust` module shows the currently installed version of Rust. El módulo se m ### Opciones -| Option | Por defecto | Descripción | +| Opción | Por defecto | Descripción | | ---------- | ---------------------------------- | ----------------------------------------------- | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `format` | `"via [$symbol$version]($style) "` | El formato del módulo. | | `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` | +| Variable | Ejemplo | Descripción | +| --------- | ----------------- | -------------------------------------- | +| version | `v1.43.0-nightly` | The version of `rustc` | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo ### Ejemplo @@ -1758,28 +1917,63 @@ The `rust` module shows the currently installed version of Rust. El módulo se m format = "via [⚙️ $version](red bold)" ``` +## SHLVL + +The `shlvl` module shows the current SHLVL ("shell level") environment variable, if it is set to a number and meets or exceeds the specified threshold. + +### Opciones + +| Variable | Por defecto | Descripción | +| ----------- | ---------------------------- | --------------------------------------- | +| `threshold` | `2` | Display threshold. | +| `format` | `"[$symbol$shlvl]($style) "` | El formato del módulo. | +| `symbol` | `"↕️ "` | The symbol used to represent the SHLVL. | +| `style` | `"bold yellow"` | El estilo del módulo. | +| `disabled` | `true` | Disables the `shlvl` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | ------- | -------------------------------------- | +| shlvl | `3` | The current value of SHLVL | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | + +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo + +### Ejemplo + +```toml +# ~/.config/starship.toml + +[shlvl] +disabled = false +format = "$shlvl level(s) down" +threshold = 3 +``` + ## Singularity The `singularity` module shows the current singularity image, if inside a container and `$SINGULARITY_NAME` is set. ### Opciones -| Option | Por defecto | Descripción | +| Opción | Por defecto | Descripción | | ---------- | ------------------------------------ | ------------------------------------------------ | -| `format` | `"[$symbol\\[$env\\]]($style) "` | The format for the module. | +| `format` | `"[$symbol\\[$env\\]]($style) "` | El formato del módulo. | | `symbol` | `""` | A format string displayed before the image name. | | `style` | `"bold dimmed blue"` | El estilo del módulo. | | `disabled` | `false` | Disables the `singularity` module. | ### 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` | +| Variable | Ejemplo | Descripción | +| --------- | ------------ | -------------------------------------- | +| env | `centos.img` | The current singularity image | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo ### Ejemplo @@ -1790,6 +1984,83 @@ The `singularity` module shows the current singularity image, if inside a contai format = "[📦 \\[$env\\]]($style) " ``` +## Swift + +The `swift` module shows the currently installed version of Swift. El módulo se muestra si algunas de las siguientes condiciones se cumplen: + +- The current directory contains a `Package.swift` file +- The current directory contains a file with the `.swift` extension + +### Opciones + +| Opción | Por defecto | Descripción | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | El formato del módulo. | +| `symbol` | `"🐦 "` | A format string representing the symbol of Swift | +| `style` | `"bold 202"` | El estilo del módulo. | +| `disabled` | `false` | Disables the `swift` module. | + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | -------- | -------------------------------------- | +| version | `v5.2.4` | The version of `swift` | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | + +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo + +### Ejemplo + +```toml +# ~/.config/starship.toml + +[swift] +format = "via [🏎 $version](red bold)" +``` + +## Status + +The `status` module displays the exit code of the previous command. The module will be shown only if the exit code is not `0`. + +::: tip + +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: + +### Opciones + +| Variable | Por defecto | Descripción | +| ---------- | -------------------------- | ------------------------------------------------------ | +| `format` | `[$symbol$status]($style)` | The format of the module | +| `symbol` | `"✖"` | A format string representing the symbol for the status | +| `style` | `"bold red"` | El estilo del módulo. | +| `disabled` | `true` | Disables the `status` module. | + + +### Variables + +| Variable | Ejemplo | Descripción | +| --------- | ------- | -------------------------------------- | +| status | `127` | The exit code of the last command | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | + +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo + + +### Ejemplo +```toml + +# ~/.config/starship.toml + +[status] +style = "bg:blue" +symbol = "💣 " +format = "[\\[$symbol$status\\]]($style) " +disabled = false + +``` + ## 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. 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: @@ -1799,7 +2070,7 @@ The `terraform` module shows the currently selected terraform workspace and vers ### Opciones -| Option | Por defecto | Descripción | +| Opción | Por defecto | Descripción | | ---------- | ------------------------------------ | ----------------------------------------------------- | | `format` | `"via [$symbol$workspace]($style) "` | The format string for the module. | | `symbol` | `"💠 "` | A format string shown before the terraform workspace. | @@ -1808,14 +2079,14 @@ The `terraform` module shows the currently selected terraform workspace and vers ### 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` | +| Variable | Ejemplo | Descripción | +| --------- | ---------- | -------------------------------------- | +| version | `v0.12.24` | The version of `terraform` | +| workspace | `default` | The current terraform workspace | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo ### Ejemplo @@ -1837,7 +2108,7 @@ format = "[🏎💨 $version$workspace]($style) " format = "[🏎💨 $workspace]($style) " ``` -## Hora +## Time The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available. @@ -1849,26 +2120,26 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ### Opciones -| Option | Por defecto | Descripción | +| Opción | Por defecto | Descripción | | ----------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `format` | `"at [$time]($style) "` | The format string for the module. | -| `use_12hr` | `false` | Activa el formato de 12 horas | +| `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"` | El estilo del módulo de la hora | +| `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` | `"-"` | Establece el intervalo de tiempo durante el cual el módulo se mostrará. La hora debe ser especificada en formato de 24 horas | +| `time_range` | `"-"` | Sets the time range during which the module will be shown. Times must be specified in 24-hours format | If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. 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` | +| Variable | Ejemplo | Descripción | +| --------- | ---------- | ------------------------------------- | +| time | `13:08:10` | The current time. | +| style\* | | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo ### Ejemplo @@ -1883,7 +2154,7 @@ utc_time_offset = "-5" time_range = "10:00:00-14:00:00" ``` -## Nombre de usuario +## Username The `username` module shows active user's username. El módulo se muestra si algunas de las siguientes condiciones se cumplen: @@ -1894,13 +2165,13 @@ The `username` module shows active user's username. El módulo se muestra si alg ### Opciones -| 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. | +| Opción | 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` | `"[$user]($style) in "` | El formato del módulo. | +| `show_always` | `false` | Always shows the `username` module. | +| `disabled` | `false` | Disables the `username` module. | ### Variables @@ -1930,22 +2201,22 @@ The `zig` module shows the currently installed version of Zig. El módulo se mue ### Opciones -| Option | Por defecto | Descripción | +| Opción | 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. | +| `format` | `"via [$symbol$version]($style) "` | El formato del módulo. | | `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` | +| Variable | Ejemplo | Descripción | +| --------- | -------- | -------------------------------------- | +| version | `v0.6.0` | The version of `zig` | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo ### Ejemplo @@ -1956,7 +2227,7 @@ The `zig` module shows the currently installed version of Zig. El módulo se mue symbol = "⚡️ " ``` -## Comandos personalizados +## Custom commands The `custom` modules show the output of some arbitrary commands. @@ -1975,24 +2246,30 @@ Multiple custom modules can be defined by using a `.`. ::: tip -The order in which custom modules are shown can be individually set by setting `custom.foo` in `prompt_order`. By default, the `custom` module will simply show all custom modules in the order they were defined. +The order in which custom modules are shown can be individually set by including `${custom.foo}` in the top level `format` (as it includes a dot, you need to use `${...}`). By default, the `custom` module will simply show all custom modules in the order they were defined. + +::: + +::: tip + +[Issue #1252](https://github.com/starship/starship/discussions/1252) contains examples of custom modules. If you have an interesting example not covered there, feel free to share it there! ::: ### Opciones -| Option | Por defecto | Descripción | +| Opción | Por defecto | Descripción | | ------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. | +| `command` | | The command whose output should be printed. The command will be passed on stdin to the shell. | | `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | | `shell` | | [See below](#custom-command-shell) | -| `descripción` | `""` | The description of the module that is shown when running `starship explain`. | +| `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"` | El estilo del módulo. | -| `format` | `"[$symbol$output]($style) "` | The format for the module. | +| `format` | `"[$symbol$output]($style) "` | El formato del módulo. | | `disabled` | `false` | Disables this `custom` module. | ### Variables @@ -2000,20 +2277,22 @@ The order in which custom modules are shown can be individually set by setting ` | 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` | +| symbol | Refleja el valor de la opción `symbol` | +| style\* | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo -#### Custom command shell +#### Comando personalizado de 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. +- La primera cadena es la ruta al intérprete de comandos a usar para ejecutar el comando. +- Otros argumentos siguientes son pasados al shell. If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows. +The `command` will be passed in on stdin. + If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g. ```toml @@ -2041,12 +2320,11 @@ Automatic detection of shells and proper parameters addition are currently imple command = "echo foo" # shows output of command files = ["foo"] # can specify filters when = """ test "$HOME" == "$PWD" """ -prefix = " transcending " +format = " transcending [$output]($style)" [custom.time] command = "time /T" files = ["*.pst"] -prefix = "transcending " shell = ["pwsh.exe", "-NoProfile", "-Command", "-"] ``` @@ -2054,27 +2332,27 @@ shell = ["pwsh.exe", "-NoProfile", "-Command", "-"] The `purescript` module shows the currently installed version of PureScript version. El módulo se muestra si algunas de las siguientes condiciones se cumplen: -- El directorio actual contiene un fichero `spago.dhall` -- The current directory contains a \*.purs files +- El directorio actual contiene un archivo `spago.dhall` +- El directorio actual contiene un archivo \*.purs ### Opciones -| Option | Por defecto | Descripción | +| Opción | Por defecto | Descripción | | ---------- | ---------------------------------- | ------------------------------------------------------------ | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `format` | `"via [$symbol$version]($style) "` | El formato del módulo. | | `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` | +| Variable | Ejemplo | Descripción | +| --------- | -------- | -------------------------------------- | +| version | `0.13.5` | The version of `purescript` | +| symbol | | Refleja el valor de la opción `symbol` | +| style\* | | Refleja el valor de la opción `style` | -\*: This variable can only be used as a part of a style string +\*: Esta variable sólo puede ser usada como parte de una cadena de estilo ### Ejemplo diff --git a/docs/es-ES/faq/README.md b/docs/es-ES/faq/README.md index 88dc38aa..02673aa0 100644 --- a/docs/es-ES/faq/README.md +++ b/docs/es-ES/faq/README.md @@ -10,11 +10,11 @@ - **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? +## Do top level `format` and `.disabled` do the same thing? Sí, se pueden usar ambos para desactivar los módulos en el símbolo del sistema. Si todo lo que planeas es desactivar módulos, `.disabled` es el método preferido por las siguientes razones: -- Es más evidente desactivar módulos que omitirlos usando prompt_order +- Disabling modules is more explicit than omitting them from the top level `format` - Los nuevos módulos se añadirán al símbolo del sistema en cuanto Starship se actualice ## La documentación dice que Starship es compatible con cualquier intérprete de comandos pero no soporta X Shell. ¿Por qué? @@ -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? -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`: +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`: ```sh curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux-musl diff --git a/docs/es-ES/guide/README.md b/docs/es-ES/guide/README.md index 309fd46b..5b30a9e5 100644 --- a/docs/es-ES/guide/README.md +++ b/docs/es-ES/guide/README.md @@ -30,11 +30,11 @@

- Web + Sitio Web · Instalación · -Configuration +Configuración

@@ -105,25 +105,25 @@ - **Rápido:** es rápido – _muy muy_ rápido! 🚀 -- **Customizable:** configura cada parte de tu intérprete de comandos. -- **Universal:** funciona en cualquier símbolo del sistema, en cualquier sistema operativo. +- **Personalizable:** configura cada parte de tu intérprete de comandos. +- **Universal:** funciona en cualquier intérprete de comandos, en cualquier sistema operativo. - **Inteligente:** muestra información relevante de un vistazo. - **Repleto de funciones**: con soporte para tus herramientas favoritas. -- **Fácil de instalar**: empieza a usarlo en pocos minutos. +- **Fácil:** rápido de instalar – empieza a usarlo en minutos.

-Explora la documentación de Starship   +Explora la documentación de Starship  

-## 🚀 Instalacíon +## 🚀 Instalación ### Prerequisitos -- 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)). +- Una [Nerd Font](https://www.nerdfonts.com/) instalada y habilitada en tu terminal (por ejemplo, prueba [Fira Code Nerd Font](https://www.nerdfonts.com/font-downloads)). -### Comenzando +### Comenzar 1. Instala el binario de **starship**: @@ -131,21 +131,21 @@ #### Instalar la última versión - ##### Desde un binario, con Shell: + ##### Desde un binario precontruido, con Shell: ```sh curl -fsSL https://starship.rs/install.sh | bash ``` - ##### Con [crates.io](https://crates.io/): + ##### Desde el código fuente en [crates.io](https://crates.io/): ```sh cargo install starship ``` - #### Instalar con un gestor de paquetes + #### Instalar vía un gestor de paquetes ##### Con [Homebew](https://brew.sh/): @@ -218,9 +218,9 @@ ## 🤝 Colaborando -¡Siempre estamos buscando por colaboradores de **cualquier nivel**! Si esta buscando una manera fácil de ayudar este proyecto, puede intentar a resolver una de las propuestas con la etiqueta "[good first issue](https://github.com/starship/starship/labels/🌱%20good%20first%20issue)" (primera buena propuesta). +¡Siempre estamos buscando por colaboradores de **cualquier nivel**! Si estas buscando una manera fácil de ayudar este proyecto, puedes intentar resolver un problema con la etiqueta "[good first issue](https://github.com/starship/starship/labels/🌱%20good%20first%20issue)". -Si quiere ayudar a colaborar a starship, por favor mira a nuestra [Guía de Colaboradores](https://github.com/starship/starship/blob/master/CONTRIBUTING.md) (Contributing Guide). Además, juntarse con nosotros en nuestro [servidor de Discord](https://discord.gg/8Jzqu3T) y di "¡hola!". 👋 +Si quieres ayudar a colaborar a starship, por favor mira nuestra [Guía de Colaboradores](https://github.com/starship/starship/blob/master/CONTRIBUTING.md). Además, siéntete libre de entrar en nuestro [servidor de Discord](https://discord.gg/8Jzqu3T) y di "¡Hola!". 👋 ### Desarrolladores @@ -229,7 +229,7 @@ Este proyecto existe gracias a todas las personas que han ayudado. [[Contribuir] ### Financiadores -Invierte y ayúdanos a mantener nuestra comunidad. [[Contribuir](https://opencollective.com/starship/contribute)] +Conviértete en un financiador y ayúdanos a mantener nuestra comunidad. [[Contribuir](https://opencollective.com/starship/contribute)] #### Personas @@ -237,7 +237,7 @@ Invierte y ayúdanos a mantener nuestra comunidad. [[Contribuir](https://opencol #### Organizaciones -Apoya este proyecto con tu organización. Vuestro logo se mostrará aquí con un enlace a vuestra web. [[Contribuir](https://opencollective.com/starship/contribute)] +Apoya este proyecto con tu organización. Su logo se mostrará aquí con un enlace a su sitio web. [[Contribuir](https://opencollective.com/starship/contribute)] @@ -250,11 +250,11 @@ Apoya este proyecto con tu organización. Vuestro logo se mostrará aquí con un -## 💭 Inspiración +## 💭 Inspirado por -Aquí tienes algunos de los trabajos previos que ayudaron a crear starship. 🙏 +Por favor, revisa estos proyectos que inspiraron la creación de starship. 🙏 -- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - Una prompt Zsh para astronautas. +- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - Una prompt ZSH para astronautas. - **[denysdovhan/robbyrussell-node](https://github.com/denysdovhan/robbyrussell-node)** - robbyrussel, tema multi interfaz de línea de comandos escrito en JavaScript. diff --git a/docs/es-ES/migrating-to-0.45.0/README.md b/docs/es-ES/migrating-to-0.45.0/README.md new file mode 100644 index 00000000..70827fcd --- /dev/null +++ b/docs/es-ES/migrating-to-0.45.0/README.md @@ -0,0 +1,265 @@ +# Migrating to v0.45.0 + +Starship v0.45.0 is a release containing breaking changes, in preparation for the big v1.0.0. We have made some major changes around how configuration is done on the prompt, to allow for a greater degree of customization. + +This guide is intended to walk you through the breaking changes. + +## `prompt_order` has been replaced by a root-level `format` + +Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship. + +Starship v0.45.0 will instead be accepting a `format` value, allowing for customization of the prompt outside of the modules themselves. + +**Example pre-v0.45.0 configuration** + +```toml +prompt_order = [ + "username", + "hostname", + "directory", + "git_branch", + "git_commit", + "git_state", + "git_status", + "cmd_duration", + "custom", + "line_break", + "jobs", + "battery", + "time", + "character", +] +``` + +**Example v0.45.0 configuration** + +```toml +format = """\ + $username\ + $hostname\ + $directory\ + $git_branch\ + $git_commit\ + $git_state\ + $git_status\ + $cmd_duration\ + $custom\ + $line_break\ + $jobs\ + $battery\ + $time\ + $character\ + """ +``` + +## Module `prefix` and `suffix` will be replaced by `format` + +Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered. + +Starship v0.45.0 will instead be accepting a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output. + +**Example pre-v0.45.0 configuration** + +```toml +[cmd_duration] +prefix = "took " +``` + +**Example v0.45.0 configuration** + +```toml +[cmd_duration] +# $duration – The command duration (e.g. "15s") +# $style – The default style of the module (e.g. "bold yellow") +format = "took [$duration]($style)" +``` + +### Affected Modules + +#### Character + +| Removed Property | Replacement | +| ----------------------- | ---------------- | +| `symbol` | `success_symbol` | +| `use_symbol_for_status` | `error_symbol` | +| `style_success` | `success_symbol` | +| `style_failure` | `error_symbol` | + +**Changes to the Default Configuration** + +```diff +[character] +-- symbol = "❯" +-- error_symbol = "✖" +-- use_symbol_for_status = true +-- vicmd_symbol = "❮" +++ success_symbol = "[❯](bold green) " +++ error_symbol = "[❯](bold red) " +++ vicmd_symbol = "[❮](bold green)" +``` + +Previously, the `use_symbol_for_status` property was used to configure the prompt to show the `error_symbol` when the last command resulted in a non-zero status code. + +With the release of v0.45.0, we now always use `error_symbol` after non-zero status codes, unifying `use_symbol_for_status` and `error_symbol` properties. + +To configure the prompt to use the older `use_symbol_for_status = true` configuration, add the following to your config file: + +```toml +[character] +error_symbol = "[✖](bold red) " +``` + +#### Tiempo de ejecución + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | + +**Changes to the Default Configuration** + +```diff +[cmd_duration] +-- prefix = "took " +++ format = "took [$duration]($style)" +``` + +#### Directory + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | + +**Changes to the Default Configuration** + +```diff +[directory] +-- prefix = "in " +++ format = "[$path]($style)[$lock_symbol]($lock_style)" +``` + +#### Environment Variable + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[env_var] +-- prefix = "" +-- suffix = "" +++ format = "with [$env_value]($style) " +``` + +#### Git Commit + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[git_commit] +-- prefix = "(" +-- suffix = ")" +++ format = "[\\($hash\\)]($style) " +``` + +#### Git Status + +| Removed Property | Replacement | +| ----------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | +| `show_sync_count` | `format` | + +**Changes to the Default Configuration** + +```diff +[git_status] +-- prefix = "[" +-- suffix = "]" +-- show_sync_count = false +++ format = "([$all_status$ahead_behind] )" +``` + +Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch. + +With the release of v0.45.0, this has been replaced with the + +To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file: + +```toml +[git_status] +ahead = "⇡${count}" +diverged = "⇕⇡${ahead_count}⇣${behind_count}" +behind = "⇣${count}" +``` + +#### Hostname + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[hostname] +-- prefix = "" +-- suffix = "" +++ format = "[$hostname]($style) in " +``` + +#### Singularity + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `label` | `format` | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[singularity] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol\\[$env\\]]($style) " +``` + +#### Time + +| Removed Property | Replacement | +| ---------------- | ------------- | +| `format` | `time_format` | + +**Changes to the Default Configuration** + +```diff +[time] +-- format = "🕙[ %T ]" +++ time_format = "%T" +++ format = "at 🕙[$time]($style) +``` + +#### Custom Commands + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[custom.example] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol$output]($style) " +``` diff --git a/docs/es-ES/presets/README.md b/docs/es-ES/presets/README.md index 64439db5..d470d36a 100644 --- a/docs/es-ES/presets/README.md +++ b/docs/es-ES/presets/README.md @@ -1,16 +1,16 @@ -# Preajustes +# Ajustes predeterminados -Aqui tienes una colección de preajustes creados por la comunidad de Starship. Si quieres compartir un ajuste predefinido, por favor, [envía un PR](https://github.com/starship/starship/edit/master/docs/presets/README.md) para actualizar este fichero. 😊 +Aqui hay una colección de ajustes predeterminados creados por la comunidad de Starship. ¡Si quieres compartir un ajuste predeterminado, por favor, [envía un PR](https://github.com/starship/starship/edit/master/docs/presets/README.md) actualizando este archivo! 😊 -## Símbolos de la fuente Nerd +## Símbolos Nerd Font -Este ajuste predefinido no modifica nada excepto los símbolos usados para cada módulo. Si los emojis no son lo tuyo, ¡presta atención! +Este ajuste predeterminado no modifica nada excepto los símbolos usados para cada módulo. Si los emojis no son lo tuyo, ¡esto podría llamar tu atención! -![Capturas de pantalla obtenidas de Nerd Font](/presets/nerd-font-symbols.png) +![Captura de pantalla de los ajustes predeterminados de los Símbolos Nerd Font](/presets/nerd-font-symbols.png) ### Prerequisitos -- Una [fuente Nerd](https://www.nerdfonts.com/) instalada y funcionando en tu terminal (el ejemplo usa Fira Code) +- Una [Nerd Font](https://www.nerdfonts.com/) instalada y habilitada en tu terminal (el ejemplo usa Fira Code Nerd Font) ### Configuración @@ -26,6 +26,9 @@ discharging_symbol = "" [conda] symbol = " " +[dart] +symbol = " " + [docker] symbol = " " @@ -68,6 +71,9 @@ symbol = " " [package] symbol = " " +[perl] +symbol = " " + [php] symbol = " " @@ -79,4 +85,7 @@ symbol = " " [rust] symbol = " " + +[swift] +symbol = "ﯣ " ``` diff --git a/docs/fr-FR/README.md b/docs/fr-FR/README.md index a357804f..25c58814 100644 --- a/docs/fr-FR/README.md +++ b/docs/fr-FR/README.md @@ -7,18 +7,18 @@ actionText: Commencez → actionLink: ./guide/ features: - - title: Compatibilité d'abord + title: Compatibilité avant tout details: Fonctionne sur tous les principaux shells et système d'exploitation. Utilisez-le partout ! - title: Propulsé par Rust - details: Profiter de toute la rapidité et la securité de Rust, pour rendre votre prompt le plus rapide et fiable possible. + details: Profiter de toute la rapidité et la sécurité de Rust pour rendre votre invite de commandes le plus rapide et fiable possible. - title: Personnalisable - details: Tous les petits détails sont personnalisable à votre goût, pour rendre votre prompt aussi léger ou complet que le vous souhaitez. -footer: ISC licencié | Copyright © 2019-present Starship Contributors + details: Tous les petits détails sont personnalisable à votre goût, pour rendre votre invite de commandes aussi léger ou complet que le vous souhaitez. +footer: Licence ISC | Copyright © 2019-présent Contributeurs Starship #Used for the description meta tag, for SEO -metaTitle: "Starship: Invite Cross-Shell" -description: Starship est un invite minimaliste, ultra-rapide et hautement personnalisable pour n'importe quel shell ! Montrez les informations dont vous avez besoin, tout en restant élégant et minimaliste. Installation rapide disponible pour Bash, Fish, ZSH, Ion et PowerShell. +metaTitle: "Starship : Invite Multi-Shell" +description: Starship est un invite minimaliste, ultra-rapide et hautement personnalisable pour n'importe quel shell ! Montre les informations dont vous avez besoin tout en restant élégant et minimaliste. Installation rapide disponible pour Bash, Fish, ZSH, Ion et PowerShell. ---
@@ -56,7 +56,7 @@ description: Starship est un invite minimaliste, ultra-rapide et hautement perso scoop install starship ``` -1. Ajouter le script d'initialization à la fiche config de votre shell: +1. Ajouter le script d’initialisation au fichier configuration de votre shell: #### Bash diff --git a/docs/fr-FR/advanced-config/README.md b/docs/fr-FR/advanced-config/README.md index 0c8eba70..9bba9e70 100644 --- a/docs/fr-FR/advanced-config/README.md +++ b/docs/fr-FR/advanced-config/README.md @@ -1,16 +1,16 @@ # Configuration avancée -Alors que Starship est un shell polyvalent, vous devez parfois faire plus que d'éditer `starship.toml` pour le faire les choses. Cette page détaille quelques techniques de configuration avancées qu'on peut utiliser dans starship. +Même si Starship est un shell polyvalent, éditer `starship.toml` ne suffit parfois pas pour faire certaines choses. Cette page détaille quelques techniques de configuration avancées utilisées dans starship. ::: warning -Les configurations de cette section sont sujettes à modification dans les versions à venir de Starship. +Les configurations dans cette section sont sujettes à modification dans les futures versions de Starship. ::: -## Commandes pré-commande et pré-exécution personnalisées en Bash +## Personnalisation des commandes pré-commande et pré-exécution en Bash -Bash n'a pas de cadre officiel préexec/précmd comme la plupart des autres shell du commande. C'est pourquoi il est difficile de fournir des crochets entièrement personnalisables dans `bash`. Cependant, Starship vous donne une capacité limitée à insérer vos propres fonctions dans la procédure de rendu commande : +Bash n'a pas de structure officielle préexec/précmd comme la plupart des autres shells. C'est pourquoi il est difficile de fournir des hooks entièrement personnalisables dans `bash`. Cependant, Starship vous donne une capacité limitée à insérer vos propres fonctions dans la procédure de rendu commande : - Pour exécuter une fonction personnalisée juste avant que commande soit dessinée, définissez une nouvelle fonction et assignez son nom à `starship_precmd_user_func`. Par exemple, pour dessiner une fusée avant la commande, vous feriez diff --git a/docs/fr-FR/config/README.md b/docs/fr-FR/config/README.md index 017ba43f..1b82e7c1 100644 --- a/docs/fr-FR/config/README.md +++ b/docs/fr-FR/config/README.md @@ -1,33 +1,27 @@ # Configuration -::: tip - -🔥 La configuration est en train d'être travaillée. Beaucoup de nouvelles options de configuration seront disponibles dans les prochaines versions. - -::: - Pour commencer à configurer starship, créez le fichier suivant : `~/.config/starship.toml`. ```sh 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) : +Toute la configuration de starship est faite dans ce fichier [TOML](https://github.com/toml-lang/toml): ```toml -# Don't print a new line at the start of the prompt +# N'écrivez pas une nouvelle ligne au début de la console add_newline = false -# 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" +# Remplacez le symbole "❯" dans la console avec "➜" +[character] # Le nom du module que nous configurons est "character" +success_symbol = "[➜](bold green)" # Le segment "success_symbol" est mis comme "➜" avec la couleur "bold green" -# Disable the package module, hiding it from the prompt completely +# Désactivez le module package, le masquant complètement dans la console [package] disabled = true ``` -Vous pouvez changer l'emplacement du fichier de configuration `starship.toml` grâce à la variable d'environnement `STARSHIP_CONFIG`: +Vous pouvez changer l'emplacement par défaut du fichier `starship.toml` avec la variable d'environnement `STARSHIP_CONFIG` : ```sh export STARSHIP_CONFIG=~/.starship @@ -39,9 +33,23 @@ De manière équivalente, pour Powershell (Windows), ajoutez la ligne suivante $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` -### Terminologie +### Logging -**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. +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: + +```sh +export STARSHIP_CACHE=~/.starship/cache +``` + +De manière équivalente, pour Powershell (Windows), ajoutez la ligne suivante à votre `$PROFILE`: + +```ps1 +$ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" +``` + +### Terminology + +**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. **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. @@ -57,11 +65,11 @@ A variable contains a `$` symbol followed by the name of the variable. The name 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. +- `$version` est une chaîne de formatage avec une variable nommée `version`. +- `$git_branch$git_commit` est une chaîne de formatage avec deux variables appelées `git_branch` et `git_commit`. +- `$git_branch $git_commit` a les deux variables séparées par un espace. -#### Text Group +#### Groupe de texte A text group is made up of two different parts. @@ -71,38 +79,38 @@ In the second part, which is enclosed in a `()`, is a [style string](#style-stri 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. +- `[on](red bold)` affichera une chaîne de caractères `on` avec un texte gras de couleur rouge. +- `[⬢ $version](bold green)` affichera un symbole `⬢` suivi du contenu de la variable `version`, avec un texte en gras de couleur verte. +- `[a [b](red) c](green)` affichera `a b c` avec `b` rouge, et `a` et `c` vert. #### 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/). +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/). - `"fg:green bg:blue"` définit un texte vert sur un fond bleu - `"bg:blue fg:bright-green"` définit un texte vert clair sur un fond bleu - `"bold fg:27"` définit le texte en gras avec la [couleur ANSI](https://i.stack.imgur.com/KTSQa.png) 27 - `"underline bg:#bf5700"` définit le texte en souligné sur un fond orange foncé -- `"bold italic fg:violet"` définit le texte en italique et gras sur un fond violet +- `"bold italic fg:purple"` définit le texte en italique et gras sur un fond violet - `""` désactive explicitement tous les styles -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. +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 +#### Chaînes de formatage conditionnel 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\] )`. +- `(@$region)` ne montrera rien si la variable `région` est `None`, sinon `@` suivi de la valeur de la région. +- `(some text)` ne montrera toujours rien puisqu'il n'y a pas de variables enveloppées dans les accolades. +- Lorsque `$all` est un raccourci pour `\[$a$b\]`, `($all)` ne montrera rien que si `$a` et `$b` sont tous les deux `None`. Cela fonctionne comme `(\[$a$b\] )`. -#### Escapable characters +#### Caractère d’échappement 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 (`\`). -- $ +- \$ - \\ - [ - ] @@ -130,23 +138,21 @@ format = ''' ## Invite -Voici la liste des options de configuration de l'invite en lui-même. +This is the list of prompt-wide configuration options. ### Options -| 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). | +| Option | Défaut | Description | +| -------------- | ------------------------------ | -------------------------------------------------------------------------- | +| `format` | [lien](#default-prompt-format) | Configure le format de l'invite. | +| `scan_timeout` | `30` | Délai d'attente avant que starship scanne les fichiers (en millisecondes). | +| `add_newline` | `true` | Ajoute une nouvelle ligne a début de l'invite. | ### Exemple ```toml # ~/.config/starship.toml -# Disable the newline at the start of the prompt -format = "$all" - # Use custom format format = """ [┌───────────────────>](bold green) @@ -155,20 +161,23 @@ format = """ # Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 + +# Disable the newline at the start of the prompt +add_newline = false ``` ### Default Prompt Format -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 : +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 -format = "\n$all" +format = "$all" # Which is equivalent to format = """ - $username\ $hostname\ +$shlvl\ $kubernetes\ $directory\ $git_branch\ @@ -179,6 +188,7 @@ $hg_branch\ $docker_context\ $package\ $cmake\ +$dart\ $dotnet\ $elixir\ $elm\ @@ -190,17 +200,20 @@ $julia\ $nim\ $nodejs\ $ocaml\ +$perl\ $php\ $purescript\ $python\ $ruby\ $rust\ +$swift\ $terraform\ $zig\ $nix_shell\ $conda\ $memory_usage\ $aws\ +$gcloud\ $env_var\ $crystal\ $cmd_duration\ @@ -209,39 +222,40 @@ $line_break\ $jobs\ $battery\ $time\ +$status\ $character""" ``` ## AWS -Le module `aws` affiche la région et le profil AWS courant. Ces informations sont basées sur les variables d'environnement `AWS_REGION`, `AWS_DEFAULT_REGION`, et `AWS_PROFILE` ainsi que le fichier `~/.aws/config`. +The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. -Quand [aws-vault](https://github.com/99designs/aws-vault) est utilisé, la valeur du profil est lu dans la variable d'environnement: `AWS_VAULT`. +When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var. ### Options -| 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`. | +| Option | Default | Description | +| ---------------- | ---------------------------------------------------- | -------------------------------------------------------- | +| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | Format du module. | +| `symbol` | `"☁️ "` | Le symbole affiché avant le profil AWS actuel. | +| `region_aliases` | | Table des alias de région à afficher en plus du nom AWS. | +| `style` | `"bold yellow"` | Le style du module. | +| `disabled` | `false` | Désactive le module `AWS`. | ### 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` | +| Variable | Exemple | Description | +| --------- | ---------------- | -------------------------------------- | +| region | `ap-northeast-1` | La région AWS actuelle | +| profile | `astronauts` | Le profil AWS actuel | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string ### Examples -#### Display everything +#### Tout afficher ```toml # ~/.config/starship.toml @@ -255,7 +269,7 @@ ap-southeast-2 = "au" us-east-1 = "va" ``` -#### Display region +#### Afficher la région ```toml # ~/.config/starship.toml @@ -269,7 +283,7 @@ ap-southeast-2 = "au" us-east-1 = "va" ``` -#### Display profile +#### Afficher le profil ```toml # ~/.config/starship.toml @@ -291,17 +305,17 @@ The `battery` module shows how charged the device's battery is and its current c | `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. | +| `format` | `"[$symbol$percentage]($style) "` | Format du 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. -| Variable | Description | -| ---------------- | --------------------------------------------------- | -| `unknown_symbol` | The symbol shown when the battery state is unknown. | -| `empty_symbol` | The symbol shown when the battery state is empty. | +| Variable | Description | +| ---------------- | ------------------------------------------------------------- | +| `unknown_symbol` | Le symbole affiché lorsque l'état de la batterie est inconnu. | +| `empty_symbol` | Le symbole affiché lorsque la batterie est vide. | Note: Battery indicator will be hidden if the status is `unknown` or `empty` unless you specify the option in the config. @@ -320,7 +334,7 @@ discharging_symbol = "💀" ### Battery Display -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. La valeur par défaut est la suivante : +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: ```toml [[battery.display]] @@ -332,10 +346,10 @@ style = "bold red" The `display` option is an array of the following table. -| Variable | Description | -| ----------- | ----------------------------------------------- | -| `threshold` | The upper bound for the display option. | -| `style` | The style used if the display option is in use. | +| Variable | Description | +| ----------- | -------------------------------------------------- | +| `threshold` | La limite supérieure pour l'option d'affichage. | +| `style` | Le style de l'option display si elle est utilisée. | #### Exemple @@ -352,36 +366,36 @@ style = "bold yellow" ``` -## Character +## Caractères 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: -- changing color (`red`/`green`) -- changing shape (`❯`/`✖`) +- changement de couleur (`red`/`green`) +- changement de forme (`❯`/`✖`) 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 -| 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. | +| Option | Default | Description | +| ---------------- | ------------------- | ----------------------------------------------------------------------------- | +| `format` | `"$symbol "` | Le format utilisée avant l'entrée de texte. | +| `success_symbol` | `"[❯](bold green)"` | Le format utilisé avant l'entrée de texte si la commande précédente a réussi. | +| `error_symbol` | `"[❯](bold red)"` | Le format utilisé avant l'entrée de texte si la commande précédente a échoué. | +| `vicmd_symbol` | `"[❮](bold green)"` | Le format utilisé avant l'entrée de texte si le shell est en mode vim normal. | +| `disabled` | `false` | Désactive le module `character`. | ### Variables -| Variable | Exemple | Description | -| -------- | ------- | --------------------------------------------------------------------- | -| symbol | | A mirror of either `success_symbol`, `error_symbol` or `vicmd_symbol` | +| Variable | Exemple | Description | +| -------- | ------- | --------------------------------------------------------------- | +| symbol | | Reflète sois `success_symbol`, `error_symbol` ou `vicmd_symbol` | ### Examples -#### With custom error shape +#### Avec une forme d'erreur personnalisée ```toml # ~/.config/starship.toml @@ -391,7 +405,7 @@ success_symbol = "[➜](bold green) " error_symbol = "[✗](bold red) " ``` -#### Without custom error shape +#### Sans forme d'erreur personnalisée ```toml # ~/.config/starship.toml @@ -401,7 +415,7 @@ success_symbol = "[➜](bold green) " error_symbol = "[➜](bold red) " ``` -#### With custom vim shape +#### Avec une forme vim personnalisée ```toml # ~/.config/starship.toml @@ -414,28 +428,28 @@ vicmd_symbol = "[V](bold green) " The `cmake` module shows the currently installed version of CMake if: -- The current directory contains a `CMakeLists.txt` file +- Le répertoire actuel contient un fichier `CMakeLists.txt` ### 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. | +| Option | Default | Description | +| ---------- | ---------------------------------- | --------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | Format du module. | +| `symbol` | `"🛆 "` | Le symbole utilisé avant la version de cmake. | +| `style` | `"bold blue"` | Le style du module. | +| `disabled` | `false` | Désactive le module `cmake`. | ### 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` | +| Variable | Exemple | Description | +| --------- | --------- | -------------------------------------- | +| version | `v3.17.3` | La version de cmake | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string -## Command Duration +## Temps d'exécution 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. @@ -449,20 +463,20 @@ Bash users who need preexec-like functionality can use [rcaloras's bash_preexec ### Options -| 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. | +| Option | Default | Description | +| ------------------- | ----------------------------- | ----------------------------------------------------------------- | +| `min_time` | `2_000` | Durée la plus courte quand afficher le temps (en millisecondes). | +| `show_milliseconds` | `false` | Afficher les millisecondes en plus des secondes pendant la durée. | +| `format` | `"took [$duration]($style) "` | Format du module. | +| `style` | `"bold yellow"` | Le style du module. | +| `disabled` | `false` | Désactive le module `cmd_duration`. | ### Variables -| Variable | Exemple | Description | -| --------- | -------- | --------------------------------------- | -| duration | `16m40s` | The time it took to execute the command | -| style\* | | Mirrors the value of option `style` | +| Variable | Exemple | Description | +| --------- | -------- | --------------------------------------------- | +| duration | `16m40s` | Le temps nécessaire pour exécuter la commande | +| style\* | | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string @@ -493,16 +507,17 @@ This does not suppress conda's own prompt modifier, you may want to run `conda c | `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. | +| `format` | `"[$symbol$environment]($style) "` | Format du module. | +| `ignore_base` | `true` | Ignores `base` environment when activated. | | `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` | +| Variable | Exemple | Description | +| ----------- | ------------ | -------------------------------------- | +| environment | `astronauts` | The current conda environment | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string @@ -528,16 +543,16 @@ The `crystal` module shows the currently installed version of Crystal. Le module | ---------- | ---------------------------------- | --------------------------------------------------------- | | `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. | +| `format` | `"via [$symbol$version]($style) "` | Format du 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` | +| Variable | Exemple | Description | +| --------- | --------- | -------------------------------------- | +| version | `v0.32.1` | The version of `crystal` | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string @@ -550,6 +565,42 @@ The `crystal` module shows the currently installed version of Crystal. Le module format = "via [✨ $version](bold blue) " ``` +## Dart + +The `dart` module shows the currently installed version of Dart. Le module est affiché si l'une des ces conditions est remplie : + +- The current directory contains a file with `.dart` extension +- The current directory contains a `.dart_tool` directory +- The current directory contains a `pubspec.yaml` or `pubspec.lock` file + +### Options + +| Variable | Default | Description | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | Format du module. | +| `symbol` | `"🎯 "` | A format string representing the symbol of Dart | +| `style` | `"bold blue"` | Le style du module. | +| `disabled` | `false` | Disables the `dart` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | -------- | -------------------------------------- | +| version | `v2.8.4` | The version of `dart` | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemple + +```toml +# ~/.config/starship.toml + +[dart] +format = "via [🔰 $version](bold red) " +``` + ## Directory The `directory` module shows the path to your current directory, truncated to three parent folders. Your directory will also be truncated to the root of the git repo that you're currently in. @@ -560,11 +611,11 @@ For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root, an ### Options -| Variable | Default | Description | +| Variable | Défaut | Description | | ------------------------ | ----------------------------------------------- | -------------------------------------------------------------------------------- | | `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | | `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | -| `format` | `"[$path]($style)[$lock_symbol]($lock_style) "` | The format for the module. | +| `format` | `"[$path]($style)[$lock_symbol]($lock_style) "` | Format du 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. | @@ -593,10 +644,10 @@ 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` | +| Variable | Exemple | Description | +| --------- | --------------------- | ------------------------------------- | +| path | `"D:/Projects"` | The current directory path | +| style\* | `"black bold dimmed"` | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string @@ -617,7 +668,7 @@ The `docker_context` module shows the currently active [Docker context](https:// | Option | Default | Description | | ----------------- | ---------------------------------- | --------------------------------------------------------------------------------------- | -| `format` | `"via [$symbol$context]($style) "` | The format for the module. | +| `format` | `"via [$symbol$context]($style) "` | Format du 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. | @@ -625,11 +676,11 @@ The `docker_context` module shows the currently active [Docker context](https:// ### 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` | +| Variable | Exemple | Description | +| --------- | -------------- | -------------------------------------- | +| context | `test_context` | The current docker context | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string @@ -668,7 +719,7 @@ The module will also show the Target Framework Moniker ( ⚠️ The version being shown is that of the package whose source code is in your current directory, not your package manager. @@ -1520,7 +1641,7 @@ The `package` module is shown when the current directory is the repository for a | Option | Default | Description | | ----------------- | ---------------------------------- | ---------------------------------------------------------- | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `format` | `"via [$symbol$version]($style) "` | Format du 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. | @@ -1528,11 +1649,11 @@ The `package` module is shown when the current directory is the repository for a ### 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` | +| Variable | Exemple | Description | +| --------- | -------- | -------------------------------------- | +| version | `v1.0.0` | The version of your package | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string @@ -1567,11 +1688,11 @@ The `ocaml` module shows the currently installed version of OCaml. Le module est ### 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` | +| Variable | Exemple | Description | +| --------- | --------- | -------------------------------------- | +| version | `v4.10.0` | The version of `ocaml` | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string @@ -1584,6 +1705,42 @@ The `ocaml` module shows the currently installed version of OCaml. Le module est format = "via [🐪 $version]($style) " ``` +## Perl + +The `perl` module shows the currently installed version of Perl. Le module est affiché si l'une des ces conditions est remplie : + +- The current directory contains a `Makefile.PL` or `Build.PL` file +- The current directory contains a `cpanfile` or `cpanfile.snapshot` file +- The current directory contains a `META.json` file or `META.yml` file +- The current directory contains a `.perl-version` file +- The current directory contains a `.pl`, `.pm` or `.pod` + +### Options + +| Variable | Default | Description | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format string for the module. | +| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl | +| `style` | `"bold 149"` | Le style du module. | +| `disabled` | `false` | Disables the `perl` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | --------- | -------------------------------------- | +| version | `v5.26.1` | The version of `perl` | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | + +### Exemple + +```toml +# ~/.config/starship.toml + +[perl] +format = "via [🦪 $version]($style) " +``` + ## PHP The `php` module shows the currently installed version of PHP. Le module est affiché si l'une des ces conditions est remplie : @@ -1594,20 +1751,20 @@ The `php` module shows the currently installed version of PHP. Le module est aff ### Options -| Option | Default | Description | +| Option | Défaut | Description | | ---------- | ---------------------------------- | ----------------------------------------------------- | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `format` | `"via [$symbol$version]($style) "` | Format du 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` | +| Variable | Exemple | Description | +| --------- | -------- | -------------------------------------- | +| version | `v7.3.8` | The version of `php` | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string @@ -1640,28 +1797,30 @@ Le module est affiché si l'une des ces conditions est remplie : ### Options -| 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. | +| Option | Défaut | Description | +| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | Format du module. | +| `symbol` | `"🐍 "` | A format string representing the symbol of Python | +| `style` | `"yellow bold"` | Le style du module. | +| `pyenv_version_name` | `false` | Use pyenv to get Python version | +| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `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 | +| Variable | Exemple | Description | +| ------------ | --------------- | ------------------------------------------ | +| version | `"v3.8.1"` | The version of `python` | +| symbol | `"🐍 "` | Reflète la valeur de l'option `symbol` | +| style | `"yellow bold"` | Reflète la valeur de l'option `style` | +| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` | +| virtualenv | `"venv"` | The current `virtualenv` name |
This module has some advanced configuration options. -| Variable | Default | Description | +| Variable | Défaut | Description | | --------------- | -------- | ----------------------------------------------------------------------------- | | `python_binary` | `python` | Configures the python binary that Starship executes when getting the version. | @@ -1684,7 +1843,6 @@ python_binary = "python3" [python] symbol = "👾 " pyenv_version_name = true -pyenv_prefix = "foo " ``` ## Ruby @@ -1699,18 +1857,18 @@ The `ruby` module shows the currently installed version of Ruby. Le module est a | Option | Default | Description | | ---------- | ---------------------------------- | ------------------------------------------------ | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `format` | `"via [$symbol$version]($style) "` | Format du 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` | +| Variable | Exemple | Description | +| --------- | -------- | -------------------------------------- | +| version | `v2.5.1` | The version of `ruby` | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string @@ -1734,18 +1892,18 @@ The `rust` module shows the currently installed version of Rust. Le module est a | Option | Default | Description | | ---------- | ---------------------------------- | ----------------------------------------------- | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `format` | `"via [$symbol$version]($style) "` | Format du 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` | +| Variable | Exemple | Description | +| --------- | ----------------- | -------------------------------------- | +| version | `v1.43.0-nightly` | The version of `rustc` | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string @@ -1758,6 +1916,41 @@ The `rust` module shows the currently installed version of Rust. Le module est a format = "via [⚙️ $version](red bold)" ``` +## SHLVL + +The `shlvl` module shows the current SHLVL ("shell level") environment variable, if it is set to a number and meets or exceeds the specified threshold. + +### Options + +| Variable | Default | Description | +| ----------- | ---------------------------- | --------------------------------------- | +| `threshold` | `2` | Display threshold. | +| `format` | `"[$symbol$shlvl]($style) "` | Format du module. | +| `symbol` | `"↕️ "` | The symbol used to represent the SHLVL. | +| `style` | `"bold yellow"` | Le style du module. | +| `disabled` | `true` | Disables the `shlvl` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | ------- | -------------------------------------- | +| shlvl | `3` | The current value of SHLVL | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemple + +```toml +# ~/.config/starship.toml + +[shlvl] +disabled = false +format = "$shlvl level(s) down" +threshold = 3 +``` + ## Singularity The `singularity` module shows the current singularity image, if inside a container and `$SINGULARITY_NAME` is set. @@ -1766,18 +1959,18 @@ The `singularity` module shows the current singularity image, if inside a contai | Option | Default | Description | | ---------- | ------------------------------------ | ------------------------------------------------ | -| `format` | `"[$symbol\\[$env\\]]($style) "` | The format for the module. | +| `format` | `"[$symbol\\[$env\\]]($style) "` | Format du module. | | `symbol` | `""` | A format string displayed before the image name. | | `style` | `"bold dimmed blue"` | Le style du module. | | `disabled` | `false` | Disables the `singularity` module. | ### 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` | +| Variable | Exemple | Description | +| --------- | ------------ | -------------------------------------- | +| env | `centos.img` | The current singularity image | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string @@ -1790,6 +1983,83 @@ The `singularity` module shows the current singularity image, if inside a contai format = "[📦 \\[$env\\]]($style) " ``` +## Swift + +The `swift` module shows the currently installed version of Swift. Le module est affiché si l'une des ces conditions est remplie : + +- The current directory contains a `Package.swift` file +- The current directory contains a file with the `.swift` extension + +### Options + +| Option | Default | Description | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | Format du module. | +| `symbol` | `"🐦 "` | A format string representing the symbol of Swift | +| `style` | `"bold 202"` | Le style du module. | +| `disabled` | `false` | Disables the `swift` module. | + +### Variables + +| Variable | Exemple | Description | +| --------- | -------- | -------------------------------------- | +| version | `v5.2.4` | The version of `swift` | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | + +\*: This variable can only be used as a part of a style string + +### Exemple + +```toml +# ~/.config/starship.toml + +[swift] +format = "via [🏎 $version](red bold)" +``` + +## Status + +The `status` module displays the exit code of the previous command. The module will be shown only if the exit code is not `0`. + +::: tip + +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: + +### Options + +| Variable | Default | Description | +| ---------- | -------------------------- | ------------------------------------------------------ | +| `format` | `[$symbol$status]($style)` | The format of the module | +| `symbol` | `"✖"` | A format string representing the symbol for the status | +| `style` | `"bold green"` | Le style du module. | +| `disabled` | `true` | Disables the `status` module. | + + +### Variables + +| Variable | Exemple | Description | +| --------- | ------- | -------------------------------------- | +| status | `127` | The exit code of the last command | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | + +\*: This variable can only be used as a part of a style string + + +### Exemple +```toml + +# ~/.config/starship.toml + +[status] +style = "bg:blue" +symbol = "💣 " +format = "[\\[$symbol$status\\]]($style) " +disabled = false + +``` + ## 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. 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 : @@ -1799,7 +2069,7 @@ The `terraform` module shows the currently selected terraform workspace and vers ### Options -| Option | Default | Description | +| Option | Défaut | Description | | ---------- | ------------------------------------ | ----------------------------------------------------- | | `format` | `"via [$symbol$workspace]($style) "` | The format string for the module. | | `symbol` | `"💠 "` | A format string shown before the terraform workspace. | @@ -1808,12 +2078,12 @@ The `terraform` module shows the currently selected terraform workspace and vers ### 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` | +| Variable | Exemple | Description | +| --------- | ---------- | -------------------------------------- | +| version | `v0.12.24` | The version of `terraform` | +| workspace | `default` | The current terraform workspace | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string @@ -1837,36 +2107,36 @@ format = "[🏎💨 $version$workspace]($style) " format = "[🏎💨 $workspace]($style) " ``` -## Temps +## Time -Le module `time` affiche l'heure actuelle **localement**. La valeur de `format` est utilisée par le package [`chrono`](https://crates.io/crates/chrono) pour contrôler la façon dont l'heure est affichée. Consultez la [doc de chrono strftime](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) pour découvrir les options disponibles. +The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available. ::: tip -Ce module est désactivé par défaut. Pour l'activer, configurez `disabled` sur `false` dans votre fichier de configuration. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: ### Options -| 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 | +| Option | Défaut | 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 `time_format` defaults to `"%r"`. Sinon, il est défini comme `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. ### Variables -| Variable | Exemple | Description | -| --------- | ---------- | ----------------------------------- | -| temps | `13:08:10` | The current time. | -| style\* | | Mirrors the value of option `style` | +| Variable | Exemple | Description | +| --------- | ---------- | ------------------------------------- | +| time | `13:08:10` | The current time. | +| style\* | | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string @@ -1883,24 +2153,24 @@ utc_time_offset = "-5" time_range = "10:00:00-14:00:00" ``` -## Nom d'utilisateur +## Username -Le module `username` affiche le nom d'utilisateur de l'utilisateur actif. Le module est affiché si l'une des ces conditions est remplie : +The `username` module shows active user's username. Le module est affiché si l'une des ces conditions est remplie : -- L'utilisateur courant est root -- L'utilisateur courant est différent de celui connecté -- L'utilisateur est actuellement connecté à une session SSH -- La variable `show_always` a comme valeur true +- The current user is root +- The current user isn't the same as the one that is logged in +- The user is currently connected as an SSH session +- The variable `show_always` is set to true ### Options -| 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`. | +| Option | Défaut | Description | +| ------------- | ----------------------- | ------------------------------------- | +| `style_root` | `"bold green"` | The style used when the user is root. | +| `style_user` | `"bold yellow"` | The style used for non-root users. | +| `format` | `"[$user]($style) in "` | Format du module. | +| `show_always` | `false` | Always shows the `username` module. | +| `disabled` | `false` | Disables the `username` module. | ### Variables @@ -1930,20 +2200,20 @@ The `zig` module shows the currently installed version of Zig. Le module est aff ### Options -| Option | Default | Description | +| Option | Défaut | 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. | +| `format` | `"via [$symbol$version]($style) "` | Format du 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` | +| Variable | Exemple | Description | +| --------- | -------- | -------------------------------------- | +| version | `v0.6.0` | The version of `zig` | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string @@ -1975,15 +2245,21 @@ Multiple custom modules can be defined by using a `.`. ::: tip -The order in which custom modules are shown can be individually set by setting `custom.foo` in `prompt_order`. By default, the `custom` module will simply show all custom modules in the order they were defined. +The order in which custom modules are shown can be individually set by including `${custom.foo}` in the top level `format` (as it includes a dot, you need to use `${...}`). By default, the `custom` module will simply show all custom modules in the order they were defined. + +::: + +::: tip + +[Issue #1252](https://github.com/starship/starship/discussions/1252) contains examples of custom modules. If you have an interesting example not covered there, feel free to share it there! ::: ### Options -| Option | Default | Description | +| Option | Défaut | Description | | ------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. | +| `command` | | The command whose output should be printed. The command will be passed on stdin to the shell. | | `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | | `shell` | | [See below](#custom-command-shell) | | `description` | `""` | The description of the module that is shown when running `starship explain`. | @@ -1992,7 +2268,7 @@ The order in which custom modules are shown can be individually set by setting ` | `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. | +| `format` | `"[$symbol$output]($style) "` | Format du module. | | `disabled` | `false` | Disables this `custom` module. | ### Variables @@ -2000,8 +2276,8 @@ The order in which custom modules are shown can be individually set by setting ` | Variable | Description | | --------- | -------------------------------------- | | output | The output of shell command in `shell` | -| symbol | Mirrors the value of option `symbol` | -| style\* | Mirrors the value of option `style` | +| symbol | Reflète la valeur de l'option `symbol` | +| style\* | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string @@ -2014,6 +2290,8 @@ The order in which custom modules are shown can be individually set by setting ` If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows. +The `command` will be passed in on stdin. + If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g. ```toml @@ -2041,38 +2319,37 @@ Automatic detection of shells and proper parameters addition are currently imple command = "echo foo" # shows output of command files = ["foo"] # can specify filters when = """ test "$HOME" == "$PWD" """ -prefix = " transcending " +format = " transcending [$output]($style)" [custom.time] command = "time /T" files = ["*.pst"] -prefix = "transcending " shell = ["pwsh.exe", "-NoProfile", "-Command", "-"] ``` ## PureScript -Le module `purescript` affiche la version courante de Purescript installée. Le module est affiché si l'une des ces conditions est remplie : +The `purescript` module shows the currently installed version of PureScript version. Le module est affiché si l'une des ces conditions est remplie : - The current directory contains a `spago.dhall` file - The current directory contains a \*.purs files ### Options -| 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`. | +| Option | Défaut | Description | +| ---------- | ---------------------------------- | ------------------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | Format du module. | +| `symbol` | `"<=> "` | The symbol used before displaying the version of PureScript. | +| `style` | `"bold white"` | Le style du module. | +| `disabled` | `false` | Disables the `purescript` module. | ### 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` | +| Variable | Exemple | Description | +| --------- | -------- | -------------------------------------- | +| version | `0.13.5` | The version of `purescript` | +| symbol | | Reflète la valeur de l'option `symbol` | +| style\* | | Reflète la valeur de l'option `style` | \*: This variable can only be used as a part of a style string diff --git a/docs/fr-FR/faq/README.md b/docs/fr-FR/faq/README.md index 2888edeb..01bc562b 100644 --- a/docs/fr-FR/faq/README.md +++ b/docs/fr-FR/faq/README.md @@ -5,16 +5,16 @@ - **Émulateur de terminal**: [iTerm2](https://iterm2.com/) - **Thème** : Minimal - **Palette de couleurs**: [Snazzy](https://github.com/sindresorhus/iterm2-snazzy) - - **Font**: [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads) + - **Police**: [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/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish) - **Invite de commande**: [Starship](https://starship.rs/) -## Est-ce que `prompt_order` et `.disabled` font la même chose ? +## Est-ce que l'option globale `format` et `.disabled` font la même chose ? Oui, ils peuvent tous deux être utilisés pour désactiver les modules dans l'invite de commande. Si tout ce que vous prévoyez de faire est de désactiver les modules, `.disabled` est le meilleur moyen de le faire pour ces raisons : -- Désactiver les modules est plus explicite que de les omettre dans le prompt_order +- Disabling modules is more explicit than omitting them from the top level `format` - Les modules nouvellement créés seront ajoutés à l'invite de commande au fur et à mesure que Starship sera mis à jour ## La doc dit que Starship est cross-shell, mais il ne supporte pas X shell. Pourquoi ? @@ -44,9 +44,9 @@ starship prompt --help L'invite de commande utilisera toutes les données contextuelles fournies, mais aucun indicateur n'est "requis". -## How do I run Starship on Linux distributions with older versions of glibc? +## Comment utiliser Starship sur des distributions Linux avec des versions de glibc plus ancienne ? -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`: +Si vous obtenez une erreur du type "_version 'GLIBC_2.18' not found (required by starship)_" lors de l'utilisation du binaire précompilé (par exemple sur CentOS 6 ou 7), vous pouvez utiliser un binaire compilé avec `musl` au lieu de `glibc`: ```sh curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux-musl diff --git a/docs/fr-FR/guide/README.md b/docs/fr-FR/guide/README.md index ddced0f0..0b7ed384 100644 --- a/docs/fr-FR/guide/README.md +++ b/docs/fr-FR/guide/README.md @@ -107,12 +107,12 @@ - **Rapide** : il est rapide - _vraiment vraiment_ rapide ! 🚀 - **Personnalisable:** configurer chaque élément de votre invite. - **Universel:** fonctionne avec n'importe quel shell, sur n'importe quel système d'exploitation. -- **Intelligent:** affiche les informations utiles en un coup d'oeil. +- **Intelligent:** affiche les informations utiles en un coup d'œil. - **Riche en fonctionnalités:** supporte tous vos outils favoris. - **Facile:** rapide à installer - commencer à l'utiliser en quelques minutes.

-Consulter la documentation de Starship  ▶ +Consulter la documentation de Starship  ▶

@@ -131,7 +131,7 @@ #### Installer la dernière version - ##### Depuis une version pré-compilée depuis le shell: + ##### Depuis une version pré-compilée, depuis le shell: ```sh curl -fsSL https://starship.rs/install.sh | bash @@ -161,7 +161,7 @@ scoop install starship ``` -1. Ajouter le script d'initialization à la fiche config de votre shell: +1. Ajouter le script d’initialisation au fichier de configuration de votre shell: #### Bash @@ -218,11 +218,11 @@ ## 🤝Contribution -Nous sommes toujours à la recherche de contributeurs de **tous les niveaux de compétence**! Si vous cherchez à faciliter votre entrée dans le projet, essayez un [good first issue](https://github.com/starship/starship/labels/🌱%20good%20first%20issue). +Nous sommes toujours à la recherche de contributeurs de **tous niveaux de compétence**! Si vous cherchez à faciliter votre entrée dans le projet, essayez un [good first issue](https://github.com/starship/starship/labels/🌱%20good%20first%20issue). -Si vous êtes intéressé à aider à contribuer à Starship, veuillez jeter un coup d'oeil à notre [Guide de contribution](https://github.com/starship/starship/blob/master/CONTRIBUTING.md). Aussi, n'hésitez pas à vous rendre sur notre [serveur Discord](https://discord.gg/8Jzqu3T) pour dire bonjour. 👋 +Si vous êtes intéressé pour aider et contribuer à Starship, veuillez jeter un coup d'œil à notre [Guide de contribution](https://github.com/starship/starship/blob/master/CONTRIBUTING.md). Aussi, n'hésitez pas à vous rendre sur notre [serveur Discord](https://discord.gg/8Jzqu3T) pour dire bonjour. 👋 -### Contributeurs de code +### Contributeurs Ce projet existe grâce à toutes les personnes qui y contribuent. [[Contribuer](https://github.com/starship/starship/blob/master/CONTRIBUTING.md)]. @@ -252,11 +252,11 @@ Soutenez ce projet avec votre organisation. Votre logo apparaîtra ici avec un l ## 💭Inspiré par -Voyez ces travaux précédents qui ont contribué à inspirer la création de vaisseau. 🙏 +Jetez un œil aux précédents projets qui ont inspiré la création de starship. 🙏 -- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - Un ZSH prompt pour les astronautes. +- **[denysdovhan/spaceship-prompt](https://github.com/denysdovhan/spaceship-prompt)** - Un invite de commandes ZSH pour les astronautes. -- **[denysdovhan/robbyrussell-node](https://github.com/denysdovhan/robbyrussell-node)** - Thème Cross-shell robbyrussell écrit en JavaScript. +- **[denysdovhan/robbyrussell-node](https://github.com/denysdovhan/robbyrussell-node)** - Thème multi-shell robbyrussell écrit en JavaScript. - **[reujab/silver](https://github.com/reujab/silver)** - Un shell multi-platformes de type powerline personnalisable avec des icônes. diff --git a/docs/fr-FR/migrating-to-0.45.0/README.md b/docs/fr-FR/migrating-to-0.45.0/README.md new file mode 100644 index 00000000..0b865f4f --- /dev/null +++ b/docs/fr-FR/migrating-to-0.45.0/README.md @@ -0,0 +1,265 @@ +# Migrating to v0.45.0 + +Starship v0.45.0 is a release containing breaking changes, in preparation for the big v1.0.0. We have made some major changes around how configuration is done on the prompt, to allow for a greater degree of customization. + +This guide is intended to walk you through the breaking changes. + +## `prompt_order` has been replaced by a root-level `format` + +Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship. + +Starship v0.45.0 will instead be accepting a `format` value, allowing for customization of the prompt outside of the modules themselves. + +**Example pre-v0.45.0 configuration** + +```toml +prompt_order = [ + "username", + "hostname", + "directory", + "git_branch", + "git_commit", + "git_state", + "git_status", + "cmd_duration", + "custom", + "line_break", + "jobs", + "battery", + "time", + "character", +] +``` + +**Example v0.45.0 configuration** + +```toml +format = """\ + $username\ + $hostname\ + $directory\ + $git_branch\ + $git_commit\ + $git_state\ + $git_status\ + $cmd_duration\ + $custom\ + $line_break\ + $jobs\ + $battery\ + $time\ + $character\ + """ +``` + +## Module `prefix` and `suffix` will be replaced by `format` + +Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered. + +Starship v0.45.0 will instead be accepting a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output. + +**Example pre-v0.45.0 configuration** + +```toml +[cmd_duration] +prefix = "took " +``` + +**Example v0.45.0 configuration** + +```toml +[cmd_duration] +# $duration – The command duration (e.g. "15s") +# $style – The default style of the module (e.g. "bold yellow") +format = "took [$duration]($style)" +``` + +### Affected Modules + +#### Caractères + +| Removed Property | Replacement | +| ----------------------- | ---------------- | +| `symbol` | `success_symbol` | +| `use_symbol_for_status` | `error_symbol` | +| `style_success` | `success_symbol` | +| `style_failure` | `error_symbol` | + +**Changes to the Default Configuration** + +```diff +[character] +-- symbol = "❯" +-- error_symbol = "✖" +-- use_symbol_for_status = true +-- vicmd_symbol = "❮" +++ success_symbol = "[❯](bold green) " +++ error_symbol = "[❯](bold red) " +++ vicmd_symbol = "[❮](bold green)" +``` + +Previously, the `use_symbol_for_status` property was used to configure the prompt to show the `error_symbol` when the last command resulted in a non-zero status code. + +With the release of v0.45.0, we now always use `error_symbol` after non-zero status codes, unifying `use_symbol_for_status` and `error_symbol` properties. + +To configure the prompt to use the older `use_symbol_for_status = true` configuration, add the following to your config file: + +```toml +[character] +error_symbol = "[✖](bold red) " +``` + +#### Temps d'exécution + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | + +**Changes to the Default Configuration** + +```diff +[cmd_duration] +-- prefix = "took " +++ format = "took [$duration]($style)" +``` + +#### Directory + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | + +**Changes to the Default Configuration** + +```diff +[directory] +-- prefix = "in " +++ format = "[$path]($style)[$lock_symbol]($lock_style)" +``` + +#### Environment Variable + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[env_var] +-- prefix = "" +-- suffix = "" +++ format = "with [$env_value]($style) " +``` + +#### Git Commit + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[git_commit] +-- prefix = "(" +-- suffix = ")" +++ format = "[\\($hash\\)]($style) " +``` + +#### Git Status + +| Removed Property | Replacement | +| ----------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | +| `show_sync_count` | `format` | + +**Changes to the Default Configuration** + +```diff +[git_status] +-- prefix = "[" +-- suffix = "]" +-- show_sync_count = false +++ format = "([$all_status$ahead_behind] )" +``` + +Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch. + +With the release of v0.45.0, this has been replaced with the + +To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file: + +```toml +[git_status] +ahead = "⇡${count}" +diverged = "⇕⇡${ahead_count}⇣${behind_count}" +behind = "⇣${count}" +``` + +#### Hostname + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[hostname] +-- prefix = "" +-- suffix = "" +++ format = "[$hostname]($style) in " +``` + +#### Singularity + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `label` | `format` | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[singularity] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol\\[$env\\]]($style) " +``` + +#### Time + +| Removed Property | Replacement | +| ---------------- | ------------- | +| `format` | `time_format` | + +**Changes to the Default Configuration** + +```diff +[time] +-- format = "🕙[ %T ]" +++ time_format = "%T" +++ format = "at 🕙[$time]($style) +``` + +#### Custom Commands + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[custom.example] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol$output]($style) " +``` diff --git a/docs/fr-FR/presets/README.md b/docs/fr-FR/presets/README.md index 78d1cbe6..1f019bb7 100644 --- a/docs/fr-FR/presets/README.md +++ b/docs/fr-FR/presets/README.md @@ -26,6 +26,9 @@ discharging_symbol = "" [conda] symbol = " " +[dart] +symbol = " " + [docker] symbol = " " @@ -68,6 +71,9 @@ symbol = " " [package] symbol = " " +[perl] +symbol = " " + [php] symbol = " " @@ -79,4 +85,7 @@ symbol = " " [rust] symbol = " " + +[swift] +symbol = "ﯣ " ``` diff --git a/docs/ja-JP/advanced-config/README.md b/docs/ja-JP/advanced-config/README.md index 51f1f857..30489646 100644 --- a/docs/ja-JP/advanced-config/README.md +++ b/docs/ja-JP/advanced-config/README.md @@ -57,9 +57,9 @@ starship_precmd_user_func="set_win_title" precmd_functions+=(set_win_title) ``` -If you like the result, add these lines to your shell configuration file (`~/.bashrc` or `~/.zshrc`) to make it permanent. +もし結果に満足したら、永続化のためそれぞれの行を (`~/.bashrc` もしくは `~/.zshrc`) に追加してください。 -For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: +たとえば、現在のディレクトリをターミナルタブのタイトルに表示したい場合は、 `~/.bashrc`または`~/.zshrc`に以下のスニペットを追加します。 ```bash function set_win_title(){ diff --git a/docs/ja-JP/config/README.md b/docs/ja-JP/config/README.md index 86ea429a..c6bd74e5 100644 --- a/docs/ja-JP/config/README.md +++ b/docs/ja-JP/config/README.md @@ -1,11 +1,5 @@ # 設定 -::: tip - -🔥Starshipの開発は現在も進んでいます。 多くの新しいオプションが今後のリリースで利用可能になります。 - -::: - Starshipの設定を開始するには、`~/.config/starship.toml` ファイルを作成します。 ```sh @@ -15,14 +9,14 @@ 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 -# 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" +# プロンプトの「❯」記号を「➜」に置き換えます +[character] # 設定しているモジュールの名前は「character」です +success_symbol = "[➜](bold green)" # 「success_symbol」セグメントは「ボールドグリーン」の色で「➜」に設定されています -# Disable the package module, hiding it from the prompt completely +# package モジュールを無効にし、プロンプトから完全に隠します [package] disabled = true ``` @@ -39,9 +33,23 @@ PowerShell (Windows) で同様に `$PROFILE`にこの行を追加します。 $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` -### 用語 +### Logging -**モジュール**: OSのコンテキスト情報に基づいて情報を提供するプロンプト内のコンポーネントです。 たとえば、現在のディレクトリがNodeJSプロジェクトである場合、「nodejs」モジュールは、現在コンピューターにインストールされているNodeJSのバージョンを表示します。 +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: + +```sh +export STARSHIP_CACHE=~/.starship/cache +``` + +PowerShell (Windows) で同様に `$PROFILE`にこの行を追加します。 + +```ps1 +$ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" +``` + +### Terminology + +**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. **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. @@ -57,11 +65,11 @@ A variable contains a `$` symbol followed by the name of the variable. The name 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. +- `$version` は、`version` という名前の変数を持つフォーマット文字列です。 +- `$git_branch$git_commit` は `git_branch` と `git_commit` という2つの変数を持つフォーマット文字列です。 +- `$git_branch $git_commit` には空白で区切られた 2 つの変数があります。 -#### Text Group +#### テキストグループ A text group is made up of two different parts. @@ -71,13 +79,13 @@ In the second part, which is enclosed in a `()`, is a [style string](#style-stri 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. +- `[on](red bold)` は文字列 `on` に太字のテキストを赤色で表示します。 +- `[⬢ $version](bold green)` はシンボル `⬢` の後に変数 `バージョン`の内容を表示します 緑色の太字を付けています +- `[a [b](red) c](green)` は `a b c` を `b` だけ赤色に表示し、 `a` と `c` を緑色に表示します。 #### スタイルの設定 -Starshipのほとんどのモジュールでは、表示スタイルを設定できます。 これは、設定を指定する文字列であるエントリ(`style`)で行われます。 スタイル文字列の例とその機能を次に示します。 完全な構文の詳細については、詳細は [高度な設定](/advanced-config/)を参照してください 。 +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/). - `"fg:green bg:blue"` は、青色の背景に緑色のテキストを設定します - `"bg:blue fg:bright-green"` は、青色の背景に明るい緑色のテキストを設定します @@ -86,9 +94,9 @@ Starshipのほとんどのモジュールでは、表示スタイルを設定で - `"bold italic fg:purple"`は、紫色の太字斜体のテキストを設定します - `""` はすべてのスタイルを明示的に無効にします -スタイリングがどのように見えるかは、端末エミュレータによって制御されることに注意してください。 たとえば、一部の端末エミュレータはテキストを太字にする代わりに色を明るくします。また、一部のカラーテーマは通常の色と明るい色と同じ値を使用します。 また、斜体のテキストを取得するには、端末で斜体をサポートする必要があります。 +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. @@ -98,11 +106,11 @@ For example: - `(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 (`\`). -- $ +- \$ - \\ - [ - ] @@ -130,23 +138,21 @@ format = ''' ## プロンプト -これは、プロンプト全体のオプションのリストです。 +This is the list of prompt-wide configuration options. ### オプション -| Option | デフォルト | 説明 | +| オプション | デフォルト | 説明 | | -------------- | ------------------------------ | ---------------------------------------- | -| `format` | [link](#default-prompt-format) | Configure the format of the prompt. | +| `format` | [link](#default-prompt-format) | プロンプトの形式を設定します。 | | `scan_timeout` | `30` | ファイルをスキャンする際のタイムアウト時間 (milliseconds) です。 | +| `add_newline` | `true` | プロンプトの開始前に新しい行を追加します。 | ### 設定例 ```toml # ~/.config/starship.toml -# Disable the newline at the start of the prompt -format = "$all" - # Use custom format format = """ [┌───────────────────>](bold green) @@ -155,20 +161,23 @@ format = """ # Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 + +# Disable the newline at the start of the prompt +add_newline = false ``` ### Default Prompt Format -The default `format` is used to define the format of the prompt, if empty or no `format` is provided. デフォルトは次のとおりです。 +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 -format = "\n$all" +format = "$all" # Which is equivalent to format = """ - $username\ $hostname\ +$shlvl\ $kubernetes\ $directory\ $git_branch\ @@ -179,6 +188,7 @@ $hg_branch\ $docker_context\ $package\ $cmake\ +$dart\ $dotnet\ $elixir\ $elm\ @@ -190,17 +200,20 @@ $julia\ $nim\ $nodejs\ $ocaml\ +$perl\ $php\ $purescript\ $python\ $ruby\ $rust\ +$swift\ $terraform\ $zig\ $nix_shell\ $conda\ $memory_usage\ $aws\ +$gcloud\ $env_var\ $crystal\ $cmd_duration\ @@ -209,20 +222,21 @@ $line_break\ $jobs\ $battery\ $time\ +$status\ $character""" ``` ## AWS -`aws` モジュールは現在のAWSプロファイルが表示されます。 これは `~/.aws/config` に記述されている `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` 環境変数に基づいています。 +The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. -[aws-vault](https://github.com/99designs/aws-vault)を使用する場合、プロファイル は`AWS_VAULT`env varから読み取られます。 +When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var. ### オプション -| Option | デフォルト | 説明 | +| オプション | デフォルト | 説明 | | ---------------- | ---------------------------------------------------- | ----------------------------- | -| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | The format for the module. | +| `format` | `"on [$symbol$profile(\\($region\\))]($style) "` | moduleのフォーマットです。 | | `symbol` | `"☁️ "` | 現在のAWSプロファイルを表示する前に表示される記号です。 | | `region_aliases` | | AWS名に加えて表示するリージョンのエイリアスです。 | | `style` | `"bold yellow"` | モジュールのスタイルです。 | @@ -230,18 +244,18 @@ $character""" ### 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` | +| 変数 | 設定例 | 説明 | +| --------- | ---------------- | ---------------------- | +| region | `ap-northeast-1` | 現在のAWSリージョン | +| profile | `astronauts` | 現在のAWSプロファイル | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string ### Examples -#### Display everything +#### すべてを表示 ```toml # ~/.config/starship.toml @@ -255,7 +269,7 @@ ap-southeast-2 = "au" us-east-1 = "va" ``` -#### Display region +#### リージョンを表示 ```toml # ~/.config/starship.toml @@ -269,7 +283,7 @@ ap-southeast-2 = "au" us-east-1 = "va" ``` -#### Display profile +#### プロファイルを表示 ```toml # ~/.config/starship.toml @@ -282,28 +296,28 @@ symbol = "🅰 " ## バッテリー -`battery`モジュールは、デバイスのバッテリー残量と現在の充電状態を示します。 モジュールは、デバイスのバッテリー残量が10%未満の場合にのみ表示されます。 +The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%. ### オプション -| Option | デフォルト | 説明 | -| -------------------- | --------------------------------- | -------------------------- | -| `full_symbol` | `"•"` | バッテリーが満タンのときに表示される記号です。 | -| `charging_symbol` | `"⇡"` | バッテリーの充電中に表示される記号です。 | -| `discharging_symbol` | `"⇣"` | バッテリーが放電しているときに表示される記号です。 | -| `format` | `"[$symbol$percentage]($style) "` | The format for the module. | -| `display` | [link](#battery-display) | モジュールの閾値とスタイルを表示します。 | -| `disabled` | `false` | `battery`モジュールを無効にします。 | +| オプション | デフォルト | 説明 | +| -------------------- | --------------------------------- | ------------------------- | +| `full_symbol` | `"•"` | バッテリーが満タンのときに表示される記号です。 | +| `charging_symbol` | `"⇡"` | バッテリーの充電中に表示される記号です。 | +| `discharging_symbol` | `"⇣"` | バッテリーが放電しているときに表示される記号です。 | +| `format` | `"[$symbol$percentage]($style) "` | moduleのフォーマットです。 | +| `display` | [link](#battery-display) | モジュールの閾値とスタイルを表示します。 | +| `disabled` | `false` | `battery`モジュールを無効にします。 |
-いくつかのまれなバッテリー状態のオプションもあります。 +There are also options for some uncommon battery states. | 変数 | 説明 | | ---------------- | ------------------------ | | `unknown_symbol` | バッテリー状態が不明なときに表示される記号です。 | | `empty_symbol` | バッテリーが空のときに表示される記号です。 | -オプションを指定しない限り、バッテリーの状態が`unknown`もしくは`empty`になった場合にインジケーターは非表示になります。 +Note: Battery indicator will be hidden if the status is `unknown` or `empty` unless you specify the option in the config.
@@ -318,9 +332,9 @@ charging_symbol = "⚡️" discharging_symbol = "💀" ``` -### バッテリーの表示 +### Battery Display -`display` オプションを使用して、バッテリーインジケーターを表示するタイミング(閾値)と外観(スタイル)を定義します。 `display` が提供されない場合、 デフォルトは次のとおりです。 +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: ```toml [[battery.display]] @@ -330,7 +344,7 @@ style = "bold red" #### オプション -`display`オプションは、次の表の通りです。 +The `display` option is an array of the following table. | 変数 | 説明 | | ----------- | ------------------------------ | @@ -340,32 +354,32 @@ style = "bold red" #### 設定例 ```toml -[[battery.display]] # バッテリー残量が0%〜10%の間は「太字の赤色」スタイルを利用する +[[battery.display]] # "bold red" style when capacity is between 0% and 10% threshold = 10 style = "bold red" -[[battery.display]] # バッテリー残量が10%〜30%の間は「太字の黄色」スタイルを利用する +[[battery.display]] # "bold yellow" style when capacity is between 10% and 30% threshold = 30 style = "bold yellow" -# 容量が30%を超えると、バッテリーインジケーターは表示されません +# when capacity is over 30%, the battery indicator will not be displayed ``` ## 文字 -`character`モジュールは、端末でテキストが入力される場所の横に文字(通常は矢印)を表示します。 +The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal. -文字は、最後のコマンドが成功したかどうかを示します。 It can do this in two ways: +The character will tell you whether the last command was successful or not. It can do this in two ways: -- changing color (`red`/`green`) -- changing shape (`❯`/`✖`) +- 色の変更 (`赤`/`緑`) +- プロンプトの表示の変更 (`❯`/`✖`) 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). ### オプション -| 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. | @@ -418,51 +432,51 @@ The `cmake` module shows the currently installed version of CMake if: ### オプション -| Option | デフォルト | 説明 | +| オプション | デフォルト | 説明 | | ---------- | ---------------------------------- | -------------------------------------------- | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `format` | `"via [$symbol$version]($style) "` | 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` | +| 変数 | 設定例 | 説明 | +| --------- | --------- | ---------------------- | +| version | `v3.17.3` | The version of cmake | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string ## コマンド実行時間 -`cmd_duration`モジュールは、最後のコマンドの実行にかかった時間を示します。 モジュールが表示されるのは、コマンドが2秒以上かかった場合、または`min_time`値が存在する場合のみです。 +The `cmd_duration` module shows how long the last command took to execute. The module will be shown only if the command took longer than two seconds, or the `min_time` config value, if it exists. -::: warning BashでDEBUGトラップをhookしない +::: warning Do not hook the DEBUG trap in Bash -`bash`でStarshipを実行している場合、 `eval $(starship init $0)`実行した後に`DEBUG`トラップをフックしないでください。そうしないと、このモジュールが**おそらくですが**壊れます。 +If you are running Starship in `bash`, do not hook the `DEBUG` trap after running `eval $(starship init $0)`, or this module **will** break. ::: -preexecのような機能を必要とするBashユーザーは、 [rcalorasのbash_preexecフレームワーク](https://github.com/rcaloras/bash-preexec)を使用できます。 `eval $(starship init $0)` を実行する前に、`preexec_functions`、および`precmd_functions`定義するだけで、通常どおり続行します。 +Bash users who need preexec-like functionality can use [rcaloras's bash_preexec framework](https://github.com/rcaloras/bash-preexec). Simply define the arrays `preexec_functions` and `precmd_functions` before running `eval $(starship init $0)`, and then proceed as normal. ### オプション -| Option | デフォルト | 説明 | +| オプション | デフォルト | 説明 | | ------------------- | ----------------------------- | --------------------------- | | `min_time` | `2_000` | 実行時間を表示する最短期間(ミリ秒単位)です。 | | `show_milliseconds` | `false` | 実行時間の秒に加えてミリ秒を表示します。 | -| `format` | `"took [$duration]($style) "` | The format for the module. | +| `format` | `"took [$duration]($style) "` | 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` | +| 変数 | 設定例 | 説明 | +| --------- | -------- | ---------------------- | +| duration | `16m40s` | コマンドの実行時間 | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -478,31 +492,32 @@ format = "underwent [$duration](bold yellow)" ## Conda -`$CONDA_DEFAULT_ENV`が設定されている場合、`conda`モジュールは現在のcondaの環境を表示します。 +The `conda` module shows the current conda environment, if `$CONDA_DEFAULT_ENV` is set. ::: tip -Note: これはconda自身の プロンプト修飾子 を抑制しません。`conda config --set changeps1 False` で実行することができます。 +This does not suppress conda's own prompt modifier, you may want to run `conda config --set changeps1 False`. ::: ### オプション -| 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`モジュールを無効にします。 | +| `format` | `"[$symbol$environment]($style) "` | moduleのフォーマットです。 | +| `ignore_base` | `true` | Ignores `base` environment when activated. | +| `disabled` | `false` | Disables the `conda` module. | ### Variables -| 変数 | 設定例 | 説明 | -| ----------- | ------------ | ------------------------------------ | -| environment | `astronauts` | The current conda environment | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| 変数 | 設定例 | 説明 | +| ----------- | ------------ | ----------------------------- | +| environment | `astronauts` | The current conda environment | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -517,27 +532,27 @@ format = "[$symbol$environment](dimmed green) " ## Crystal -`crystal`モジュールには、現在インストールされているCrystalのバージョンが表示されます。 次の条件のいずれかが満たされると、モジュールが表示されます。 +The `crystal` module shows the currently installed version of Crystal. 次の条件のいずれかが満たされると、モジュールが表示されます。 - カレントディレクトリに`shard.yml`ファイルが含まれている - カレントディレクトリに`.cr`の拡張子のファイルが含まれている ### オプション -| Option | デフォルト | 説明 | +| オプション | デフォルト | 説明 | | ---------- | ---------------------------------- | ------------------------------ | | `symbol` | `"🔮 "` | Crystalのバージョンを表示する前に使用される記号です。 | | `style` | `"bold red"` | モジュールのスタイルです。 | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `format` | `"via [$symbol$version]($style) "` | 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` | +| 変数 | 設定例 | 説明 | +| --------- | --------- | ------------------------ | +| version | `v0.32.1` | The version of `crystal` | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -550,34 +565,70 @@ format = "[$symbol$environment](dimmed green) " format = "via [✨ $version](bold blue) " ``` -## ディレクトリ +## Dart -`directory`モジュールには、現在のディレクトリへのパスが表示され、3つの親フォルダは切り捨てられます。 ディレクトリは、現在のgitリポジトリであるとルートとなります。 +The `dart` module shows the currently installed version of Dart. 次の条件のいずれかが満たされると、モジュールが表示されます。 -fishスタイルのpwdオプションを使用すると、切り捨てられたパスを非表示にする代わりに、オプションで有効にした番号に基づいて各ディレクトリの短縮名が表示されます。 - -例として、`~/Dev/Nix/nixpkgs/pkgs`で、`nixpkgs`がリポジトリルートであり、オプションが`1`に設定されている場合を挙げます。 以前は`nixpkgs/pkgs`でしたが、`~/D/N/nixpkgs/pkgs`が表示されます。 +- The current directory contains a file with `.dart` extension +- The current directory contains a `.dart_tool` directory +- The current directory contains a `pubspec.yaml` or `pubspec.lock` file ### オプション -| 変数 | デフォルト | 説明 | -| ------------------------ | ----------------------------------------------- | ----------------------------------------------------- | -| `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. | +| 変数 | デフォルト | 説明 | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | moduleのフォーマットです。 | +| `symbol` | `"🎯 "` | A format string representing the symbol of Dart | +| `style` | `"bold blue"` | モジュールのスタイルです。 | +| `disabled` | `false` | Disables the `dart` module. | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | -------- | ---------------------- | +| version | `v2.8.4` | The version of `dart` | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | + +\*: This variable can only be used as a part of a style string + +### 設定例 + +```toml +# ~/.config/starship.toml + +[dart] +format = "via [🔰 $version](bold red) " +``` + +## Directory + +The `directory` module shows the path to your current directory, truncated to three parent folders. Your directory will also be truncated to the root of the git repo that you're currently in. + +When using the fish style pwd option, instead of hiding the path that is truncated, you will see a shortened name of each directory based on the number you enable for the option. + +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`. + +### オプション + +| 変数 | デフォルト | 説明 | +| ------------------------ | ----------------------------------------------- | -------------------------------------------------------------------------------- | +| `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) "` | moduleのフォーマットです。 | +| `style` | `"bold cyan"` | モジュールのスタイルです。 | +| `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. -| Advanced Option | デフォルト | 説明 | -| --------------------------- | ------ | ------------------------------------------------ | -| `substitutions` | | A table of substitutions to be made to the path. | -| `fish_style_pwd_dir_length` | `0` | fish shellのpwdパスロジックを適用するときに使用する文字数です。 | -| `use_logical_path` | `true` | OSからのパスの代わりに、シェル(`PWD`) によって提供される論理パスを表示します。 | +| Advanced Option | デフォルト | 説明 | +| --------------------------- | ------ | ---------------------------------------------------------------------------------------- | +| `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. @@ -593,10 +644,10 @@ fishスタイルのpwdオプションを使用すると、切り捨てられた ### Variables -| 変数 | 設定例 | 説明 | -| --------- | --------------------- | ----------------------------------- | -| path | `"D:/Projects"` | The current directory path | -| style\* | `"black bold dimmed"` | Mirrors the value of option `style` | +| 変数 | 設定例 | 説明 | +| --------- | --------------------- | -------------------------- | +| path | `"D:/Projects"` | The current directory path | +| style\* | `"black bold dimmed"` | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -611,25 +662,25 @@ truncation_length = 8 ## Docker Context -`docker_context`モジュールは、 [Dockerコンテキスト](https://docs.docker.com/engine/context/working-with-contexts/)が`デフォルト`に設定されていない場合、現在アクティブな <1>Dockerコンテキストを表示します。 +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`. ### オプション -| Option | デフォルト | 説明 | +| オプション | デフォルト | 説明 | | ----------------- | ---------------------------------- | --------------------------------------------------------------------------------------- | -| `format` | `"via [$symbol$context]($style) "` | The format for the module. | +| `format` | `"via [$symbol$context]($style) "` | 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`モジュールを無効にします。 | +| `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` | +| 変数 | 設定例 | 説明 | +| --------- | -------------- | -------------------------- | +| context | `test_context` | The current docker context | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -644,7 +695,7 @@ format = "via [🐋 $context](blue bold)" ## Dotnet -`dotnet` モジュールはカレントディレクトリに関係する.NET Core SDKのバージョンを表示します。 もし SDKは現在のディレクトリに固定されているのであれば、その固定されたバージョンが表示されます。 それ以外の場合、モジュール SDKの最新のインストールバージョンを示します。 +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 or more of the following files are present in the current directory: @@ -660,19 +711,19 @@ This module will only be shown in your prompt when one or more of the following You'll also need the .NET Core SDK installed in order to use it correctly. -内部的に、このモジュールは自身のバージョン検知のメカニズムを利用します。 `dotnet --version` を実行するより2倍速く実行できますが、.NET project一般的でないディレクトリlayoutの場合は間違ったバージョンが示されてしまうことがあります。 速度よりも精度が重要な場合は、次の方法でメカニズムを無効にできます。 モジュールオプションで`heuristic = false `を設定します。 +Internally, this module uses its own mechanism for version detection. Typically it is twice as fast as running `dotnet --version`, but it may show an incorrect version if your .NET project has an unusual directory layout. If accuracy is more important than speed, you can disable the mechanism by setting `heuristic = false` in the module options. The module will also show the Target Framework Moniker () when there is a csproj file in the current directory. ### オプション -| Option | デフォルト | 説明 | -| ----------- | ---------------------------------------- | ------------------------------------ | -| `format` | `"v[$symbol$version( 🎯 $tfm)]($style) "` | The format for the module. | -| `symbol` | `•NET "` | dotnetのバージョンを表示する前に使用される記号です。 | -| `heuristic` | `true` | より高速なバージョン検出を使用して、starshipの動作を維持します。 | -| `style` | `"bold blue"` | モジュールのスタイルです。 | -| `disabled` | `false` | `dotnet`モジュールを無効にします。 | +| オプション | デフォルト | 説明 | +| ----------- | ---------------------------------------- | -------------------------------------------------------- | +| `format` | `"v[$symbol$version( 🎯 $tfm)]($style) "` | 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"` | モジュールのスタイルです。 | +| `disabled` | `false` | Disables the `dotnet` module. | ### Variables @@ -680,8 +731,8 @@ The module will also show the Target Framework Moniker (モジュールは、現在のシステムメモリとスワップ使用量を示します。

+The `memory_usage` module shows current system memory and swap usage. -

デフォルトでは、システムスワップの合計がゼロ以外の場合、スワップ使用量が表示されます。

+By default the swap usage is displayed if the total system swap is non-zero. -

::: tip

+::: tip -

このモジュールはデフォルトで無効になっています。 -有効にするには、設定ファイルでdisabled`を`false`に設定します。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: ### オプション -| Option | デフォルト | 説明 | -| ----------- | --------------------------------------------- | --------------------------- | -| `threshold` | `75` | この閾値を超えない限り、メモリ使用率は表示されません。 | -| `format` | `"via $symbol [${ram}( | ${swap})]($style) "` | The format for the module. | -| `symbol` | `"🐏"` | メモリ使用率を表示する前に使用される記号です。 | -| `style` | `"bold dimmed white"` | モジュールのスタイルです。 | -| `disabled` | `true` | `memory_usage`モジュールを無効にします。 | +| オプション | デフォルト | 説明 | +| ----------- | --------------------------------------------- | -------------------------------------------------------- | +| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. | +| `format` | `"via $symbol [${ram}( | ${swap})]($style) "` | moduleのフォーマットです。 | +| `symbol` | `"🐏"` | The symbol used before displaying the memory usage. | +| `style` | `"bold dimmed white"` | モジュールのスタイルです。 | +| `disabled` | `true` | Disables the `memory_usage` module. | ### 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` | +| 変数 | 設定例 | 説明 | +| ---------------- | ------------- | ------------------------------------------------------------------ | +| 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 | `🐏` | オプション `記号` の値をミラーする | +| style\* | | オプション `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 @@ -1353,28 +1471,28 @@ separator = "/" style = "bold dimmed green" ``` -## Mercurial ブランチ +## Mercurial Branch -` hg_branch `モジュールは、現在のディレクトリにあるリポジトリのアクティブなブランチを示します。 +The `hg_branch` module shows the active branch of the repo in your current directory. ### オプション -| 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. | +| `format` | `"on [$symbol$branch]($style) "` | moduleのフォーマットです。 | | `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes | -| `truncation_symbol` | `"…"` | ブランチ名切り捨てられていることを示すための記号です。 | +| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. | | `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` | +| 変数 | 設定例 | 説明 | +| --------- | -------- | --------------------------- | +| branch | `master` | The active mercurial branch | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -1393,14 +1511,14 @@ truncation_symbol = "" The `nim` module shows the currently installed version of Nim. 次の条件のいずれかが満たされると、モジュールが表示されます。 -- カレントディレクトリに`nim.cfg`ファイルが含まれている +- 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 ### オプション -| Option | デフォルト | 説明 | +| オプション | デフォルト | 説明 | | ---------- | ---------------------------------- | ----------------------------------------------------- | | `format` | `"via [$symbol$version]($style) "` | The format for the module | | `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. | @@ -1409,11 +1527,11 @@ The `nim` module shows the currently installed version of Nim. 次の条件の ### Variables -| 変数 | 設定例 | 説明 | -| --------- | -------- | ------------------------------------ | -| version | `v1.2.0` | The version of `nimc` | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| 変数 | 設定例 | 説明 | +| --------- | -------- | ---------------------- | +| version | `v1.2.0` | The version of `nimc` | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -1429,27 +1547,27 @@ symbol = "🎣 " ## Nix-shell -`nix_shell`モジュールは、nix-shell環境を示しています。 このモジュールは、nixシェル環境内にあるときに表示されます。 +The `nix_shell` module shows the nix-shell environment. The module will be shown when inside a nix-shell environment. ### オプション -| Option | デフォルト | 説明 | +| オプション | デフォルト | 説明 | | ------------ | -------------------------------------------------- | ----------------------------------------------------- | -| `format` | `"via [$symbol$state( \\($name\\))]($style) "` | The format for the module. | -| `symbol` | `"❄️ "` | A format string representing the symbol of nix-shell. | +| `format` | `"via [$symbol$state( \\($name\\))]($style) "` | moduleのフォーマットです。 | +| `symbol` | `"❄️ "` | A format string representing the symbol of nix-shell. | | `style` | `"bold blue"` | モジュールのスタイルです。 | | `impure_msg` | `"impure"` | A format string shown when the shell is impure. | | `pure_msg` | `"pure"` | A format string shown when the shell is pure. | -| `disabled` | `false` | `nix_shell`モジュールを無効にします。 | +| `disabled` | `false` | Disables the `nix_shell` module. | ### Variables -| 変数 | 設定例 | 説明 | -| --------- | ------- | ------------------------------------ | -| state | `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` | +| 変数 | 設定例 | 説明 | +| --------- | ------- | -------------------------- | +| state | `pure` | The state of the nix-shell | +| name | `lorri` | The name of the nix-shell | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -1467,30 +1585,30 @@ format = "via [☃️ $state( \\($name\\))](bold blue) " ## NodeJS -`nodejs`モジュールは、現在インストールされているNodeJSのバージョンを示します。 次の条件のいずれかが満たされると、モジュールが表示されます。 +The `nodejs` module shows the currently installed version of NodeJS. 次の条件のいずれかが満たされると、モジュールが表示されます。 -- カレントディレクトリに`package.json`ファイルが含まれている +- The current directory contains a `package.json` file - The current directory contains a `.node-version` file -- カレントディレクトリに`node_modules`ディレクトリが含まれている +- The current directory contains a `node_modules` directory - The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension - The current directory contains a file with the `.ts` extension ### オプション -| Option | デフォルト | 説明 | +| オプション | デフォルト | 説明 | | ---------- | ---------------------------------- | -------------------------------------------------- | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `format` | `"via [$symbol$version]($style) "` | moduleのフォーマットです。 | | `symbol` | `"⬢ "` | A format string representing the symbol of NodeJS. | | `style` | `"bold green"` | モジュールのスタイルです。 | -| `disabled` | `false` | `nodejs`モジュールを無効にします。 | +| `disabled` | `false` | Disables the `nodejs` module. | ###  Variables -| 変数 | 設定例 | 説明 | -| --------- | ---------- | ------------------------------------ | -| version | `v13.12.0` | The version of `node` | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| 変数 | 設定例 | 説明 | +| --------- | ---------- | ---------------------- | +| version | `v13.12.0` | The version of `node` | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -1503,37 +1621,39 @@ format = "via [☃️ $state( \\($name\\))](bold blue) " format = "via [🤖 $version](bold green) " ``` -## パッケージのバージョン +## Package Version -`package`モジュールは、現在のディレクトリがパッケージのリポジトリである場合に表示され、現在のバージョンが表示されます。 The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages. +The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix` and `helm` packages. -- **npm** – `npm`パッケージバージョンは、現在のディレクトリにある`package.json`から抽出されます -- **cargo** – `cargo`パッケージバージョンは、現在のディレクトリにある`Cargo.toml`から抽出されます。 -- **poetry** – `poetry`パッケージバージョンは、現在のディレクトリにある`pyproject.toml`から抽出されます -- **composer** – `composer`パッケージバージョンは、現在のディレクトリにある`composer.json`から抽出されます +- **npm** – The `npm` package version is extracted from the `package.json` present in the current directory +- **cargo** – The `cargo` package version is extracted from the `Cargo.toml` present in the current directory +- **poetry** – The `poetry` package version is extracted from the `pyproject.toml` present in the current directory +- **composer** – The `composer` package version is extracted from the `composer.json` present in the current directory - **gradle** – The `gradle` package version is extracted from the `build.gradle` present - **julia** - The package version is extracted from the `Project.toml` present - **mix** - The `mix` package version is extracted from the `mix.exs` present +- **helm** - The `helm` chart version is extracted from the `Chart.yaml` present +- **maven** - The `maven` package version is extracted from the `pom.xml` present > ⚠️ 表示されるバージョンは、パッケージマネージャーではなく、ソースコードが現在のディレクトリにあるパッケージのバージョンです。 ### オプション -| 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` モジュールを無効にします。 | +| オプション | デフォルト | 説明 | +| ----------------- | ---------------------------------- | ---------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | moduleのフォーマットです。 | +| `symbol` | `"📦 "` | The symbol used before displaying the version the package. | +| `style` | `"bold 208"` | モジュールのスタイルです。 | +| `display_private` | `false` | Enable displaying version for packages marked as private. | +| `disabled` | `false` | Disables the `package` module. | ### Variables -| 変数 | 設定例 | 説明 | -| --------- | -------- | ------------------------------------ | -| version | `v1.0.0` | The version of your package | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| 変数 | 設定例 | 説明 | +| --------- | -------- | --------------------------- | +| version | `v1.0.0` | The version of your package | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -1559,7 +1679,7 @@ The `ocaml` module shows the currently installed version of OCaml. 次の条件 ### オプション -| Option | デフォルト | 説明 | +| オプション | デフォルト | 説明 | | ---------- | ---------------------------------- | ------------------------------------------------------- | | `format` | `"via [$symbol$version]($style) "` | The format string for the module. | | `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. | @@ -1568,11 +1688,11 @@ The `ocaml` module shows the currently installed version of OCaml. 次の条件 ### Variables -| 変数 | 設定例 | 説明 | -| --------- | --------- | ------------------------------------ | -| version | `v4.10.0` | The version of `ocaml` | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| 変数 | 設定例 | 説明 | +| --------- | --------- | ---------------------- | +| version | `v4.10.0` | The version of `ocaml` | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -1585,30 +1705,66 @@ The `ocaml` module shows the currently installed version of OCaml. 次の条件 format = "via [🐪 $version]($style) " ``` -## PHP +## Perl -`php`モジュールは、現在インストールされているPHPのバージョンを示します。 次の条件のいずれかが満たされると、モジュールが表示されます。 +The `perl` module shows the currently installed version of Perl. 次の条件のいずれかが満たされると、モジュールが表示されます。 -- カレントディレクトリに`composer.json`ファイルが含まれている -- The current directory contains a `.php-version` file -- カレントディレクトリに`.php`の拡張子のファイルが含まれている +- The current directory contains a `Makefile.PL` or `Build.PL` file +- The current directory contains a `cpanfile` or `cpanfile.snapshot` file +- The current directory contains a `META.json` file or `META.yml` file +- The current directory contains a `.perl-version` file +- The current directory contains a `.pl`, `.pm` or `.pod` ### オプション -| Option | デフォルト | 説明 | -| ---------- | ---------------------------------- | -------------------------- | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | -| `symbol` | `"🐘 "` | PHPのバージョンを表示する前に使用される記号です。 | -| `style` | `"147 bold"` | モジュールのスタイルです。 | -| `disabled` | `false` | `php`モジュールを無効にします。 | +| 変数 | デフォルト | 説明 | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format string for the module. | +| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl | +| `style` | `"bold 149"` | モジュールのスタイルです。 | +| `disabled` | `false` | Disables the `perl` module. | ### Variables -| 変数 | 設定例 | 説明 | -| --------- | -------- | ------------------------------------ | -| version | `v7.3.8` | The version of `php` | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| 変数 | 設定例 | 説明 | +| --------- | --------- | ---------------------- | +| version | `v5.26.1` | The version of `perl` | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | + +### 設定例 + +```toml +# ~/.config/starship.toml + +[perl] +format = "via [🦪 $version]($style) " +``` + +## PHP + +The `php` module shows the currently installed version of PHP. 次の条件のいずれかが満たされると、モジュールが表示されます。 + +- The current directory contains a `composer.json` file +- The current directory contains a `.php-version` file +- The current directory contains a `.php` file + +### オプション + +| オプション | デフォルト | 説明 | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | 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 | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -1629,35 +1785,37 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name 次の条件のいずれかが満たされると、モジュールが表示されます。 -- カレントディレクトリに`.python-version`ファイルが含まれている -- カレントディレクトリに`requirements.txt`ファイルが含まれている -- カレントディレクトリに`pyproject.toml`ファイルが含まれている +- The current directory contains a `.python-version` file +- The current directory contains a `requirements.txt` file +- The current directory contains a `pyproject.toml` file - The current directory contains a file with the `.py` extension (and `scan_for_pyfiles` is true) -- カレントディレクトリに`Pipfile`ファイルが含まれている -- カレントディレクトリに`tox.ini`ファイルが含まれている -- カレントディレクトリに`setup.py`ファイルが含まれている +- The current directory contains a `Pipfile` file +- The current directory contains a `tox.ini` file +- The current directory contains a `setup.py` file - The current directory contains a `__init__.py` file -- 仮想環境がアクティブである +- A virtual environment is currently activated ### オプション -| 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`モジュールを無効にします。 | +| オプション | デフォルト | 説明 | +| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | moduleのフォーマットです。 | +| `symbol` | `"🐍 "` | A format string representing the symbol of Python | +| `style` | `"yellow bold"` | モジュールのスタイルです。 | +| `pyenv_version_name` | `false` | Use pyenv to get Python version | +| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `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 | +| 変数 | 設定例 | 説明 | +| ------------ | --------------- | ------------------------------------------ | +| version | `"v3.8.1"` | The version of `python` | +| symbol | `"🐍 "` | オプション `記号` の値をミラーする | +| style | `"yellow bold"` | オプション `style` の値をミラーする | +| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` | +| virtualenv | `"venv"` | The current `virtualenv` name |

This module has some advanced configuration options. @@ -1685,33 +1843,32 @@ python_binary = "python3" [python] symbol = "👾 " pyenv_version_name = true -pyenv_prefix = "foo " ``` ## Ruby -`ruby`モジュールは、現在インストールされているRubyのバージョンを示します。 次の条件のいずれかが満たされると、モジュールが表示されます。 +The `ruby` module shows the currently installed version of Ruby. 次の条件のいずれかが満たされると、モジュールが表示されます。 -- カレントディレクトリに`Gemfile`ファイルが含まれている +- The current directory contains a `Gemfile` file - The current directory contains a `.ruby-version` file -- カレントディレクトリに`.rb`の拡張子のファイルが含まれている +- The current directory contains a `.rb` file ### オプション -| Option | デフォルト | 説明 | +| オプション | デフォルト | 説明 | | ---------- | ---------------------------------- | ------------------------------------------------ | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `format` | `"via [$symbol$version]($style) "` | moduleのフォーマットです。 | | `symbol` | `"💎 "` | A format string representing the symbol of Ruby. | | `style` | `"bold red"` | モジュールのスタイルです。 | -| `disabled` | `false` | `ruby`モジュールを無効にします。 | +| `disabled` | `false` | Disables the `ruby` module. | ### Variables -| 変数 | 設定例 | 説明 | -| --------- | -------- | ------------------------------------ | -| version | `v2.5.1` | The version of `ruby` | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| 変数 | 設定例 | 説明 | +| --------- | -------- | ---------------------- | +| version | `v2.5.1` | The version of `ruby` | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -1726,27 +1883,27 @@ symbol = "🔺 " ## Rust -`rust`モジュールには、現在インストールされているRustのバージョンが表示されます。 次の条件のいずれかが満たされると、モジュールが表示されます。 +The `rust` module shows the currently installed version of Rust. 次の条件のいずれかが満たされると、モジュールが表示されます。 -- カレントディレクトリに`Cargo.toml`ファイルが含まれている -- カレントディレクトリに`.rs`の拡張子のファイルが含まれている +- The current directory contains a `Cargo.toml` file +- The current directory contains a file with the `.rs` extension ### オプション -| Option | デフォルト | 説明 | +| オプション | デフォルト | 説明 | | ---------- | ---------------------------------- | ----------------------------------------------- | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `format` | `"via [$symbol$version]($style) "` | moduleのフォーマットです。 | | `symbol` | `"🦀 "` | A format string representing the symbol of Rust | | `style` | `"bold red"` | モジュールのスタイルです。 | -| `disabled` | `false` | `rust`モジュールを無効にします。 | +| `disabled` | `false` | Disables the `rust` module. | ### Variables -| 変数 | 設定例 | 説明 | -| --------- | ----------------- | ------------------------------------ | -| version | `v1.43.0-nightly` | The version of `rustc` | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| 変数 | 設定例 | 説明 | +| --------- | ----------------- | ---------------------- | +| version | `v1.43.0-nightly` | The version of `rustc` | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -1759,26 +1916,61 @@ symbol = "🔺 " format = "via [⚙️ $version](red bold)" ``` +## SHLVL + +The `shlvl` module shows the current SHLVL ("shell level") environment variable, if it is set to a number and meets or exceeds the specified threshold. + +### オプション + +| 変数 | デフォルト | 説明 | +| ----------- | ---------------------------- | --------------------------------------- | +| `threshold` | `2` | Display threshold. | +| `format` | `"[$symbol$shlvl]($style) "` | moduleのフォーマットです。 | +| `symbol` | `"↕️ "` | The symbol used to represent the SHLVL. | +| `style` | `"bold yellow"` | モジュールのスタイルです。 | +| `disabled` | `true` | Disables the `shlvl` module. | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | --- | -------------------------- | +| shlvl | `3` | The current value of SHLVL | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | + +\*: This variable can only be used as a part of a style string + +### 設定例 + +```toml +# ~/.config/starship.toml + +[shlvl] +disabled = false +format = "$shlvl level(s) down" +threshold = 3 +``` + ## Singularity The `singularity` module shows the current singularity image, if inside a container and `$SINGULARITY_NAME` is set. ### オプション -| Option | デフォルト | 説明 | +| オプション | デフォルト | 説明 | | ---------- | ------------------------------------ | ------------------------------------------------ | -| `format` | `"[$symbol\\[$env\\]]($style) "` | The format for the module. | +| `format` | `"[$symbol\\[$env\\]]($style) "` | moduleのフォーマットです。 | | `symbol` | `""` | A format string displayed before the image name. | | `style` | `"bold dimmed blue"` | モジュールのスタイルです。 | | `disabled` | `false` | Disables the `singularity` module. | ### Variables -| 変数 | 設定例 | 説明 | -| --------- | ------------ | ------------------------------------ | -| env | `centos.img` | The current singularity image | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| 変数 | 設定例 | 説明 | +| --------- | ------------ | ----------------------------- | +| env | `centos.img` | The current singularity image | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -1791,30 +1983,107 @@ The `singularity` module shows the current singularity image, if inside a contai format = "[📦 \\[$env\\]]($style) " ``` -## Terraform +## Swift -`terraform`モジュールには、現在選択されているterraformワークスペースとバージョンが表示されます。 デフォルトでは、Terraformのバージョンは表示されません。これは、多くのプラグインが使用されている場合、Terraformの現在のバージョンでは遅いためです。 If you still want to enable it, [follow the example shown below](#with-version). 次の条件のいずれかが満たされると、モジュールが表示されます。 +The `swift` module shows the currently installed version of Swift. 次の条件のいずれかが満たされると、モジュールが表示されます。 -- カレントディレクトリに`.terraform`フォルダが含まれている -- カレントディレクトリに`.tf`の拡張子のファイルが含まれている +- The current directory contains a `Package.swift` file +- The current directory contains a file with the `.swift` extension ### オプション -| Option | デフォルト | 説明 | +| オプション | デフォルト | 説明 | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | moduleのフォーマットです。 | +| `symbol` | `"🐦 "` | A format string representing the symbol of Swift | +| `style` | `"bold 202"` | モジュールのスタイルです。 | +| `disabled` | `false` | Disables the `swift` module. | + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | -------- | ---------------------- | +| version | `v5.2.4` | The version of `swift` | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | + +\*: This variable can only be used as a part of a style string + +### 設定例 + +```toml +# ~/.config/starship.toml + +[swift] +format = "via [🏎 $version](red bold)" +``` + +## Status + +The `status` module displays the exit code of the previous command. The module will be shown only if the exit code is not `0`. + +::: tip + +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: + +### オプション + +| 変数 | デフォルト | 説明 | +| ---------- | -------------------------- | ------------------------------------------------------ | +| `format` | `[$symbol$status]($style)` | The format of the module | +| `symbol` | `"✖"` | A format string representing the symbol for the status | +| `style` | `"bold red"` | モジュールのスタイルです。 | +| `disabled` | `true` | Disables the `status` module. | + + +### Variables + +| 変数 | 設定例 | 説明 | +| --------- | ----- | --------------------------------- | +| status | `127` | The exit code of the last command | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | + +\*: This variable can only be used as a part of a style string + + +### 設定例 +```toml + +# ~/.config/starship.toml + +[status] +style = "bg:blue" +symbol = "💣 " +format = "[\\[$symbol$status\\]]($style) " +disabled = false + +``` + +## 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. 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 + +### オプション + +| オプション | デフォルト | 説明 | | ---------- | ------------------------------------ | ----------------------------------------------------- | | `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`モジュールを無効にします。 | +| `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` | +| 変数 | 設定例 | 説明 | +| --------- | ---------- | ------------------------------- | +| version | `v0.12.24` | The version of `terraform` | +| workspace | `default` | The current terraform workspace | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -1838,36 +2107,36 @@ format = "[🏎💨 $version$workspace]($style) " format = "[🏎💨 $workspace]($style) " ``` -## 時刻 +## Time -`time`モジュールは、現在の**現地**時間を示します。 `format`設定は、時間の表示方法を制御するために[`chrono`](https://crates.io/crates/chrono)クレートによって使用されます。 使用可能なオプションを確認するには、[chrono strftimeのドキュメント](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html)をご覧ください。 +The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available. ::: tip -このモジュールはデフォルトで無効になっています。 有効にするには、設定ファイルで`disabled`を`false`に設定します。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: ### オプション -| Option | デフォルト | 説明 | -| ----------------- | ----------------------- | ----------------------------------------------------------------------------------------------------- | -| `format` | `"at [$time]($style) "` | The format string for the module. | -| `use_12hr` | `false` | 12時間のフォーマットを有効にします。 | -| `time_format` | この表の下を参照してください | 時刻のフォーマットに使用される[クロノフォーマット文字列](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 | +| オプション | デフォルト | 説明 | +| ----------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `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 `time_format` defaults to `"%r"`. それ以外の場合、デフォルトは`"%T"`です。 Manually setting `time_format` will override the `use_12hr` setting. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. ### Variables -| 変数 | 設定例 | 説明 | -| --------- | ---------- | ----------------------------------- | -| 時刻 | `13:08:10` | The current time. | -| style\* | | Mirrors the value of option `style` | +| 変数 | 設定例 | 説明 | +| --------- | ---------- | ---------------------- | +| time | `13:08:10` | The current time. | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -1884,24 +2153,24 @@ utc_time_offset = "-5" time_range = "10:00:00-14:00:00" ``` -## ユーザー名 +## Username -`username`モジュールには、アクティブなユーザーのユーザー名が表示されます。 次の条件のいずれかが満たされると、モジュールが表示されます。 +The `username` module shows active user's username. 次の条件のいずれかが満たされると、モジュールが表示されます。 -- カレントユーザーがroot -- カレントユーザーが、ログインしているユーザーとは異なる -- ユーザーがSSHセッションとして接続されている -- `show_always`変数がtrueに設定されている +- The current user is root +- The current user isn't the same as the one that is logged in +- The user is currently connected as an SSH session +- The variable `show_always` is set to true ### オプション -| 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` モジュールを無効にします。 | +| オプション | デフォルト | 説明 | +| ------------- | ----------------------- | ------------------------------------- | +| `style_root` | `"bold red"` | The style used when the user is root. | +| `style_user` | `"bold yellow"` | The style used for non-root users. | +| `format` | `"[$user]($style) in "` | moduleのフォーマットです。 | +| `show_always` | `false` | Always shows the `username` module. | +| `disabled` | `false` | Disables the `username` module. | ### Variables @@ -1931,20 +2200,20 @@ The `zig` module shows the currently installed version of Zig. 次の条件の ### オプション -| Option | デフォルト | 説明 | +| オプション | デフォルト | 説明 | | ---------- | ---------------------------------- | ----------------------------------------------------- | | `symbol` | `"↯ "` | The symbol used before displaying the version of Zig. | | `style` | `"bold yellow"` | モジュールのスタイルです。 | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `format` | `"via [$symbol$version]($style) "` | 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` | +| 変数 | 設定例 | 説明 | +| --------- | -------- | ---------------------- | +| version | `v0.6.0` | The version of `zig` | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -1976,24 +2245,30 @@ Multiple custom modules can be defined by using a `.`. ::: tip -The order in which custom modules are shown can be individually set by setting `custom.foo` in `prompt_order`. By default, the `custom` module will simply show all custom modules in the order they were defined. +The order in which custom modules are shown can be individually set by including `${custom.foo}` in the top level `format` (as it includes a dot, you need to use `${...}`). By default, the `custom` module will simply show all custom modules in the order they were defined. + +::: + +::: tip + +[Issue #1252](https://github.com/starship/starship/discussions/1252) contains examples of custom modules. If you have an interesting example not covered there, feel free to share it there! ::: ### オプション -| Option | デフォルト | 説明 | +| オプション | デフォルト | 説明 | | ------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. | +| `command` | | The command whose output should be printed. The command will be passed on stdin to the shell. | | `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | -| `shell` | | [この表の下を参照してください](#custom-command-shell) | -| `説明` | `""` | The description of the module that is shown when running `starship explain`. | +| `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"` | モジュールのスタイルです。 | -| `format` | `"[$symbol$output]($style) "` | The format for the module. | +| `format` | `"[$symbol$output]($style) "` | moduleのフォーマットです。 | | `disabled` | `false` | Disables this `custom` module. | ### Variables @@ -2001,8 +2276,8 @@ The order in which custom modules are shown can be individually set by setting ` | 変数 | 説明 | | --------- | -------------------------------------- | | output | The output of shell command in `shell` | -| symbol | Mirrors the value of option `symbol` | -| style\* | Mirrors the value of option `style` | +| symbol | オプション `記号` の値をミラーする | +| style\* | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string @@ -2015,6 +2290,8 @@ The order in which custom modules are shown can be individually set by setting ` If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows. +The `command` will be passed in on stdin. + If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g. ```toml @@ -2042,12 +2319,11 @@ Automatic detection of shells and proper parameters addition are currently imple command = "echo foo" # shows output of command files = ["foo"] # can specify filters when = """ test "$HOME" == "$PWD" """ -prefix = " transcending " +format = " transcending [$output]($style)" [custom.time] command = "time /T" files = ["*.pst"] -prefix = "transcending " shell = ["pwsh.exe", "-NoProfile", "-Command", "-"] ``` @@ -2055,25 +2331,25 @@ shell = ["pwsh.exe", "-NoProfile", "-Command", "-"] The `purescript` module shows the currently installed version of PureScript version. 次の条件のいずれかが満たされると、モジュールが表示されます。 -- カレントディレクトリに`spago.dhall`ファイルが含まれている +- The current directory contains a `spago.dhall` file - The current directory contains a \*.purs files ### オプション -| Option | デフォルト | 説明 | +| オプション | デフォルト | 説明 | | ---------- | ---------------------------------- | ------------------------------------------------------------ | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `format` | `"via [$symbol$version]($style) "` | 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` | +| 変数 | 設定例 | 説明 | +| --------- | -------- | --------------------------- | +| version | `0.13.5` | The version of `purescript` | +| symbol | | オプション `記号` の値をミラーする | +| style\* | | オプション `style` の値をミラーする | \*: This variable can only be used as a part of a style string diff --git a/docs/ja-JP/faq/README.md b/docs/ja-JP/faq/README.md index 917b75f6..b8882f0b 100644 --- a/docs/ja-JP/faq/README.md +++ b/docs/ja-JP/faq/README.md @@ -5,16 +5,16 @@ - **ターミナルエミュレータ**:[ iTerm2 ](https://iterm2.com/) - **テーマ**: Minimal - **カラースキーム**: [Snazzy](https://github.com/sindresorhus/iterm2-snazzy) - - **Font**: [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads) + - **フォント**: [FiraCode Nerd Font](https://www.nerdfonts.com/font-downloads) - **シェル**: [Fish Shell](https://fishshell.com/) - **設定**: [matchaiのDotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish) - **プロンプト**: [Starship](https://starship.rs/) -## `prompt_order` と `.disabled` は同じことをしますか? +## Do top level `format` and `.disabled` do the same thing? はい、両方ともプロンプトでモジュールを無効にするために使用できます。 モジュールを無効にするだけの場合は、これらの理由から` .disabled `を無効にする方法をお勧めします。 -- モジュールを無効にすると、prompt_orderからモジュールを省略するよりも明確になります。 +- Disabling modules is more explicit than omitting them from the top level `format` - Starshipが更新されると、新しく作成されたモジュールがプロンプトに追加されます ## ドキュメントによると、Starshipはクロスシェル対応をしているようですが、Xシェルはサポートしていません。 なぜですか? @@ -46,43 +46,43 @@ starship prompt --help ## 古いバージョンの glibc を使用する Linux ディストリビューションで Starship を実行するにはどうすればよいですか? -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`: +"_version 'GLIBC_2のようなエラーが表示された場合。 8' が見つかりません (starshipで要求されます)_" プリビルドバイナリを使用しています(例えば、 CentOS 6 または 7 では、`glibc`の代わりに`musl`でコンパイルされたバイナリを使用できます。 ```sh curl -fsSL https://starship.rs/install.sh | bash -s --- -platform unknown-linux-musl ``` -## Why don't I see a glyph symbol in my prompt? +## プロンプトにグリフ記号が表示されないのはなぜですか? -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: +これの最も一般的な原因は、システムの設定ミスです。 いくつかのLinuxディストリビューション 特に、すぐに使用できるフォントサポートは付属していません。 次のことを確認する必要があります。 -- 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/). +- ロケールは、`de_DE.UTF-8`や` ja_JP.UTF-8などのUTF-8値に設定されています。 LC_ALL`がUTF-8値でない場合、[変更する必要があります](https://www.tecmint.com/set-system-locales-in-linux/)。 +- 絵文字フォントがインストールされています。 ほとんどのシステムにはデフォルトで絵文字フォントが付属していますが、 一部(特にArch Linux) はそうではありません。 通常、システムの パッケージマネージャーからインストールすることができます--[noto emoji](https://www.google.com/get/noto/help/emoji/)は人気な選択肢です。 +- [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" ``` -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). +1行目は[snake emoji](https://emojipedia.org/snake/)を生成し、2行目は[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) +いずれかのシンボルが正しく表示されない場合でも、システムの設定が間違っています。 残念ながら、フォント設定を正しくするのは難しい場合があります。 Discordのユーザーがお役に立てるかもしれません。 両方の記号が正しく表示されているにもかかわらず、まだStarshipに表示されていない場合は、[バグ報告をしてください!](https://github.com/starship/starship/issues/new/choose) -## How do I uninstall Starship? +## Starshipをアンインストールするにはどうすればいいですか? -Starship is just as easy to uninstall as it is to install in the first place. +Starshipは、最初の場所にインストールするのと同じくらい簡単にアンインストールできます。 -1. Remove any lines in your shell config (e.g. `~/.bashrc`) used to initialize Starship. -1. Delete the Starship binary. +1. Starshipを初期化するために使用されるシェル設定の行を削除します(例:`~/.bashrc`)。 +1. Starshipのバイナリを削除します。 -If Starship was installed using a package manager, please refer to their docs for uninstallation instructions. +Starship がパッケージマネージャを使用してインストールされている場合は、アンインストール手順については、そのドキュメントを参照してください。 -If Starship was installed using the `curl | bash` script, the following command will delete the binary: +Starship が `curl | bash` スクリプトを使用してインストールされた場合、次のコマンドはバイナリを削除します: ```sh -# Locate and delete the starship binary +# starshipバイナリを見つけて削除します rm "$(which starship)" ``` diff --git a/docs/ja-JP/guide/README.md b/docs/ja-JP/guide/README.md index 61b6d234..b2077a2a 100644 --- a/docs/ja-JP/guide/README.md +++ b/docs/ja-JP/guide/README.md @@ -112,7 +112,7 @@ - **簡単:** 迅速なインストールが可能であり、数分で使用開始可能です。

-Starshipのドキュメントを見る  ▶ +Starshipのドキュメントを見る  ▶

@@ -121,7 +121,7 @@ ### 必要なもの -- 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)). +- [Nerd Font](https://www.nerdfonts.com/)がインストールされ、端末にて有効になっている(例えば、[Fira Code Nerd Font](https://www.nerdfonts.com/font-downloads)を試してみてください)。 ### 入門 diff --git a/docs/ja-JP/migrating-to-0.45.0/README.md b/docs/ja-JP/migrating-to-0.45.0/README.md new file mode 100644 index 00000000..23d5fcc8 --- /dev/null +++ b/docs/ja-JP/migrating-to-0.45.0/README.md @@ -0,0 +1,265 @@ +# 0.45への移行 + +Starship v0.45.0は、v1.0.0の準備として互換性の無い変更を含むリリースになります。 私たちはより多くのカスタマイズを可能にするために、プロンプトでの設定方法にいくつかの大きな変更を加えました。 + +このガイドは、互換性のない変更を説明することを意図しています。 + +## `prompt_order`をルートレベルの`format`に置換 + +v0.45.0以前は、`prompt_order` はStarshipによってレンダリングされる順序でモジュール名の配列を指定できるようになっていました。 + +Starship v0.45.0は代わりに `format` を指定できるようになり、モジュール自体の外側でプロンプトをカスタマイズ可能になります。 + +**v0.45.0以前の設定例** + +```toml +prompt_order = [ + "username", + "hostname", + "directory", + "git_branch", + "git_commit", + "git_state", + "git_status", + "cmd_duration", + "custom", + "line_break", + "jobs", + "battery", + "time", + "character", +] +``` + +**v0.45.0での設定例** + +```toml +format = """\ + $username\ + $hostname\ + $directory\ + $git_branch\ + $git_commit\ + $git_state\ + $git_status\ + $cmd_duration\ + $custom\ + $line_break\ + $jobs\ + $battery\ + $time\ + $character\ + """ +``` + +## `prefix`と `suffix` モジュールが`format`を置換 + +v0.45.0以前では、モジュールのレンダリング方法をスタイリングするために、 `prefix` や`suffix`の指定可能なモジュールがありました。 + +Starship v0.45.0 は代わりに `format` の値を受け付け、モジュールのレンダリング方法をさらにカスタマイズすることができます。 接頭辞と接尾辞を定義する代わりに、コンテキストベースの変数については、モジュールの出力を表現するフォーマット文字列の中から変数を置き換えることができるようになりました。 + +**v0.45.0以前の設定例** + +```toml +[cmd_duration] +prefix = "took " +``` + +**v0.45.0での設定例** + +```toml +[cmd_duration] +# $duration – コマンド実行時間 (例: "15s") +# $style – デフォルトのモジュールスタイル (例: "bold yellow") +format = "took [$duration]($style)" +``` + +### 影響を受けるモジュール + +#### Character + +| 削除されたプロパティ | 置換後 | +| ----------------------- | ---------------- | +| `symbol` | `success_symbol` | +| `use_symbol_for_status` | `error_symbol` | +| `style_success` | `success_symbol` | +| `style_failure` | `error_symbol` | + +**デフォルト設定への変更** + +```diff +[character] +-- symbol = "❯" +-- error_symbol = "✖" +-- use_symbol_for_status = true +-- vicmd_symbol = "❮" +++ success_symbol = "[❯](bold green) " +++ error_symbol = "[❯](bold red) " +++ vicmd_symbol = "[❮](bold green)" +``` + +以前は `use_symbol_for_status` プロパティを使用して、最後のコマンドがステータスコードをゼロにした場合、 `error_symbol` を表示するようにプロンプトを設定しました。 + +v0.45.0 のリリースでは、ステータスコードがゼロでないときに `error_symbol` を常に使用するようになりました。 `use_symbol_for_status` と `error_symbol` プロパティを統合します。 + +以前の `use_symbol_for_status = true` 設定を使用するようにプロンプトを設定するには、次の設定ファイルを追加します。 + +```toml +[character] +error_symbol = "[✖](bold red) " +``` + +#### Command Duration + +| 削除されたプロパティ | 置換後 | +| ---------- | -------- | +| `prefix` | `format` | + +**デフォルト設定への変更** + +```diff +[cmd_duration] +-- prefix = "took " +++ format = "took [$duration]($style)" +``` + +#### Directory + +| 削除されたプロパティ | 置換後 | +| ---------- | -------- | +| `prefix` | `format` | + +**デフォルト設定への変更** + +```diff +[directory] +-- prefix = "in " +++ format = "[$path]($style)[$lock_symbol]($lock_style)" +``` + +#### Environment Variable + +| 削除されたプロパティ | 置換後 | +| ---------- | -------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**デフォルト設定への変更** + +```diff +[env_var] +-- prefix = "" +-- suffix = "" +++ format = "with [$env_value]($style) " +``` + +#### Git Commit + +| 削除されたプロパティ | 置換後 | +| ---------- | -------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**デフォルト設定への変更** + +```diff +[git_commit] +-- prefix = "(" +-- suffix = ")" +++ format = "[\\($hash\\)]($style) " +``` + +#### Git Status + +| 削除されたプロパティ | 置換後 | +| ----------------- | -------- | +| `prefix` | `format` | +| `suffix` | `format` | +| `show_sync_count` | `format` | + +**デフォルト設定への変更** + +```diff +[git_status] +-- prefix = "[" +-- suffix = "]" +-- show_sync_count = false +++ format = "([$all_status$ahead_behind] )" +``` + +以前は `show_sync_count` プロパティを使用して、 ブランチが先行またはリモートブランチの後ろにあるコミット数を表示するようにプロンプトを設定していました。 + +v0.45.0のリリースではこれが変更されます。 + +以前の `show_sync_count = true` 設定を使用するようにプロンプトを構成するには、次の設定ファイルを設定します。 + +```toml +[git_status] +ahead = "⇡${count}" +diverged = "⇕⇡${ahead_count}⇣${behind_count}" +behind = "⇣${count}" +``` + +#### Hostname + +| 削除されたプロパティ | 置換後 | +| ---------- | -------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**デフォルト設定への変更** + +```diff +[hostname] +-- prefix = "" +-- suffix = "" +++ format = "[$hostname]($style) in " +``` + +#### Singularity + +| 削除されたプロパティ | 置換後 | +| ---------- | -------- | +| `label` | `format` | +| `prefix` | `format` | +| `suffix` | `format` | + +**デフォルト設定への変更** + +```diff +[singularity] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol\\[$env\\]]($style) " +``` + +#### Time + +| 削除されたプロパティ | 置換後 | +| ---------- | ------------- | +| `format` | `time_format` | + +**デフォルト設定への変更** + +```diff +[time] +-- format = "🕙[ %T ]" +++ time_format = "%T" +++ format = "at 🕙[$time]($style) +``` + +#### Custom Commands + +| 削除されたプロパティ | 置換後 | +| ---------- | -------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**デフォルト設定への変更** + +```diff +[custom.example] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol$output]($style) " +``` diff --git a/docs/ja-JP/presets/README.md b/docs/ja-JP/presets/README.md index 5c2ed1b2..e2543292 100644 --- a/docs/ja-JP/presets/README.md +++ b/docs/ja-JP/presets/README.md @@ -26,6 +26,9 @@ discharging_symbol = "" [conda] symbol = " " +[dart] +symbol = " " + [docker] symbol = " " @@ -68,6 +71,9 @@ symbol = " " [package] symbol = " " +[perl] +symbol = " " + [php] symbol = " " @@ -79,4 +85,7 @@ symbol = " " [rust] symbol = " " + +[swift] +symbol = "ﯣ " ``` diff --git a/docs/pt-BR/advanced-config/README.md b/docs/pt-BR/advanced-config/README.md index 2a2eb26e..6f8ea595 100644 --- a/docs/pt-BR/advanced-config/README.md +++ b/docs/pt-BR/advanced-config/README.md @@ -1,6 +1,6 @@ -# Configuração avançada +# Advanced Configuration -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. +Ainda que Starship se`ja 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 diff --git a/docs/pt-BR/config/README.md b/docs/pt-BR/config/README.md index a12c66b1..40117527 100644 --- a/docs/pt-BR/config/README.md +++ b/docs/pt-BR/config/README.md @@ -1,18 +1,12 @@ # Configuração -::: tip - -As configurações estão sendo trabalhadas. Muitas novas opções de configuração estarão disponíveis nas próximas versões. - -::: - -Para começar a configurar a starship, crie o seguinte arquivo: `~/.config/starship.toml`. +To get started configuring starship, create the following file: `~/.config/starship.toml`. ```sh 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): +All configuration for starship is done in this [TOML](https://github.com/toml-lang/toml) file: ```toml # Don't print a new line at the start of the prompt @@ -27,21 +21,35 @@ success_symbol = "[➜](bold green)" # The "success_symbol" segment is being disabled = true ``` -Você pode alterar o caminho padrão do arquivo `starship.toml` com a variável de ambiente `STARSHIP_CONFIG`: +You can change default `starship.toml` file location with `STARSHIP_CONFIG` environment variable: ```sh export STARSHIP_CONFIG=~/.starship ``` -No PowerShell (Windows) você pode adicionar a seguinte linha no seu `$PROFILE`: +Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: ```ps1 $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` -### Terminologia +### Logging -**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. +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: + +```sh +export STARSHIP_CACHE=~/.starship/cache +``` + +Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: + +```ps1 +$ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" +``` + +### Terminology + +**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. **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. @@ -77,7 +85,7 @@ For example: #### 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/). +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/). - `"fg:green bg:blue"` deixa o texto verde com o fundo azul - `"bg:blue fg:bright-green"` deixa o texto verde brilhante com o fundo azul @@ -86,7 +94,7 @@ A maioria dos módulos do starship permite que você configure o estilo de exibi - `"bold italic fg:purple"` deixa o texto em negrito e itálico com a cor roxa - `""` desabilita explicitamente todos os estilos -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. +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 @@ -102,7 +110,7 @@ For example: 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 (`\`). -- $ +- \$ - \\ - [ - ] @@ -138,15 +146,13 @@ This is the list of prompt-wide configuration options. | -------------- | ------------------------------ | ----------------------------------------------------- | | `format` | [link](#default-prompt-format) | Configure the format of the prompt. | | `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). | +| `add_newline` | `true` | Add a new line before the start of the prompt. | ### Exemplo ```toml # ~/.config/starship.toml -# Disable the newline at the start of the prompt -format = "$all" - # Use custom format format = """ [┌───────────────────>](bold green) @@ -155,20 +161,23 @@ format = """ # Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 + +# Disable the newline at the start of the prompt +add_newline = false ``` ### Default Prompt Format -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: +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 -format = "\n$all" +format = "$all" # Which is equivalent to format = """ - $username\ $hostname\ +$shlvl\ $kubernetes\ $directory\ $git_branch\ @@ -179,6 +188,7 @@ $hg_branch\ $docker_context\ $package\ $cmake\ +$dart\ $dotnet\ $elixir\ $elm\ @@ -190,17 +200,20 @@ $julia\ $nim\ $nodejs\ $ocaml\ +$perl\ $php\ $purescript\ $python\ $ruby\ $rust\ +$swift\ $terraform\ $zig\ $nix_shell\ $conda\ $memory_usage\ $aws\ +$gcloud\ $env_var\ $crystal\ $cmd_duration\ @@ -209,6 +222,7 @@ $line_break\ $jobs\ $battery\ $time\ +$status\ $character""" ``` @@ -318,9 +332,9 @@ charging_symbol = "⚡️" discharging_symbol = "💀" ``` -### Indicador de bateria +### Battery Display -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: +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: ```toml [[battery.display]] @@ -439,7 +453,7 @@ The `cmake` module shows the currently installed version of CMake if: 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 Não utilize o DEBUG-trap no Bash +::: warning Do not hook the DEBUG trap in 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. @@ -494,6 +508,7 @@ This does not suppress conda's own prompt modifier, you may want to run `conda c | `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. | +| `ignore_base` | `true` | Ignores `base` environment when activated. | | `disabled` | `false` | Disables the `conda` module. | ### Variables @@ -550,7 +565,43 @@ The `crystal` module shows the currently installed version of Crystal. The modul format = "via [✨ $version](bold blue) " ``` -## Diretório +## Dart + +The `dart` module shows the currently installed version of Dart. The module will be shown if any of the following conditions are met: + +- The current directory contains a file with `.dart` extension +- The current directory contains a `.dart_tool` directory +- The current directory contains a `pubspec.yaml` or `pubspec.lock` file + +### Opções + +| Variável | Padrão | Descrição | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🎯 "` | A format string representing the symbol of Dart | +| `style` | `"bold blue"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `dart` module. | + +### Variables + +| Variável | Exemplo | Descrição | +| --------- | -------- | ------------------------------------ | +| version | `v2.8.4` | The version of `dart` | +| symbol | | Mirrors the 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 + +[dart] +format = "via [🔰 $version](bold red) " +``` + +## Directory The `directory` module shows the path to your current directory, truncated to three parent folders. Your directory will also be truncated to the root of the git repo that you're currently in. @@ -790,7 +841,7 @@ The `env_var` module displays the current value of a selected environment variab | Variável | Exemplo | Descrição | | --------- | ------------------------------------------- | ------------------------------------------ | -| env_value | `Windows NT` (if *variable* would be `$OS`) | The environment value of option `variable` | +| 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` | @@ -841,6 +892,66 @@ The `erlang` module shows the currently installed version of Erlang/OTP. The mod format = "via [e $version](bold red) " ``` +## Gcloud + +The `gcloud` module shows the current configuration for [`gcloud`](https://cloud.google.com/sdk/gcloud) CLI. This is based on the `~/.config/gcloud/active_config` file and the `~/.config/gcloud/configurations/config_{CONFIG NAME}` file and the `CLOUDSDK_CONFIG` env var. + +### Opções + +| Variável | Padrão | Descrição | +| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- | +| `format` | `"on [$symbol$account(\\($region\\))]($style) "` | The format for the module. | +| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. | +| `region_aliases` | | Table of region aliases to display in addition to the GCP name. | +| `style` | `"bold blue"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `gcloud` module. | + +### Variables + +| Variável | Exemplo | Descrição | +| --------- | ----------------- | ------------------------------------------------------------------ | +| region | `us-central1` | The current GCP region | +| account | `foo@example.com` | The current GCP profile | +| project | | The current GCP project | +| active | `default` | The active config name written in `~/.config/gcloud/active_config` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Examples + +#### Display account and project + +```toml +# ~/.config/starship.toml + +[gcloud] +format = "on [$symbol$account(\\($project\\))]($style) " +``` + +#### Display active config name only + +```toml +# ~/.config/starship.toml + +[gcloud] +format = "[$symbol$active]($style) " +style = "bold yellow" +``` + +#### Display account and aliased region + +```toml +# ~/.config/starship.toml + +[gcloud] +symbol = "️🇬️ " +[gcloud.region_aliases] +us-central1 = "uc1" +asia-northeast1 = "an1" +``` + ## Git Branch The `git_branch` module shows the active branch of the repo in your current directory. @@ -849,7 +960,7 @@ The `git_branch` module shows the active branch of the repo in your current dire | Option | Padrão | Descrição | | ------------------- | -------------------------------- | ---------------------------------------------------------------------------------------- | -| `format` | `"on [$symbol$branch]($style) "` | The format for the module. Use `"$branch"` to refer to the current branch name. | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. Use `"$branch"` to refer to the current branch name. | | `symbol` | `" "` | A format string representing the symbol of git branch. | | `style` | `"bold purple"` | O estilo do módulo. | | `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes. | @@ -877,7 +988,7 @@ 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. @@ -925,7 +1036,7 @@ The `git_state` module will show in directories which are part of a git reposito | `am` | `"AM"` | A format string displayed when an `apply-mailbox` (`git am`) is in progress. | | `am_or_rebase` | `"AM/REBASE"` | A format string displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. | | `style` | `"bold yellow"` | O estilo do módulo. | -| `format` | `"[\\($state( $progress_current/$progress_total)\\)]($style) "` | The format for the module. | +| `format` | `"\\([$state( $progress_current/$progress_total)]($style)\\) "` | The format for the module. | | `disabled` | `false` | Disables the `git_state` module. | ### Variables @@ -955,22 +1066,21 @@ The `git_status` module shows symbols representing the state of the repo in your ### Opções -| Option | Padrão | Descrição | -| ----------------- | ----------------------------------------------- | ---------------------------------------------------- | -| `format` | "([\[$all_status$ahead_behind\]]($style) )" | The default format for `git_status` | -| `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. | +| 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` | +| `style` | `"bold red"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables @@ -981,12 +1091,12 @@ 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. | +| `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 @@ -1022,6 +1132,16 @@ renamed = "👅" deleted = "🗑" ``` +Show ahead/behind count of the branch being tracked +```toml +# ~/.config/starship.toml + +[git_status] +ahead = "⇡${count}" +diverged = "⇕⇡${ahead_count}⇣${behind_count}" +behind = "⇣${count}" +``` + ## Golang The `golang` module shows the currently installed version of Golang. The module will be shown if any of the following conditions are met: @@ -1108,7 +1228,7 @@ The `hostname` module shows the system hostname. | ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | `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. | +| `format` | `"[$hostname]($style) in "` | The format for the module. | | `style` | `"bold dimmed green"` | O estilo do módulo. | | `disabled` | `false` | Disables the `hostname` module. | @@ -1116,7 +1236,6 @@ The `hostname` module shows the system hostname. | 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` | @@ -1254,7 +1373,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | 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. | +| `format` | `"[$symbol$context( \\($namespace\\))]($style) in "` | The format for the module. | | `style` | `"cyan bold"` | O estilo do módulo. | | `namespace_spaceholder` | `none` | The value to display if no namespace was found. | | `context_aliases` | | Table of context aliases to display. | @@ -1283,7 +1402,7 @@ disabled = false "dev.local.cluster.k8s" = "dev" ``` -## Quebra de linha +## Line Break The `line_break` module separates the prompt into two lines. @@ -1302,7 +1421,7 @@ The `line_break` module separates the prompt into two lines. disabled = true ``` -## Uso de memória +## Memory Usage The `memory_usage` module shows current system memory and swap usage. @@ -1326,14 +1445,14 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ### 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` | +| 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 @@ -1435,7 +1554,7 @@ The `nix_shell` module shows the nix-shell environment. The module will be shown | 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. | +| `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. | @@ -1504,7 +1623,7 @@ format = "via [🤖 $version](bold green) " ## Package Version -The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages. +The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix` and `helm` packages. - **npm** – The `npm` package version is extracted from the `package.json` present in the current directory - **cargo** – The `cargo` package version is extracted from the `Cargo.toml` present in the current directory @@ -1513,6 +1632,8 @@ The `package` module is shown when the current directory is the repository for a - **gradle** – The `gradle` package version is extracted from the `build.gradle` present - **julia** - The package version is extracted from the `Project.toml` present - **mix** - The `mix` package version is extracted from the `mix.exs` present +- **helm** - The `helm` chart version is extracted from the `Chart.yaml` present +- **maven** - The `maven` package version is extracted from the `pom.xml` present > ⚠️ The version being shown is that of the package whose source code is in your current directory, not your package manager. @@ -1584,6 +1705,42 @@ The `ocaml` module shows the currently installed version of OCaml. The module wi format = "via [🐪 $version]($style) " ``` +## Perl + +The `perl` module shows the currently installed version of Perl. The module will be shown if any of the following conditions are met: + +- The current directory contains a `Makefile.PL` or `Build.PL` file +- The current directory contains a `cpanfile` or `cpanfile.snapshot` file +- The current directory contains a `META.json` file or `META.yml` file +- The current directory contains a `.perl-version` file +- The current directory contains a `.pl`, `.pm` or `.pod` + +### Opções + +| Variável | Padrão | Descrição | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format string for the module. | +| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl | +| `style` | `"bold 149"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `perl` module. | + +### Variables + +| Variável | Exemplo | Descrição | +| --------- | --------- | ------------------------------------ | +| version | `v5.26.1` | The version of `perl` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +### Exemplo + +```toml +# ~/.config/starship.toml + +[perl] +format = "via [🦪 $version]($style) " +``` + ## PHP The `php` module shows the currently installed version of PHP. The module will be shown if any of the following conditions are met: @@ -1640,23 +1797,25 @@ The module will be shown if any of the following conditions are met: ### Opções -| 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. | +| Option | Padrão | Descrição | +| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | The format for the module. | +| `symbol` | `"🐍 "` | A format string representing the symbol of Python | +| `style` | `"yellow bold"` | O estilo do módulo. | +| `pyenv_version_name` | `false` | Use pyenv to get Python version | +| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `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 | +| 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` | +| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` | +| virtualenv | `"venv"` | The current `virtualenv` name |
This module has some advanced configuration options. @@ -1684,7 +1843,6 @@ python_binary = "python3" [python] symbol = "👾 " pyenv_version_name = true -pyenv_prefix = "foo " ``` ## Ruby @@ -1758,6 +1916,41 @@ The `rust` module shows the currently installed version of Rust. The module will format = "via [⚙️ $version](red bold)" ``` +## SHLVL + +The `shlvl` module shows the current SHLVL ("shell level") environment variable, if it is set to a number and meets or exceeds the specified threshold. + +### Opções + +| Variável | Padrão | Descrição | +| ----------- | ---------------------------- | --------------------------------------- | +| `threshold` | `2` | Display threshold. | +| `format` | `"[$symbol$shlvl]($style) "` | The format for the module. | +| `symbol` | `"↕️ "` | The symbol used to represent the SHLVL. | +| `style` | `"bold yellow"` | O estilo do módulo. | +| `disabled` | `true` | Disables the `shlvl` module. | + +### Variables + +| Variável | Exemplo | Descrição | +| --------- | ------- | ------------------------------------ | +| shlvl | `3` | The current value of SHLVL | +| symbol | | Mirrors the 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 + +[shlvl] +disabled = false +format = "$shlvl level(s) down" +threshold = 3 +``` + ## Singularity The `singularity` module shows the current singularity image, if inside a container and `$SINGULARITY_NAME` is set. @@ -1790,6 +1983,83 @@ The `singularity` module shows the current singularity image, if inside a contai format = "[📦 \\[$env\\]]($style) " ``` +## Swift + +The `swift` module shows the currently installed version of Swift. The module will be shown if any of the following conditions are met: + +- The current directory contains a `Package.swift` file +- The current directory contains a file with the `.swift` extension + +### 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 Swift | +| `style` | `"bold 202"` | O estilo do módulo. | +| `disabled` | `false` | Disables the `swift` module. | + +### Variables + +| Variável | Exemplo | Descrição | +| --------- | -------- | ------------------------------------ | +| version | `v5.2.4` | The version of `swift` | +| symbol | | Mirrors the 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 + +[swift] +format = "via [🏎 $version](red bold)" +``` + +## Status + +The `status` module displays the exit code of the previous command. The module will be shown only if the exit code is not `0`. + +::: tip + +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: + +### Opções + +| Variável | Padrão | Descrição | +| ---------- | -------------------------- | ------------------------------------------------------ | +| `format` | `[$symbol$status]($style)` | The format of the module | +| `symbol` | `"✖"` | A format string representing the symbol for the status | +| `style` | `"bold red"` | O estilo do módulo. | +| `disabled` | `true` | Disables the `status` module. | + + +### Variables + +| Variável | Exemplo | Descrição | +| --------- | ------- | ------------------------------------ | +| status | `127` | The exit code of the last command | +| symbol | | Mirrors the 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 + +[status] +style = "bg:blue" +symbol = "💣 " +format = "[\\[$symbol$status\\]]($style) " +disabled = false + +``` + ## 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. 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: @@ -1894,13 +2164,13 @@ The `username` module shows active user's username. The module will be shown if ### Opções -| 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. | +| 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` | `"[$user]($style) in "` | The format for the module. | +| `show_always` | `false` | Always shows the `username` module. | +| `disabled` | `false` | Disables the `username` module. | ### Variables @@ -1975,7 +2245,13 @@ Multiple custom modules can be defined by using a `.`. ::: tip -The order in which custom modules are shown can be individually set by setting `custom.foo` in `prompt_order`. By default, the `custom` module will simply show all custom modules in the order they were defined. +The order in which custom modules are shown can be individually set by including `${custom.foo}` in the top level `format` (as it includes a dot, you need to use `${...}`). By default, the `custom` module will simply show all custom modules in the order they were defined. + +::: + +::: tip + +[Issue #1252](https://github.com/starship/starship/discussions/1252) contains examples of custom modules. If you have an interesting example not covered there, feel free to share it there! ::: @@ -1983,10 +2259,10 @@ The order in which custom modules are shown can be individually set by setting ` | Option | Padrão | Descrição | | ------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. | +| `command` | | The command whose output should be printed. The command will be passed on stdin to the shell. | | `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | | `shell` | | [See below](#custom-command-shell) | -| `descrição` | `""` | The description of the module that is shown when running `starship explain`. | +| `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. | @@ -2014,6 +2290,8 @@ The order in which custom modules are shown can be individually set by setting ` If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows. +The `command` will be passed in on stdin. + If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g. ```toml @@ -2041,12 +2319,11 @@ Automatic detection of shells and proper parameters addition are currently imple command = "echo foo" # shows output of command files = ["foo"] # can specify filters when = """ test "$HOME" == "$PWD" """ -prefix = " transcending " +format = " transcending [$output]($style)" [custom.time] command = "time /T" files = ["*.pst"] -prefix = "transcending " shell = ["pwsh.exe", "-NoProfile", "-Command", "-"] ``` diff --git a/docs/pt-BR/faq/README.md b/docs/pt-BR/faq/README.md index 84be958c..6c1cf627 100644 --- a/docs/pt-BR/faq/README.md +++ b/docs/pt-BR/faq/README.md @@ -10,11 +10,11 @@ - **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? +## Do top level `format` and `.disabled` do the same thing? Yes, they can both be used to disable modules in the prompt. If all you plan to do is disable modules, `.disabled` is the preferred way to do so for these reasons: -- Disabling modules is more explicit than omitting them from the prompt_order +- Disabling modules is more explicit than omitting them from the top level `format` - Newly created modules will be added to the prompt as Starship is updated ## The docs say Starship is cross-shell, but it doesn't support X shell. Why? diff --git a/docs/pt-BR/guide/README.md b/docs/pt-BR/guide/README.md index 61ac05f2..8e8a7a5b 100644 --- a/docs/pt-BR/guide/README.md +++ b/docs/pt-BR/guide/README.md @@ -112,7 +112,7 @@ - **Fácil:**Instalação rápida – comece a usar em minutos.

-Consulte a documentação  ▶ +Consulte a documentação  ▶

diff --git a/docs/pt-BR/migrating-to-0.45.0/README.md b/docs/pt-BR/migrating-to-0.45.0/README.md new file mode 100644 index 00000000..4acf1895 --- /dev/null +++ b/docs/pt-BR/migrating-to-0.45.0/README.md @@ -0,0 +1,265 @@ +# Migrating to v0.45.0 + +Starship v0.45.0 is a release containing breaking changes, in preparation for the big v1.0.0. We have made some major changes around how configuration is done on the prompt, to allow for a greater degree of customization. + +This guide is intended to walk you through the breaking changes. + +## `prompt_order` has been replaced by a root-level `format` + +Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship. + +Starship v0.45.0 will instead be accepting a `format` value, allowing for customization of the prompt outside of the modules themselves. + +**Example pre-v0.45.0 configuration** + +```toml +prompt_order = [ + "username", + "hostname", + "directory", + "git_branch", + "git_commit", + "git_state", + "git_status", + "cmd_duration", + "custom", + "line_break", + "jobs", + "battery", + "time", + "character", +] +``` + +**Example v0.45.0 configuration** + +```toml +format = """\ + $username\ + $hostname\ + $directory\ + $git_branch\ + $git_commit\ + $git_state\ + $git_status\ + $cmd_duration\ + $custom\ + $line_break\ + $jobs\ + $battery\ + $time\ + $character\ + """ +``` + +## Module `prefix` and `suffix` will be replaced by `format` + +Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered. + +Starship v0.45.0 will instead be accepting a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output. + +**Example pre-v0.45.0 configuration** + +```toml +[cmd_duration] +prefix = "took " +``` + +**Example v0.45.0 configuration** + +```toml +[cmd_duration] +# $duration – The command duration (e.g. "15s") +# $style – The default style of the module (e.g. "bold yellow") +format = "took [$duration]($style)" +``` + +### Affected Modules + +#### Caractere + +| Removed Property | Replacement | +| ----------------------- | ---------------- | +| `symbol` | `success_symbol` | +| `use_symbol_for_status` | `error_symbol` | +| `style_success` | `success_symbol` | +| `style_failure` | `error_symbol` | + +**Changes to the Default Configuration** + +```diff +[character] +-- symbol = "❯" +-- error_symbol = "✖" +-- use_symbol_for_status = true +-- vicmd_symbol = "❮" +++ success_symbol = "[❯](bold green) " +++ error_symbol = "[❯](bold red) " +++ vicmd_symbol = "[❮](bold green)" +``` + +Previously, the `use_symbol_for_status` property was used to configure the prompt to show the `error_symbol` when the last command resulted in a non-zero status code. + +With the release of v0.45.0, we now always use `error_symbol` after non-zero status codes, unifying `use_symbol_for_status` and `error_symbol` properties. + +To configure the prompt to use the older `use_symbol_for_status = true` configuration, add the following to your config file: + +```toml +[character] +error_symbol = "[✖](bold red) " +``` + +#### Tempo de execução do comando + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | + +**Changes to the Default Configuration** + +```diff +[cmd_duration] +-- prefix = "took " +++ format = "took [$duration]($style)" +``` + +#### Directory + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | + +**Changes to the Default Configuration** + +```diff +[directory] +-- prefix = "in " +++ format = "[$path]($style)[$lock_symbol]($lock_style)" +``` + +#### Environment Variable + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[env_var] +-- prefix = "" +-- suffix = "" +++ format = "with [$env_value]($style) " +``` + +#### Git Commit + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[git_commit] +-- prefix = "(" +-- suffix = ")" +++ format = "[\\($hash\\)]($style) " +``` + +#### Git Status + +| Removed Property | Replacement | +| ----------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | +| `show_sync_count` | `format` | + +**Changes to the Default Configuration** + +```diff +[git_status] +-- prefix = "[" +-- suffix = "]" +-- show_sync_count = false +++ format = "([$all_status$ahead_behind] )" +``` + +Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch. + +With the release of v0.45.0, this has been replaced with the + +To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file: + +```toml +[git_status] +ahead = "⇡${count}" +diverged = "⇕⇡${ahead_count}⇣${behind_count}" +behind = "⇣${count}" +``` + +#### Hostname + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[hostname] +-- prefix = "" +-- suffix = "" +++ format = "[$hostname]($style) in " +``` + +#### Singularity + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `label` | `format` | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[singularity] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol\\[$env\\]]($style) " +``` + +#### Time + +| Removed Property | Replacement | +| ---------------- | ------------- | +| `format` | `time_format` | + +**Changes to the Default Configuration** + +```diff +[time] +-- format = "🕙[ %T ]" +++ time_format = "%T" +++ format = "at 🕙[$time]($style) +``` + +#### Custom Commands + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[custom.example] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol$output]($style) " +``` diff --git a/docs/pt-BR/presets/README.md b/docs/pt-BR/presets/README.md index 34411326..a011494c 100644 --- a/docs/pt-BR/presets/README.md +++ b/docs/pt-BR/presets/README.md @@ -26,6 +26,9 @@ discharging_symbol = "" [conda] symbol = " " +[dart] +symbol = " " + [docker] symbol = " " @@ -68,6 +71,9 @@ symbol = " " [package] symbol = " " +[perl] +symbol = " " + [php] symbol = " " @@ -79,4 +85,7 @@ symbol = " " [rust] symbol = " " + +[swift] +symbol = "ﯣ " ``` diff --git a/docs/pt-PT/config/README.md b/docs/pt-PT/config/README.md index 8ec13467..44f8cb4f 100644 --- a/docs/pt-PT/config/README.md +++ b/docs/pt-PT/config/README.md @@ -1,11 +1,5 @@ # Configuration -::: tip - -🔥 Configuration is currently being worked on. Many new configuration options will be available in coming releases. - -::: - To get started configuring starship, create the following file: `~/.config/starship.toml`. ```sh @@ -39,6 +33,20 @@ Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` +### Logging + +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: + +```sh +export STARSHIP_CACHE=~/.starship/cache +``` + +Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: + +```ps1 +$ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" +``` + ### Terminology **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. @@ -102,7 +110,7 @@ For example: 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 (`\`). -- $ +- \$ - \\ - [ - ] @@ -138,15 +146,13 @@ This is the list of prompt-wide configuration options. | -------------- | ------------------------------ | ----------------------------------------------------- | | `format` | [link](#default-prompt-format) | Configure the format of the prompt. | | `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). | +| `add_newline` | `true` | Add a new line before the start of the prompt. | ### Example ```toml # ~/.config/starship.toml -# Disable the newline at the start of the prompt -format = "$all" - # Use custom format format = """ [┌───────────────────>](bold green) @@ -155,6 +161,9 @@ format = """ # Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 + +# Disable the newline at the start of the prompt +add_newline = false ``` ### Default Prompt Format @@ -162,13 +171,13 @@ scan_timeout = 10 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 -format = "\n$all" +format = "$all" # Which is equivalent to format = """ - $username\ $hostname\ +$shlvl\ $kubernetes\ $directory\ $git_branch\ @@ -179,6 +188,7 @@ $hg_branch\ $docker_context\ $package\ $cmake\ +$dart\ $dotnet\ $elixir\ $elm\ @@ -190,17 +200,20 @@ $julia\ $nim\ $nodejs\ $ocaml\ +$perl\ $php\ $purescript\ $python\ $ruby\ $rust\ +$swift\ $terraform\ $zig\ $nix_shell\ $conda\ $memory_usage\ $aws\ +$gcloud\ $env_var\ $crystal\ $cmd_duration\ @@ -209,6 +222,7 @@ $line_break\ $jobs\ $battery\ $time\ +$status\ $character""" ``` @@ -494,6 +508,7 @@ This does not suppress conda's own prompt modifier, you may want to run `conda c | `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. | +| `ignore_base` | `true` | Ignores `base` environment when activated. | | `disabled` | `false` | Disables the `conda` module. | ### Variables @@ -550,6 +565,42 @@ The `crystal` module shows the currently installed version of Crystal. The modul format = "via [✨ $version](bold blue) " ``` +## Dart + +The `dart` module shows the currently installed version of Dart. The module will be shown if any of the following conditions are met: + +- The current directory contains a file with `.dart` extension +- The current directory contains a `.dart_tool` directory +- The current directory contains a `pubspec.yaml` or `pubspec.lock` file + +### Options + +| Variable | Default | Description | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🎯 "` | A format string representing the symbol of Dart | +| `style` | `"bold blue"` | The style for the module. | +| `disabled` | `false` | Disables the `dart` module. | + +### Variables + +| Variable | Example | Description | +| --------- | -------- | ------------------------------------ | +| version | `v2.8.4` | The version of `dart` | +| symbol | | Mirrors the 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 + +[dart] +format = "via [🔰 $version](bold red) " +``` + ## Directory The `directory` module shows the path to your current directory, truncated to three parent folders. Your directory will also be truncated to the root of the git repo that you're currently in. @@ -790,7 +841,7 @@ The `env_var` module displays the current value of a selected environment variab | Variable | Example | Description | | --------- | ------------------------------------------- | ------------------------------------------ | -| env_value | `Windows NT` (if *variable* would be `$OS`) | The environment value of option `variable` | +| 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` | @@ -841,6 +892,66 @@ The `erlang` module shows the currently installed version of Erlang/OTP. The mod format = "via [e $version](bold red) " ``` +## Gcloud + +The `gcloud` module shows the current configuration for [`gcloud`](https://cloud.google.com/sdk/gcloud) CLI. This is based on the `~/.config/gcloud/active_config` file and the `~/.config/gcloud/configurations/config_{CONFIG NAME}` file and the `CLOUDSDK_CONFIG` env var. + +### Options + +| Variable | Default | Description | +| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- | +| `format` | `"on [$symbol$account(\\($region\\))]($style) "` | The format for the module. | +| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. | +| `region_aliases` | | Table of region aliases to display in addition to the GCP name. | +| `style` | `"bold blue"` | The style for the module. | +| `disabled` | `false` | Disables the `gcloud` module. | + +### Variables + +| Variable | Example | Description | +| --------- | ----------------- | ------------------------------------------------------------------ | +| region | `us-central1` | The current GCP region | +| account | `foo@example.com` | The current GCP profile | +| project | | The current GCP project | +| active | `default` | The active config name written in `~/.config/gcloud/active_config` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Examples + +#### Display account and project + +```toml +# ~/.config/starship.toml + +[gcloud] +format = "on [$symbol$account(\\($project\\))]($style) " +``` + +#### Display active config name only + +```toml +# ~/.config/starship.toml + +[gcloud] +format = "[$symbol$active]($style) " +style = "bold yellow" +``` + +#### Display account and aliased region + +```toml +# ~/.config/starship.toml + +[gcloud] +symbol = "️🇬️ " +[gcloud.region_aliases] +us-central1 = "uc1" +asia-northeast1 = "an1" +``` + ## Git Branch The `git_branch` module shows the active branch of the repo in your current directory. @@ -849,7 +960,7 @@ The `git_branch` module shows the active branch of the repo in your current dire | Option | Default | Description | | ------------------- | -------------------------------- | ---------------------------------------------------------------------------------------- | -| `format` | `"on [$symbol$branch]($style) "` | The format for the module. Use `"$branch"` to refer to the current branch name. | +| `format` | `"on [$symbol$branch]($style) "` | The format for the module. Use `"$branch"` to refer to the current branch name. | | `symbol` | `" "` | A format string representing the symbol of git branch. | | `style` | `"bold purple"` | The style for the module. | | `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes. | @@ -925,7 +1036,7 @@ The `git_state` module will show in directories which are part of a git reposito | `am` | `"AM"` | A format string displayed when an `apply-mailbox` (`git am`) is in progress. | | `am_or_rebase` | `"AM/REBASE"` | A format string displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. | | `style` | `"bold yellow"` | The style for the module. | -| `format` | `"[\\($state( $progress_current/$progress_total)\\)]($style) "` | The format for the module. | +| `format` | `"\\([$state( $progress_current/$progress_total)]($style)\\) "` | The format for the module. | | `disabled` | `false` | Disables the `git_state` module. | ### Variables @@ -955,22 +1066,21 @@ The `git_status` module shows symbols representing the state of the repo in your ### Options -| Option | Default | Description | -| ----------------- | ----------------------------------------------- | ---------------------------------------------------- | -| `format` | "([\[$all_status$ahead_behind\]]($style) )" | The default format for `git_status` | -| `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. | +| 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` | +| `style` | `"bold red"` | The style for the module. | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables @@ -981,12 +1091,12 @@ 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. | +| `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 @@ -1022,6 +1132,16 @@ renamed = "👅" deleted = "🗑" ``` +Show ahead/behind count of the branch being tracked +```toml +# ~/.config/starship.toml + +[git_status] +ahead = "⇡${count}" +diverged = "⇕⇡${ahead_count}⇣${behind_count}" +behind = "⇣${count}" +``` + ## Golang The `golang` module shows the currently installed version of Golang. The module will be shown if any of the following conditions are met: @@ -1108,7 +1228,7 @@ The `hostname` module shows the system hostname. | ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | `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. | +| `format` | `"[$hostname]($style) in "` | The format for the module. | | `style` | `"bold dimmed green"` | The style for the module. | | `disabled` | `false` | Disables the `hostname` module. | @@ -1116,7 +1236,6 @@ The `hostname` module shows the system hostname. | Variable | Example | Description | | --------- | ------- | ------------------------------------ | -| number | `1` | The number of jobs | | symbol | | Mirrors the value of option `symbol` | | style\* | | Mirrors the value of option `style` | @@ -1254,7 +1373,7 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y | 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. | +| `format` | `"[$symbol$context( \\($namespace\\))]($style) in "` | The format for the module. | | `style` | `"cyan bold"` | The style for the module. | | `namespace_spaceholder` | `none` | The value to display if no namespace was found. | | `context_aliases` | | Table of context aliases to display. | @@ -1326,14 +1445,14 @@ This module is disabled by default. To enable it, set `disabled` to `false` in y ### 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` | +| 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 @@ -1435,7 +1554,7 @@ The `nix_shell` module shows the nix-shell environment. The module will be shown | Option | Default | Description | | ------------ | -------------------------------------------------- | ----------------------------------------------------- | | `format` | `"via [$symbol$state( \\($name\\))]($style) "` | The format for the module. | -| `symbol` | `"❄️ "` | A format string representing the symbol of nix-shell. | +| `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. | @@ -1504,7 +1623,7 @@ format = "via [🤖 $version](bold green) " ## Package Version -The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages. +The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix` and `helm` packages. - **npm** – The `npm` package version is extracted from the `package.json` present in the current directory - **cargo** – The `cargo` package version is extracted from the `Cargo.toml` present in the current directory @@ -1513,6 +1632,8 @@ The `package` module is shown when the current directory is the repository for a - **gradle** – The `gradle` package version is extracted from the `build.gradle` present - **julia** - The package version is extracted from the `Project.toml` present - **mix** - The `mix` package version is extracted from the `mix.exs` present +- **helm** - The `helm` chart version is extracted from the `Chart.yaml` present +- **maven** - The `maven` package version is extracted from the `pom.xml` present > ⚠️ The version being shown is that of the package whose source code is in your current directory, not your package manager. @@ -1584,6 +1705,42 @@ The `ocaml` module shows the currently installed version of OCaml. The module wi format = "via [🐪 $version]($style) " ``` +## Perl + +The `perl` module shows the currently installed version of Perl. The module will be shown if any of the following conditions are met: + +- The current directory contains a `Makefile.PL` or `Build.PL` file +- The current directory contains a `cpanfile` or `cpanfile.snapshot` file +- The current directory contains a `META.json` file or `META.yml` file +- The current directory contains a `.perl-version` file +- The current directory contains a `.pl`, `.pm` or `.pod` + +### Options + +| Variable | Default | Description | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format string for the module. | +| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl | +| `style` | `"bold 149"` | The style for the module. | +| `disabled` | `false` | Disables the `perl` module. | + +### Variables + +| Variable | Example | Description | +| --------- | --------- | ------------------------------------ | +| version | `v5.26.1` | The version of `perl` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +### Example + +```toml +# ~/.config/starship.toml + +[perl] +format = "via [🦪 $version]($style) " +``` + ## PHP The `php` module shows the currently installed version of PHP. The module will be shown if any of the following conditions are met: @@ -1640,23 +1797,25 @@ The module will be shown if any of the following conditions are met: ### Options -| 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. | +| Option | Default | Description | +| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | The format for the module. | +| `symbol` | `"🐍 "` | A format string representing the symbol of Python | +| `style` | `"yellow bold"` | The style for the module. | +| `pyenv_version_name` | `false` | Use pyenv to get Python version | +| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `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 | +| 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` | +| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` | +| virtualenv | `"venv"` | The current `virtualenv` name |
This module has some advanced configuration options. @@ -1684,7 +1843,6 @@ python_binary = "python3" [python] symbol = "👾 " pyenv_version_name = true -pyenv_prefix = "foo " ``` ## Ruby @@ -1758,6 +1916,41 @@ The `rust` module shows the currently installed version of Rust. The module will format = "via [⚙️ $version](red bold)" ``` +## SHLVL + +The `shlvl` module shows the current SHLVL ("shell level") environment variable, if it is set to a number and meets or exceeds the specified threshold. + +### Options + +| Variable | Default | Description | +| ----------- | ---------------------------- | --------------------------------------- | +| `threshold` | `2` | Display threshold. | +| `format` | `"[$symbol$shlvl]($style) "` | The format for the module. | +| `symbol` | `"↕️ "` | The symbol used to represent the SHLVL. | +| `style` | `"bold yellow"` | The style for the module. | +| `disabled` | `true` | Disables the `shlvl` module. | + +### Variables + +| Variable | Example | Description | +| --------- | ------- | ------------------------------------ | +| shlvl | `3` | The current value of SHLVL | +| symbol | | Mirrors the 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 + +[shlvl] +disabled = false +format = "$shlvl level(s) down" +threshold = 3 +``` + ## Singularity The `singularity` module shows the current singularity image, if inside a container and `$SINGULARITY_NAME` is set. @@ -1790,6 +1983,83 @@ The `singularity` module shows the current singularity image, if inside a contai format = "[📦 \\[$env\\]]($style) " ``` +## Swift + +The `swift` module shows the currently installed version of Swift. The module will be shown if any of the following conditions are met: + +- The current directory contains a `Package.swift` file +- The current directory contains a file with the `.swift` extension + +### Options + +| Option | Default | Description | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐦 "` | A format string representing the symbol of Swift | +| `style` | `"bold 202"` | The style for the module. | +| `disabled` | `false` | Disables the `swift` module. | + +### Variables + +| Variable | Example | Description | +| --------- | -------- | ------------------------------------ | +| version | `v5.2.4` | The version of `swift` | +| symbol | | Mirrors the 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 + +[swift] +format = "via [🏎 $version](red bold)" +``` + +## Status + +The `status` module displays the exit code of the previous command. The module will be shown only if the exit code is not `0`. + +::: tip + +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: + +### Options + +| Variable | Default | Description | +| ---------- | -------------------------- | ------------------------------------------------------ | +| `format` | `[$symbol$status]($style)` | The format of the module | +| `symbol` | `"✖"` | A format string representing the symbol for the status | +| `style` | `"bold red"` | The style for the module. | +| `disabled` | `true` | Disables the `status` module. | + + +### Variables + +| Variable | Example | Description | +| --------- | ------- | ------------------------------------ | +| status | `127` | The exit code of the last command | +| symbol | | Mirrors the 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 + +[status] +style = "bg:blue" +symbol = "💣 " +format = "[\\[$symbol$status\\]]($style) " +disabled = false + +``` + ## 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. 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: @@ -1894,13 +2164,13 @@ The `username` module shows active user's username. The module will be shown if ### Options -| 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. | +| 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` | `"[$user]($style) in "` | The format for the module. | +| `show_always` | `false` | Always shows the `username` module. | +| `disabled` | `false` | Disables the `username` module. | ### Variables @@ -1975,7 +2245,13 @@ Multiple custom modules can be defined by using a `.`. ::: tip -The order in which custom modules are shown can be individually set by setting `custom.foo` in `prompt_order`. By default, the `custom` module will simply show all custom modules in the order they were defined. +The order in which custom modules are shown can be individually set by including `${custom.foo}` in the top level `format` (as it includes a dot, you need to use `${...}`). By default, the `custom` module will simply show all custom modules in the order they were defined. + +::: + +::: tip + +[Issue #1252](https://github.com/starship/starship/discussions/1252) contains examples of custom modules. If you have an interesting example not covered there, feel free to share it there! ::: @@ -1983,7 +2259,7 @@ The order in which custom modules are shown can be individually set by setting ` | Option | Default | Description | | ------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. | +| `command` | | The command whose output should be printed. The command will be passed on stdin to the shell. | | `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | | `shell` | | [See below](#custom-command-shell) | | `description` | `""` | The description of the module that is shown when running `starship explain`. | @@ -2014,6 +2290,8 @@ The order in which custom modules are shown can be individually set by setting ` If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows. +The `command` will be passed in on stdin. + If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g. ```toml @@ -2041,12 +2319,11 @@ Automatic detection of shells and proper parameters addition are currently imple command = "echo foo" # shows output of command files = ["foo"] # can specify filters when = """ test "$HOME" == "$PWD" """ -prefix = " transcending " +format = " transcending [$output]($style)" [custom.time] command = "time /T" files = ["*.pst"] -prefix = "transcending " shell = ["pwsh.exe", "-NoProfile", "-Command", "-"] ``` diff --git a/docs/pt-PT/faq/README.md b/docs/pt-PT/faq/README.md index 84be958c..6c1cf627 100644 --- a/docs/pt-PT/faq/README.md +++ b/docs/pt-PT/faq/README.md @@ -10,11 +10,11 @@ - **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? +## Do top level `format` and `.disabled` do the same thing? Yes, they can both be used to disable modules in the prompt. If all you plan to do is disable modules, `.disabled` is the preferred way to do so for these reasons: -- Disabling modules is more explicit than omitting them from the prompt_order +- Disabling modules is more explicit than omitting them from the top level `format` - Newly created modules will be added to the prompt as Starship is updated ## The docs say Starship is cross-shell, but it doesn't support X shell. Why? diff --git a/docs/pt-PT/guide/README.md b/docs/pt-PT/guide/README.md index 8f1bb81f..8b96c680 100644 --- a/docs/pt-PT/guide/README.md +++ b/docs/pt-PT/guide/README.md @@ -112,7 +112,7 @@ - **Easy:** quick to install – start using it in minutes.

-Explore the Starship docs  ▶ +Explore the Starship docs  ▶

diff --git a/docs/pt-PT/migrating-to-0.45.0/README.md b/docs/pt-PT/migrating-to-0.45.0/README.md new file mode 100644 index 00000000..015af64f --- /dev/null +++ b/docs/pt-PT/migrating-to-0.45.0/README.md @@ -0,0 +1,265 @@ +# Migrating to v0.45.0 + +Starship v0.45.0 is a release containing breaking changes, in preparation for the big v1.0.0. We have made some major changes around how configuration is done on the prompt, to allow for a greater degree of customization. + +This guide is intended to walk you through the breaking changes. + +## `prompt_order` has been replaced by a root-level `format` + +Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship. + +Starship v0.45.0 will instead be accepting a `format` value, allowing for customization of the prompt outside of the modules themselves. + +**Example pre-v0.45.0 configuration** + +```toml +prompt_order = [ + "username", + "hostname", + "directory", + "git_branch", + "git_commit", + "git_state", + "git_status", + "cmd_duration", + "custom", + "line_break", + "jobs", + "battery", + "time", + "character", +] +``` + +**Example v0.45.0 configuration** + +```toml +format = """\ + $username\ + $hostname\ + $directory\ + $git_branch\ + $git_commit\ + $git_state\ + $git_status\ + $cmd_duration\ + $custom\ + $line_break\ + $jobs\ + $battery\ + $time\ + $character\ + """ +``` + +## Module `prefix` and `suffix` will be replaced by `format` + +Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered. + +Starship v0.45.0 will instead be accepting a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output. + +**Example pre-v0.45.0 configuration** + +```toml +[cmd_duration] +prefix = "took " +``` + +**Example v0.45.0 configuration** + +```toml +[cmd_duration] +# $duration – The command duration (e.g. "15s") +# $style – The default style of the module (e.g. "bold yellow") +format = "took [$duration]($style)" +``` + +### Affected Modules + +#### Character + +| Removed Property | Replacement | +| ----------------------- | ---------------- | +| `symbol` | `success_symbol` | +| `use_symbol_for_status` | `error_symbol` | +| `style_success` | `success_symbol` | +| `style_failure` | `error_symbol` | + +**Changes to the Default Configuration** + +```diff +[character] +-- symbol = "❯" +-- error_symbol = "✖" +-- use_symbol_for_status = true +-- vicmd_symbol = "❮" +++ success_symbol = "[❯](bold green) " +++ error_symbol = "[❯](bold red) " +++ vicmd_symbol = "[❮](bold green)" +``` + +Previously, the `use_symbol_for_status` property was used to configure the prompt to show the `error_symbol` when the last command resulted in a non-zero status code. + +With the release of v0.45.0, we now always use `error_symbol` after non-zero status codes, unifying `use_symbol_for_status` and `error_symbol` properties. + +To configure the prompt to use the older `use_symbol_for_status = true` configuration, add the following to your config file: + +```toml +[character] +error_symbol = "[✖](bold red) " +``` + +#### Command Duration + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | + +**Changes to the Default Configuration** + +```diff +[cmd_duration] +-- prefix = "took " +++ format = "took [$duration]($style)" +``` + +#### Directory + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | + +**Changes to the Default Configuration** + +```diff +[directory] +-- prefix = "in " +++ format = "[$path]($style)[$lock_symbol]($lock_style)" +``` + +#### Environment Variable + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[env_var] +-- prefix = "" +-- suffix = "" +++ format = "with [$env_value]($style) " +``` + +#### Git Commit + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[git_commit] +-- prefix = "(" +-- suffix = ")" +++ format = "[\\($hash\\)]($style) " +``` + +#### Git Status + +| Removed Property | Replacement | +| ----------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | +| `show_sync_count` | `format` | + +**Changes to the Default Configuration** + +```diff +[git_status] +-- prefix = "[" +-- suffix = "]" +-- show_sync_count = false +++ format = "([$all_status$ahead_behind] )" +``` + +Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch. + +With the release of v0.45.0, this has been replaced with the + +To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file: + +```toml +[git_status] +ahead = "⇡${count}" +diverged = "⇕⇡${ahead_count}⇣${behind_count}" +behind = "⇣${count}" +``` + +#### Hostname + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[hostname] +-- prefix = "" +-- suffix = "" +++ format = "[$hostname]($style) in " +``` + +#### Singularity + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `label` | `format` | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[singularity] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol\\[$env\\]]($style) " +``` + +#### Time + +| Removed Property | Replacement | +| ---------------- | ------------- | +| `format` | `time_format` | + +**Changes to the Default Configuration** + +```diff +[time] +-- format = "🕙[ %T ]" +++ time_format = "%T" +++ format = "at 🕙[$time]($style) +``` + +#### Custom Commands + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[custom.example] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol$output]($style) " +``` diff --git a/docs/pt-PT/presets/README.md b/docs/pt-PT/presets/README.md index a5e2ce7e..b7623019 100644 --- a/docs/pt-PT/presets/README.md +++ b/docs/pt-PT/presets/README.md @@ -26,6 +26,9 @@ discharging_symbol = "" [conda] symbol = " " +[dart] +symbol = " " + [docker] symbol = " " @@ -68,6 +71,9 @@ symbol = " " [package] symbol = " " +[perl] +symbol = " " + [php] symbol = " " @@ -79,4 +85,7 @@ symbol = " " [rust] symbol = " " + +[swift] +symbol = "ﯣ " ``` diff --git a/docs/ru-RU/config/README.md b/docs/ru-RU/config/README.md index c2f1ec91..cc671eb7 100644 --- a/docs/ru-RU/config/README.md +++ b/docs/ru-RU/config/README.md @@ -1,18 +1,12 @@ # Конфигурация -::: tip Подсказка - -🔥 Конфигурация все еще находится в стадии разработки. Множество новых опций будут доступны в будущих версиях. - -::: - -Чтобы начать конфигурацию Starship, создайте следующий файл: `~/.config/starship.toml`. +To get started configuring starship, create the following file: `~/.config/starship.toml`. ```sh mkdir -p ~/.config && touch ~/.config/starship.toml ``` -Вся конфигурация Starship выполняется в этом файле [TOML](https://github.com/toml-lang/toml): +All configuration for starship is done in this [TOML](https://github.com/toml-lang/toml) file: ```toml # Don't print a new line at the start of the prompt @@ -27,7 +21,7 @@ success_symbol = "[➜](bold green)" # The "success_symbol" segment is being disabled = true ``` -Вы можете изменить расположение файла `starship.toml` переменной окружения `STARSHIP_CONFIG`: +You can change default `starship.toml` file location with `STARSHIP_CONFIG` environment variable: ```sh export STARSHIP_CONFIG=~/.starship @@ -39,9 +33,23 @@ Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` -### Терминология +### Logging -**Модуль**: Компонент строки, дающий информацию на основе контекстной информации вашей ОС. Например, модуль "nodejs" показывает установленную версию NodeJS на вашем компьютере, если вы находитесь в директории проекта NodeJS. +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: + +```sh +export STARSHIP_CACHE=~/.starship/cache +``` + +Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: + +```ps1 +$ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" +``` + +### Terminology + +**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. **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. @@ -77,7 +85,7 @@ For example: #### Строки стиля -В Starship, большинство модулей позволяют настроить стили отображения. Это делается записью (обычно называется `style`), которая представляет собой строку, определяющую конфигурацию. Ниже приведены несколько примеров стилей строк, а также, их действия. Подробнее о полном синтаксисе можно прочитать в [расширенном разделе конфигурации](/advanced-config/). +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/). - `"fg:green bg:blue"` устанавливает зеленый текст на синем фоне - `"bg:blue fg:bright-green"` устанавливает ярко-зеленый текст на синем фоне @@ -86,7 +94,7 @@ For example: - `"bold italic fg:purple"` устанавливает жирный фиолетовый текст - `""` выключает все стили -Обратите внимание на то, что, вид стиля зависит от вашего эмулятора терминала. Например, некоторые эмуляторы терминала будут использовать яркие цвета вместо жирного текста, и некоторые цветовые темы используют одинаковые значение для обычных и ярких цветов. Также, чтобы получить курсивный текст, ваш терминал должен поддерживать курсив. +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 @@ -102,7 +110,7 @@ For example: 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 (`\`). -- $ +- \$ - \\ - [ - ] @@ -130,23 +138,21 @@ format = ''' ## Командная строка -Ниже находится список опций, применяющихся для всей командной строки. +This is the list of prompt-wide configuration options. ### Опции -| Option | По умолчанию | Описание | -| -------------- | -------------------------------- | ------------------------------------------------------- | -| `format` | [ссылка](#default-prompt-format) | Configure the format of the prompt. | -| `scan_timeout` | `30` | Тайм-аут запуска сканирования файлов (в миллисекундах). | +| Option | По умолчанию | Описание | +| -------------- | -------------------------------- | ----------------------------------------------------- | +| `format` | [ссылка](#default-prompt-format) | Configure the format of the prompt. | +| `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). | +| `add_newline` | `true` | Add a new line before the start of the prompt. | ### Пример ```toml # ~/.config/starship.toml -# Disable the newline at the start of the prompt -format = "$all" - # Use custom format format = """ [┌───────────────────>](bold green) @@ -155,20 +161,23 @@ format = """ # Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 + +# Disable the newline at the start of the prompt +add_newline = false ``` ### Default Prompt Format -The default `format` is used to define the format of the prompt, if empty or no `format` is provided. Значение по умолчанию: +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 -format = "\n$all" +format = "$all" # Which is equivalent to format = """ - $username\ $hostname\ +$shlvl\ $kubernetes\ $directory\ $git_branch\ @@ -179,6 +188,7 @@ $hg_branch\ $docker_context\ $package\ $cmake\ +$dart\ $dotnet\ $elixir\ $elm\ @@ -190,17 +200,20 @@ $julia\ $nim\ $nodejs\ $ocaml\ +$perl\ $php\ $purescript\ $python\ $ruby\ $rust\ +$swift\ $terraform\ $zig\ $nix_shell\ $conda\ $memory_usage\ $aws\ +$gcloud\ $env_var\ $crystal\ $cmd_duration\ @@ -209,14 +222,15 @@ $line_break\ $jobs\ $battery\ $time\ +$status\ $character""" ``` ## AWS -Модуль `aws` показывает текущий регион и профиль AWS. Основано на `AWS_REGION`, `AWS_DEFAULT_REGION`, и `AWS_PROFILE` переменных окружения и файле`~/.aws/config`. +The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. -При использовании [aws-vault](https://github.com/99designs/aws-vault) профиль читается из переменной среды `AWS_VAULT`. +When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var. ### Опции @@ -282,7 +296,7 @@ symbol = "🅰 " ## Батарея -Модуль `battery` показывает насколько заряжена батарея девайса и статус зарядки на данный момент. Модуль виден только, если заряд батареи устройства меньше 10%. +The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%. ### Опции @@ -296,14 +310,14 @@ symbol = "🅰 " | `disabled` | `false` | Отключает модуль `battery`. |
-Также, есть опции для некоторых нетипичных состояний батареи. +There are also options for some uncommon battery states. | Переменная | Описание | | ---------------- | ------------------------------------------------------- | | `unknown_symbol` | Символ, отображаемый при неизвестном состоянии батареи. | | `empty_symbol` | Символ, отображаемый при пустом состоянии батареи. | -Примечание: Индикатор батареи будет скрыт при состоянии `unknown` или `empty`, если вы не указали параметр в настройках. +Note: Battery indicator will be hidden if the status is `unknown` or `empty` unless you specify the option in the config.
@@ -318,9 +332,9 @@ charging_symbol = "⚡️" discharging_symbol = "💀" ``` -### Отображение батареи +### Battery Display -Параметр `display` используется для определения того, когда индикатор батареи должен быть показан (threshhold) и как он выглядит (style). Если `display` не предоставлено. Значение по умолчанию: +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: ```toml [[battery.display]] @@ -330,7 +344,7 @@ style = "bold red" #### Опции -Опция `display` представляет собой массив следующей таблицы. +The `display` option is an array of the following table. | Переменная | Описание | | ----------- | -------------------------------------------------------- | @@ -340,23 +354,23 @@ style = "bold red" #### Пример ```toml -[[battery.display]] # стиль "bold red" (жирный красный) если заряд между 0% и 10% +[[battery.display]] # "bold red" style when capacity is between 0% and 10% threshold = 10 style = "bold red" -[[battery.display]] # стиль "bold yellow" (жирный желтый) если заряд между 10% и 30% +[[battery.display]] # "bold yellow" style when capacity is between 10% and 30% threshold = 30 style = "bold yellow" -# когда заряд батареи больше 30%, индикатор батареи скрыт +# when capacity is over 30%, the battery indicator will not be displayed ``` ## Символ -Модуль `character` показывает символ (обычно, стрелка) рядом с вводимым текстом в терминале. +The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal. -Символ показывает, была ли последняя команда успешной или нет. It can do this in two ways: +The character will tell you whether the last command was successful or not. It can do this in two ways: - changing color (`red`/`green`) - changing shape (`❯`/`✖`) @@ -437,15 +451,15 @@ The `cmake` module shows the currently installed version of CMake if: ## Длительность команды -Модуль `cmd_duration` показывает время исполнения последней команды. Модуль будет показан только, если команда заняла более двух секунд, или если задан параметр `min_time`. +The `cmd_duration` module shows how long the last command took to execute. The module will be shown only if the command took longer than two seconds, or the `min_time` config value, if it exists. -::: warning Не подключайте ловушку DEBUG к Bash +::: warning Do not hook the DEBUG trap in Bash -Если вы испоьзуете Starship в `bash`, не подключайте ловушку `DEBUG` после запуска `eval $(starship init $0)`, иначе этот модуль сломается. +If you are running Starship in `bash`, do not hook the `DEBUG` trap after running `eval $(starship init $0)`, or this module **will** break. ::: -Пользователи Bash, которым нужна функциональность, подобная preexec, могут использовать [фреймворк bash_preexec от rcaloras](https://github.com/rcaloras/bash-preexec). Просто определите массивы `preexec_functions` и `precmd_functions` перед запуском `eval $(starship init $0)`, а затем продолжайте нормально. +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. ### Опции @@ -478,11 +492,11 @@ format = "underwent [$duration](bold yellow)" ## Конда -Модуль `conda` показывает текущее окружение conda, если `$CONDA_DEFAULT_ENV` присвоено значение. +The `conda` module shows the current conda environment, if `$CONDA_DEFAULT_ENV` is set. ::: tip -Это не подавляет модификатор командной строки самой conda. Возможно, вы захотите запустить `conda config --set changeps1 False`. +This does not suppress conda's own prompt modifier, you may want to run `conda config --set changeps1 False`. ::: @@ -494,7 +508,8 @@ format = "underwent [$duration](bold yellow)" | `symbol` | `"🅒 "` | Символ перед названием окружения. | | `style` | `"bold green"` | Стиль модуля. | | `format` | `"[$symbol$environment]($style) "` | The format for the module. | -| `disabled` | `false` | Отключает модуль `conda`. | +| `ignore_base` | `true` | Ignores `base` environment when activated. | +| `disabled` | `false` | Disables the `conda` module. | ### Variables @@ -517,7 +532,7 @@ format = "[$symbol$environment](dimmed green) " ## Crystal -Модуль `crystal` показывает установленную версию Crystal. Модуль будет показан, если любое из следующих условий соблюдено: +The `crystal` module shows the currently installed version of Crystal. Модуль будет показан, если любое из следующих условий соблюдено: - Текущий каталог содержит файл `shard.yml` - Текущий каталог содержит файл `.cr` @@ -550,34 +565,70 @@ format = "[$symbol$environment](dimmed green) " format = "via [✨ $version](bold blue) " ``` -## Каталог +## Dart -Модуль `directory` показывает путь к вашей текущей директории, усеченной до трех родительских папок. Ваш каталог также будет отсечен до корня git репозитория, в котором вы находитесь. +The `dart` module shows the currently installed version of Dart. Модуль будет показан, если любое из следующих условий соблюдено: -При использовании стиля оболочки fish, вместо скрытия усеченного каталога, вы увидите укороченное имя каталога, зависимое от числа символов вы установите для этой опции. - -Например, возьмем `~/Dev/Nix/nixpkgs/pkgs` где `nixpkgs` является корневым репозиторием, и в опции установлено `1`. Вы увидите `~/D/N/nixpkgs/pkgs`, а до этого было бы `nixpkgs/pkgs`. +- The current directory contains a file with `.dart` extension +- The current directory contains a `.dart_tool` directory +- The current directory contains a `pubspec.yaml` or `pubspec.lock` file ### Опции -| Переменная | По умолчанию | Описание | -| ------------------------ | ----------------------------------------------- | ---------------------------------------------------------------------------- | -| `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. | +| Переменная | По умолчанию | Описание | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🎯 "` | A format string representing the symbol of Dart | +| `style` | `"bold blue"` | Стиль модуля. | +| `disabled` | `false` | Disables the `dart` module. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | -------- | ------------------------------------ | +| version | `v2.8.4` | The version of `dart` | +| symbol | | Mirrors the 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 + +[dart] +format = "via [🔰 $version](bold red) " +``` + +## Directory + +The `directory` module shows the path to your current directory, truncated to three parent folders. Your directory will also be truncated to the root of the git repo that you're currently in. + +When using the fish style pwd option, instead of hiding the path that is truncated, you will see a shortened name of each directory based on the number you enable for the option. + +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`. + +### Опции + +| Переменная | По умолчанию | Описание | +| ------------------------ | ----------------------------------------------- | -------------------------------------------------------------------------------- | +| `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"` | Стиль модуля. | +| `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. -| Advanced Option | По умолчанию | Описание | -| --------------------------- | ------------ | --------------------------------------------------------------------------------- | -| `substitutions` | | A table of substitutions to be made to the path. | -| `fish_style_pwd_dir_length` | `0` | Количество символов, используемых при использовании логики создания пути из fish. | -| `use_logical_path` | `true` | Отображает логический путь от оболочки (`PWD`) вместо пути от ОС. | +| Advanced Option | По умолчанию | Описание | +| --------------------------- | ------------ | ---------------------------------------------------------------------------------------- | +| `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. @@ -587,7 +638,7 @@ format = "via [✨ $version](bold blue) " "src/com/long/java/path" = "mypath" ``` -`fish_style_pwd_dir_length` взаимодействует со стандартными параметрами усечения, которые могут сначала показаться странными: если он не равен нулю, элементы пути, который обычно усекается, вместо этого отображаются с указанным количеством символов. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`. +`fish_style_pwd_dir_length` interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero, the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path `/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as `/b/t/c/o/rock/and/roll` with `fish_style_pwd_dir_length = 1`--the path components that would normally be removed are displayed with a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/on/rock/and/roll`.
@@ -609,9 +660,9 @@ format = "via [✨ $version](bold blue) " truncation_length = 8 ``` -## Контекст Docker +## Docker Context -Модуль `docker_context` показывает текущий активный [контекст Docker](https://docs.docker.com/engine/context/working-with-contexts/), если он не установлен как `default`. +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`. ### Опции @@ -644,7 +695,7 @@ format = "via [🐋 $context](blue bold)" ## Dotnet -Модуль `dotnet` показывает соответствующую версию .NET Core SDK для текущего каталога. Если SDK был закреплен в текущей директории, будет показана закрепленная версия. В противном случае модуль отображает последнюю установленную версию SDK. +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 or more of the following files are present in the current directory: @@ -660,19 +711,19 @@ This module will only be shown in your prompt when one or more of the following You'll also need the .NET Core SDK installed in order to use it correctly. -Внутренне этот модуль использует свой собственный механизм определения версий. Обычно он в два раза быстрее, чем `dotnet --version`, но он может показывать неправильную версию, если ваш .NET проект имеет необычный формат каталога. Если точность важнее, чем скорость, вы можете отключить механизм опцией `heuristic = false` в настройках модуля. +Internally, this module uses its own mechanism for version detection. Typically it is twice as fast as running `dotnet --version`, but it may show an incorrect version if your .NET project has an unusual directory layout. If accuracy is more important than speed, you can disable the mechanism by setting `heuristic = false` in the module options. The module will also show the Target Framework Moniker () when there is a csproj file in the current directory. ### Опции -| Option | По умолчанию | Описание | -| ----------- | ---------------------------------------- | ----------------------------------------------------------------- | -| `format` | `"v[$symbol$version( 🎯 $tfm)]($style) "` | The format for the module. | -| `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 "` | The symbol used before displaying the version of dotnet. | +| `heuristic` | `true` | Use faster version detection to keep starship snappy. | +| `style` | `"bold blue"` | Стиль модуля. | +| `disabled` | `false` | Disables the `dotnet` module. | ### Variables @@ -698,18 +749,18 @@ heuristic = false ## Elixir -Модуль `elixir` показывает установленную версию Elixir и Erlang/OTP. Модуль будет показан, если любое из следующих условий соблюдено: +The `elixir` module shows the currently installed version of Elixir and Erlang/OTP. Модуль будет показан, если любое из следующих условий соблюдено: -- Текущий каталог содержит файл `mix.exs`. +- The current directory contains a `mix.exs` file. ### Опции -| Option | По умолчанию | Описание | -| ---------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `symbol` | `"💧 "` | Символ, используемый перед отображением версии Elixir/Erlang. | -| `style` | `"bold purple"` | Стиль модуля. | -| `format` | `"via [$symbol$version \\(OTP $otp_version\\)]($style) "` | The format for the module elixir. | -| `disabled` | `false` | Отключает модуль `elixir`. | +| 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 @@ -733,13 +784,13 @@ symbol = "🔮 " ## Elm -Модуль `elm` показывает установленную версию Elm. Модуль будет показан, если любое из следующих условий соблюдено: +The `elm` module shows the currently installed version of Elm. Модуль будет показан, если любое из следующих условий соблюдено: -- Текущий каталог содержит файл `elm.json` -- Текущий каталог содержит файл `elm-package.json` -- Текущий каталог содержит файл `.elm-version` -- Текущий каталог содержит папку `elm-stuff` -- Текущий каталог содержит файлы `*.elm` +- The current directory contains a `elm.json` file +- The current directory contains a `elm-package.json` file +- The current directory contains a `.elm-version` file +- The current directory contains a `elm-stuff` folder +- The current directory contains a `*.elm` files ### Опции @@ -748,7 +799,7 @@ symbol = "🔮 " | `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`. | +| `disabled` | `false` | Disables the `elm` module. | ### Variables @@ -769,28 +820,28 @@ symbol = "🔮 " format = "via [ $version](cyan bold) " ``` -## Переменная Окружения +## Environment Variable -Модуль `env_var` отображает текущее значение выбранной переменной окружения. Модуль будет показан только в том случае, если любое из следующих условий соблюдено: +The `env_var` module displays the current value of a selected environment variable. The module will be shown only if any of the following conditions are met: -- Опция `variable` соответствует существующей переменной среды -- Опция `variable` не определена, но определена опция `default` +- The `variable` configuration option matches an existing environment variable +- The `variable` configuration option is not defined, but the `default` configuration option is ### Опции -| Option | По умолчанию | Описание | -| ---------- | ------------------------------ | ---------------------------------------------------------------- | -| `symbol` | | Символ, используемый перед отображением значения переменной. | -| `variable` | | Отображаемая переменная окружения. | -| `default` | | Значение отображаемое, когда выбранная переменная не определена. | -| `format` | `"with [$env_value]($style) "` | The format for the module. | -| `disabled` | `false` | Отключает модуль `env_var`. | +| Option | По умолчанию | Описание | +| ---------- | ------------------------------ | ---------------------------------------------------------------------------- | +| `symbol` | | The symbol used before displaying the variable value. | +| `variable` | | The environment variable to be displayed. | +| `default` | | The default value to be displayed when the selected variable is not defined. | +| `format` | `"with [$env_value]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `env_var` module. | ### Variables | Переменная | Пример | Описание | | ---------- | ------------------------------------------- | ------------------------------------------ | -| env_value | `Windows NT` (if *variable* would be `$OS`) | The environment value of option `variable` | +| 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` | @@ -810,8 +861,8 @@ default = "unknown shell" The `erlang` module shows the currently installed version of Erlang/OTP. Модуль будет показан, если любое из следующих условий соблюдено: -- Текущий каталог содержит файл `rebar.config`. -- Текущий каталог содержит файл `erlang.mk`. +- The current directory contains a `rebar.config` file. +- The current directory contains a `erlang.mk` file. ### Опции @@ -841,20 +892,80 @@ The `erlang` module shows the currently installed version of Erlang/OTP. Мод format = "via [e $version](bold red) " ``` -## Ветвь Git +## Gcloud -Модуль `git_branch` показывает активную ветку репозитория в вашем текущей директории. +The `gcloud` module shows the current configuration for [`gcloud`](https://cloud.google.com/sdk/gcloud) CLI. This is based on the `~/.config/gcloud/active_config` file and the `~/.config/gcloud/configurations/config_{CONFIG NAME}` file and the `CLOUDSDK_CONFIG` env var. ### Опции -| 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`. | +| Переменная | По умолчанию | Описание | +| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- | +| `format` | `"on [$symbol$account(\\($region\\))]($style) "` | The format for the module. | +| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. | +| `region_aliases` | | Table of region aliases to display in addition to the GCP name. | +| `style` | `"bold blue"` | Стиль модуля. | +| `disabled` | `false` | Disables the `gcloud` module. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | ----------------- | ------------------------------------------------------------------ | +| region | `us-central1` | The current GCP region | +| account | `foo@example.com` | The current GCP profile | +| project | | The current GCP project | +| active | `default` | The active config name written in `~/.config/gcloud/active_config` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Examples + +#### Display account and project + +```toml +# ~/.config/starship.toml + +[gcloud] +format = "on [$symbol$account(\\($project\\))]($style) " +``` + +#### Display active config name only + +```toml +# ~/.config/starship.toml + +[gcloud] +format = "[$symbol$active]($style) " +style = "bold yellow" +``` + +#### Display account and aliased region + +```toml +# ~/.config/starship.toml + +[gcloud] +symbol = "️🇬️ " +[gcloud.region_aliases] +us-central1 = "uc1" +asia-northeast1 = "an1" +``` + +## Git Branch + +The `git_branch` module shows the active branch of the repo in your current directory. + +### Опции + +| 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` | `"…"` | The symbol used to indicate a branch name was truncated. You can use `""` for no symbol. | +| `disabled` | `false` | Disables the `git_branch` module. | ### Variables @@ -877,19 +988,19 @@ truncation_length = 4 truncation_symbol = "" ``` -## Коммит Git +## Git Commit -Модуль `git_commit` показывает хэш текущего коммита репозитория в вашем текущем каталоге. +The `git_commit` module shows the current commit hash of the repo in your current directory. ### Опции -| 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`. | +| 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 @@ -909,9 +1020,9 @@ truncation_symbol = "" commit_hash_length = 4 ``` -## Состояние Git +## Git State -Модуль `git_state` будет отображаться в директориях, являющимися частью репозитория git, и там, где выполняется операция, такие как: _REBASING_, _BISECTING_, и т. д. Если есть информация о прогрессе (например, REBASING 3/10), эта информация также будет показана. +The `git_state` module will show in directories which are part of a git repository, and where there is an operation in progress, such as: _REBASING_, _BISECTING_, etc. If there is progress information (e.g., REBASING 3/10), that information will be shown too. ### Опции @@ -925,8 +1036,8 @@ commit_hash_length = 4 | `am` | `"AM"` | A format string displayed when an `apply-mailbox` (`git am`) is in progress. | | `am_or_rebase` | `"AM/REBASE"` | A format string displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. | | `style` | `"bold yellow"` | Стиль модуля. | -| `format` | `"[\\($state( $progress_current/$progress_total)\\)]($style) "` | The format for the module. | -| `disabled` | `false` | Отключает модуль `git_state`. | +| `format` | `"\\([$state( $progress_current/$progress_total)]($style)\\) "` | The format for the module. | +| `disabled` | `false` | Disables the `git_state` module. | ### Variables @@ -949,28 +1060,27 @@ format = "[\\($state( $progress_current of $progress_total)\\)]($style) " cherry_pick = "[🍒 PICKING](bold red)" ``` -## Статус Git +## Git Status -Модуль `git_status` отображает символы, представляющие состояние репозитория в вашей текущей директории. +The `git_status` module shows symbols representing the state of the repo in your current directory. ### Опции -| Option | По умолчанию | Описание | -| ----------------- | ----------------------------------------------- | ---------------------------------------------------------- | -| `format` | "([\[$all_status$ahead_behind\]]($style) )" | The default format for `git_status` | -| `conflicted` | `"="` | Эта ветка имеет конфликты слияния. | -| `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`. | +| Option | По умолчанию | Описание | +| ------------ | --------------------------------------------- | ----------------------------------- | +| `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` | +| `style` | `"bold red"` | Стиль модуля. | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables @@ -981,12 +1091,12 @@ 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. | +| `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 @@ -1000,9 +1110,9 @@ The following variables can be used in `diverged`: The following variables can be used in `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` and `deleted`: -| Переменная | Описание | -| ---------- | -------------------------- | -| `count` | Показать количество файлов | +| Переменная | Описание | +| ---------- | ------------------------ | +| `count` | Show the number of files | ### Пример @@ -1022,18 +1132,28 @@ renamed = "👅" deleted = "🗑" ``` +Show ahead/behind count of the branch being tracked +```toml +# ~/.config/starship.toml + +[git_status] +ahead = "⇡${count}" +diverged = "⇕⇡${ahead_count}⇣${behind_count}" +behind = "⇣${count}" +``` + ## Golang -Модуль `golang` показывает установленную версию Golang. Модуль будет показан, если любое из следующих условий соблюдено: +The `golang` module shows the currently installed version of Golang. Модуль будет показан, если любое из следующих условий соблюдено: -- Текущий каталог содержит файл `go.mod` -- Текущий каталог содержит файл `go.sum` -- Текущий каталог содержит файл `glide.yaml` -- Текущий каталог содержит файл `Gopkg.yml` -- Текущий каталог содержит файл `Gopkg.lock` +- The current directory contains a `go.mod` file +- The current directory contains a `go.sum` file +- The current directory contains a `glide.yaml` file +- The current directory contains a `Gopkg.yml` file +- The current directory contains a `Gopkg.lock` file - The current directory contains a `.go-version` file -- Текущий каталог содержит папку `Godeps` -- Текущий каталог содержит файл с расширением `.go` +- The current directory contains a `Godeps` directory +- The current directory contains a file with the `.go` extension ### Опции @@ -1042,7 +1162,7 @@ deleted = "🗑" | `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`. | +| `disabled` | `false` | Disables the `golang` module. | ### Variables @@ -1067,7 +1187,7 @@ format = "via [🏎💨 $version](bold cyan) " The `helm` module shows the currently installed version of Helm. Модуль будет показан, если любое из следующих условий соблюдено: -- Текущий каталог содержит файл `helmfile.yaml` +- The current directory contains a `helmfile.yaml` file - The current directory contains a `Chart.yaml` file ### Опции @@ -1098,25 +1218,24 @@ The `helm` module shows the currently installed version of Helm. Модуль б format = "via [⎈ $version](bold white) " ``` -## Имя хоста +## Hostname -Модуль `hostname` отображает имя системы (хоста). +The `hostname` module shows the system hostname. ### Опции -| Option | По умолчанию | Описание | -| ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `ssh_only` | `true` | Показывать имя хоста только при подключении к SSH-сессии. | -| `trim_at` | `"."` | Символы, по которую имя хоста будет сокращено после первого совпадения. `"."` остановится после первой точки. `""` отключит любое усечение | -| `format` | `"on [$hostname]($style) "` | The format for the module. | -| `style` | `"bold dimmed green"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `hostname`. | +| Option | По умолчанию | Описание | +| ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `ssh_only` | `true` | Only show hostname when connected to an SSH session. | +| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation | +| `format` | `"[$hostname]($style) in "` | The format for the module. | +| `style` | `"bold dimmed green"` | Стиль модуля. | +| `disabled` | `false` | Disables the `hostname` module. | ### Variables | Переменная | Пример | Описание | | ---------- | ------ | ------------------------------------ | -| number | `1` | The number of jobs | | symbol | | Mirrors the value of option `symbol` | | style\* | | Mirrors the value of option `style` | @@ -1136,7 +1255,7 @@ disabled = false ## Java -Модуль `java` показывает установленную версию Java. Модуль будет показан, если любое из следующих условий соблюдено: +The `java` module shows the currently installed version of Java. Модуль будет показан, если любое из следующих условий соблюдено: - 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 @@ -1148,7 +1267,7 @@ disabled = false | `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`. | +| `disabled` | `false` | Disables the `java` module. | ### Variables @@ -1169,19 +1288,19 @@ disabled = false symbol = "🌟 " ``` -## Задачи +## Jobs -Модуль `jobs` отображает текущее количество запущенных работ. Модуль будет показан только если работы выполняются в фоне. Модуль покажет количество запущенных задач при наличии более чем 1 задачи, или больше, чем значение конфигурации `threshold`, если оно существует. +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. ### Опции | Option | По умолчанию | Описание | | ----------- | ----------------------------- | ------------------------------------------------ | -| `threshold` | `1` | Показывать количество задач, если превышено. | +| `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"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `jobs`. | +| `disabled` | `false` | Disables the `jobs` module. | ### Variables @@ -1245,7 +1364,7 @@ Displays the current Kubernetes context name and, if set, the namespace from the ::: tip -По умолчанию этот модуль отключен. Чтобы включить его, установите `disabled` на `false` в файле конфигурации. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1254,11 +1373,11 @@ Displays the current Kubernetes context name and, if set, the namespace from the | Option | По умолчанию | Описание | | ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- | | `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. | -| `format` | `"on [$symbol$context( \\($namespace\\))]($style) "` | The format for the module. | +| `format` | `"[$symbol$context( \\($namespace\\))]($style) in "` | The format for the module. | | `style` | `"cyan bold"` | Стиль модуля. | | `namespace_spaceholder` | `none` | The value to display if no namespace was found. | | `context_aliases` | | Table of context aliases to display. | -| `disabled` | `true` | Отключает модуль `kubernetes`. | +| `disabled` | `true` | Disables the `kubernetes` module. | ### Variables @@ -1283,15 +1402,15 @@ disabled = false "dev.local.cluster.k8s" = "dev" ``` -## Перевод Строки +## Line Break -Модуль `line_break` разделяет командную строку на две строки. +The `line_break` module separates the prompt into two lines. ### Опции -| Option | По умолчанию | Описание | -| ---------- | ------------ | ------------------------------------------------------------------------ | -| `disabled` | `false` | Отключает модуль `line_break`, отображая командную строку в одну строку. | +| Option | По умолчанию | Описание | +| ---------- | ------------ | ------------------------------------------------------------------ | +| `disabled` | `false` | Disables the `line_break` module, making the prompt a single line. | ### Пример @@ -1302,38 +1421,38 @@ disabled = false disabled = true ``` -## Использование памяти +## Memory Usage -Модуль `memory_usage` отображает текущую системную память и использование подкачки. +The `memory_usage` module shows current system memory and swap usage. -По умолчанию использование подкачки отображается, если общая сумма подкачки системы не равна нулю. +By default the swap usage is displayed if the total system swap is non-zero. ::: tip -По умолчанию этот модуль отключен. Чтобы включить его, установите `disabled` на `false` в файле конфигурации. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: ### Опции -| Option | По умолчанию | Описание | -| ----------- | --------------------------------------------- | ------------------------------------------------------------------ | -| `threshold` | `75` | Скрывать использование памяти, если она не превышает этот процент. | -| `format` | `"via $symbol [${ram}( | ${swap})]($style) "` | The format for the module. | -| `symbol` | `"🐏"` | Символ, используемый перед отображением использования памяти. | -| `style` | `"bold dimmed white"` | Стиль модуля. | -| `disabled` | `true` | Отключает модуль `memory_usage`. | +| Option | По умолчанию | Описание | +| ----------- | --------------------------------------------- | -------------------------------------------------------- | +| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. | +| `format` | `"via $symbol [${ram}( | ${swap})]($style) "` | The format for the module. | +| `symbol` | `"🐏"` | The symbol used before displaying the memory usage. | +| `style` | `"bold dimmed white"` | Стиль модуля. | +| `disabled` | `true` | Disables the `memory_usage` module. | ### Variables -| Переменная | Пример | Описание | -| ------------- | ------------- | ------------------------------------------------------------------ | -| 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` | +| Переменная | Пример | Описание | +| ---------------- | ------------- | ------------------------------------------------------------------ | +| 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 @@ -1352,20 +1471,20 @@ separator = "/" style = "bold dimmed green" ``` -## Ветка Mercurial +## Mercurial Branch -Модуль `hg_branch` показывает активную ветку репозитория в вашем текущем каталоге. +The `hg_branch` module shows the active branch of the repo in your current directory. ### Опции -| Option | По умолчанию | Описание | -| ------------------- | -------------------------------- | ---------------------------------------------------------------------------------------- | -| `symbol` | `" "` | Символ, используемый перед закладкой hg или именем ветки репозитория в текущем каталоге. | -| `style` | `"bold purple"` | Стиль модуля. | -| `format` | `"on [$symbol$branch]($style) "` | The format for the module. | -| `truncation_length` | `2^63 - 1` | Обрезает имя ветки hg до X графемов | -| `truncation_symbol` | `"…"` | Символ, используемый для обозначения усечения названия ветки. | -| `disabled` | `true` | Отключает модуль `hg_branch`. | +| Option | По умолчанию | Описание | +| ------------------- | -------------------------------- | -------------------------------------------------------------------------------------------- | +| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. | +| `style` | `"bold purple"` | Стиль модуля. | +| `format` | `"on [$symbol$branch]($style) "` | 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 @@ -1392,7 +1511,7 @@ truncation_symbol = "" The `nim` module shows the currently installed version of Nim. Модуль будет показан, если любое из следующих условий соблюдено: -- Текущий каталог содержит файл `nim.cfg` +- 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 @@ -1428,18 +1547,18 @@ symbol = "🎣 " ## Nix-shell -Модуль `nix_shell` показывает окружение nix-shell. Модуль будет показываться внутри среды nix-shell. +The `nix_shell` module shows the nix-shell environment. The module will be shown when inside a nix-shell environment. ### Опции | Option | По умолчанию | Описание | | ------------ | -------------------------------------------------- | ----------------------------------------------------- | | `format` | `"via [$symbol$state( \\($name\\))]($style) "` | The format for the module. | -| `symbol` | `"❄️ "` | A format string representing the symbol of nix-shell. | +| `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`. | +| `disabled` | `false` | Disables the `nix_shell` module. | ### Variables @@ -1466,11 +1585,11 @@ format = "via [☃️ $state( \\($name\\))](bold blue) " ## NodeJS -Модуль `nodejs` показывает установленную версию NodeJS. Модуль будет показан, если любое из следующих условий соблюдено: +The `nodejs` module shows the currently installed version of NodeJS. Модуль будет показан, если любое из следующих условий соблюдено: -- Текущий каталог содержит файл `package.json` +- The current directory contains a `package.json` file - The current directory contains a `.node-version` file -- Текущий каталог содержит каталог `node_modules` +- The current directory contains a `node_modules` directory - The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension - The current directory contains a file with the `.ts` extension @@ -1481,7 +1600,7 @@ format = "via [☃️ $state( \\($name\\))](bold blue) " | `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`. | +| `disabled` | `false` | Disables the `nodejs` module. | ###  Variables @@ -1502,29 +1621,31 @@ format = "via [☃️ $state( \\($name\\))](bold blue) " format = "via [🤖 $version](bold green) " ``` -## Версия пакета +## Package Version -Модуль `package` отображается, когда текущий каталог является репозиторием для пакета и показывает его текущую версию. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages. +The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix` and `helm` packages. -- **npm** – Версия пакета `npm` из файла `package.json` в текущем каталоге -- **cargo** – Версия пакета `cargo` из файла `Cargo.toml` в текущем каталоге -- **poetry** – Версия пакета `poetry` из файла `pyproject.toml` в текущем каталоге -- **composer** – Версия пакета `composer` из `composer.json` в текущем каталоге -- **gradle** – Версия пакета `gradle` извлечена из `build.gradle` +- **npm** – The `npm` package version is extracted from the `package.json` present in the current directory +- **cargo** – The `cargo` package version is extracted from the `Cargo.toml` present in the current directory +- **poetry** – The `poetry` package version is extracted from the `pyproject.toml` present in the current directory +- **composer** – The `composer` package version is extracted from the `composer.json` present in the current directory +- **gradle** – The `gradle` package version is extracted from the `build.gradle` present - **julia** - The package version is extracted from the `Project.toml` present - **mix** - The `mix` package version is extracted from the `mix.exs` present +- **helm** - The `helm` chart version is extracted from the `Chart.yaml` present +- **maven** - The `maven` package version is extracted from the `pom.xml` present > ⚠ Показана версия пакета, исходный код которого находится в текущем каталоге, а не в менеджере пакетов. ### Опции -| 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`. | +| Option | По умолчанию | Описание | +| ----------------- | ---------------------------------- | ---------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"📦 "` | The symbol used before displaying the version the package. | +| `style` | `"bold 208"` | Стиль модуля. | +| `display_private` | `false` | Enable displaying version for packages marked as private. | +| `disabled` | `false` | Disables the `package` module. | ### Variables @@ -1584,22 +1705,58 @@ The `ocaml` module shows the currently installed version of OCaml. Модуль format = "via [🐪 $version]($style) " ``` -## PHP +## Perl -Модуль `php` показывает установленную версию PHP. Модуль будет показан, если любое из следующих условий соблюдено: +The `perl` module shows the currently installed version of Perl. Модуль будет показан, если любое из следующих условий соблюдено: -- Текущий каталог содержит файл `composer.json` -- Текущий каталог содержит файл `.php-version` -- Текущий каталог содержит файл `.php` +- The current directory contains a `Makefile.PL` or `Build.PL` file +- The current directory contains a `cpanfile` or `cpanfile.snapshot` file +- The current directory contains a `META.json` file or `META.yml` file +- The current directory contains a `.perl-version` file +- The current directory contains a `.pl`, `.pm` or `.pod` ### Опции -| Option | По умолчанию | Описание | -| ---------- | ---------------------------------- | --------------------------------------------------- | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | -| `symbol` | `"🐘 "` | Символ, используемый перед отображением версии PHP. | -| `style` | `"147 bold"` | Стиль модуля. | -| `disabled` | `false` | Отключает модуль `php`. | +| Переменная | По умолчанию | Описание | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format string for the module. | +| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl | +| `style` | `"bold 149"` | Стиль модуля. | +| `disabled` | `false` | Disables the `perl` module. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | --------- | ------------------------------------ | +| version | `v5.26.1` | The version of `perl` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +### Пример + +```toml +# ~/.config/starship.toml + +[perl] +format = "via [🦪 $version]($style) " +``` + +## PHP + +The `php` module shows the currently installed version of PHP. Модуль будет показан, если любое из следующих условий соблюдено: + +- The current directory contains a `composer.json` file +- The current directory contains a `.php-version` file +- The current directory contains a `.php` file + +### Опции + +| 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 @@ -1628,35 +1785,37 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name Модуль будет показан, если любое из следующих условий соблюдено: -- Текущий каталог содержит файл `.python-version` -- Текущий каталог содержит файл `requirements.txt` -- Текущий каталог содержит файл `pyproject.toml` +- The current directory contains a `.python-version` file +- The current directory contains a `requirements.txt` file +- The current directory contains a `pyproject.toml` file - The current directory contains a file with the `.py` extension (and `scan_for_pyfiles` is true) -- Текущий каталог содержит файл `Pipfile` -- Текущий каталог содержит файл `tox.ini` -- Текущий каталог содержит файл `setup.py` +- The current directory contains a `Pipfile` file +- The current directory contains a `tox.ini` file +- The current directory contains a `setup.py` file - The current directory contains a `__init__.py` file -- Виртуальная среда в данный момент активирована +- A virtual environment is currently activated ### Опции -| 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. | +| Option | По умолчанию | Описание | +| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | The format for the module. | +| `symbol` | `"🐍 "` | A format string representing the symbol of Python | +| `style` | `"yellow bold"` | Стиль модуля. | +| `pyenv_version_name` | `false` | Use pyenv to get Python version | +| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `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 | +| Переменная | Пример | Описание | +| ------------ | --------------- | ------------------------------------------ | +| version | `"v3.8.1"` | The version of `python` | +| symbol | `"🐍 "` | Mirrors the value of option `symbol` | +| style | `"yellow bold"` | Mirrors the value of option `style` | +| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` | +| virtualenv | `"venv"` | The current `virtualenv` name |
This module has some advanced configuration options. @@ -1684,16 +1843,15 @@ python_binary = "python3" [python] symbol = "👾 " pyenv_version_name = true -pyenv_prefix = "foo " ``` ## Ruby -Модуль `ruby` показывает установленную версию Ruby. Модуль будет показан, если любое из следующих условий соблюдено: +The `ruby` module shows the currently installed version of Ruby. Модуль будет показан, если любое из следующих условий соблюдено: -- Текущий каталог содержит файл `Gemfile` -- Текущий каталог содержит файл `.ruby-version` -- Текущий каталог содержит файл `.rb` +- The current directory contains a `Gemfile` file +- The current directory contains a `.ruby-version` file +- The current directory contains a `.rb` file ### Опции @@ -1702,7 +1860,7 @@ pyenv_prefix = "foo " | `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`. | +| `disabled` | `false` | Disables the `ruby` module. | ### Variables @@ -1725,10 +1883,10 @@ symbol = "🔺 " ## Rust -Модуль `rust` показывает установленную версию Rust. Модуль будет показан, если любое из следующих условий соблюдено: +The `rust` module shows the currently installed version of Rust. Модуль будет показан, если любое из следующих условий соблюдено: -- Текущий каталог содержит файл `Cargo.toml` -- Текущий каталог содержит файл с расширением `.rs` +- The current directory contains a `Cargo.toml` file +- The current directory contains a file with the `.rs` extension ### Опции @@ -1737,7 +1895,7 @@ symbol = "🔺 " | `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`. | +| `disabled` | `false` | Disables the `rust` module. | ### Variables @@ -1758,9 +1916,44 @@ symbol = "🔺 " format = "via [⚙️ $version](red bold)" ``` +## SHLVL + +The `shlvl` module shows the current SHLVL ("shell level") environment variable, if it is set to a number and meets or exceeds the specified threshold. + +### Опции + +| Переменная | По умолчанию | Описание | +| ----------- | ---------------------------- | --------------------------------------- | +| `threshold` | `2` | Display threshold. | +| `format` | `"[$symbol$shlvl]($style) "` | The format for the module. | +| `symbol` | `"↕️ "` | The symbol used to represent the SHLVL. | +| `style` | `"bold yellow"` | Стиль модуля. | +| `disabled` | `true` | Disables the `shlvl` module. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | ------ | ------------------------------------ | +| shlvl | `3` | The current value of SHLVL | +| symbol | | Mirrors the 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 + +[shlvl] +disabled = false +format = "$shlvl level(s) down" +threshold = 3 +``` + ## Singularity -Модуль `singularity` показывает текущий образ singularity, если внутри контейнера и `$SINGULARITY_NAME` установлена. +The `singularity` module shows the current singularity image, if inside a container and `$SINGULARITY_NAME` is set. ### Опции @@ -1790,12 +1983,89 @@ format = "via [⚙️ $version](red bold)" format = "[📦 \\[$env\\]]($style) " ``` +## Swift + +The `swift` module shows the currently installed version of Swift. Модуль будет показан, если любое из следующих условий соблюдено: + +- The current directory contains a `Package.swift` file +- The current directory contains a file with the `.swift` extension + +### Опции + +| Option | По умолчанию | Описание | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐦 "` | A format string representing the symbol of Swift | +| `style` | `"bold 202"` | Стиль модуля. | +| `disabled` | `false` | Disables the `swift` module. | + +### Variables + +| Переменная | Пример | Описание | +| ---------- | -------- | ------------------------------------ | +| version | `v5.2.4` | The version of `swift` | +| symbol | | Mirrors the 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 + +[swift] +format = "via [🏎 $version](red bold)" +``` + +## Status + +The `status` module displays the exit code of the previous command. The module will be shown only if the exit code is not `0`. + +::: tip + +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: + +### Опции + +| Переменная | По умолчанию | Описание | +| ---------- | -------------------------- | ------------------------------------------------------ | +| `format` | `[$symbol$status]($style)` | The format of the module | +| `symbol` | `"✖"` | A format string representing the symbol for the status | +| `style` | `"bold red"` | Стиль модуля. | +| `disabled` | `true` | Disables the `status` module. | + + +### Variables + +| Переменная | Пример | Описание | +| ---------- | ------ | ------------------------------------ | +| status | `127` | The exit code of the last command | +| symbol | | Mirrors the 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 + +[status] +style = "bg:blue" +symbol = "💣 " +format = "[\\[$symbol$status\\]]($style) " +disabled = false + +``` + ## Terraform -Модуль `terraform` показывает выбранную рабочую область и версию terraform. По умолчанию, версия terraform не показана, так как это медленно на текущих версиях terraform, при использовании большого количества плагинов. If you still want to enable it, [follow the example shown below](#with-version). Модуль будет показан, если любое из следующих условий соблюдено: +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). Модуль будет показан, если любое из следующих условий соблюдено: -- Текущий каталог содержит папку `.terraform` -- Текущий каталог содержит файл с расширением `.tf` +- The current directory contains a `.terraform` folder +- Current directory contains a file with the `.tf` extension ### Опции @@ -1804,7 +2074,7 @@ format = "[📦 \\[$env\\]]($style) " | `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`. | +| `disabled` | `false` | Disables the `terraform` module. | ### Variables @@ -1837,35 +2107,35 @@ format = "[🏎💨 $version$workspace]($style) " format = "[🏎💨 $workspace]($style) " ``` -## Время +## Time -Модуль `time` показывает текущее **локальное** время. Значение конфигурации `format` используется пакетом [`chrono`](https://crates.io/crates/chrono) для контроля того, как отображается время. Ознакомьтесь с [документацией chrono strftime](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html), чтобы увидеть доступные параметры. +The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available. ::: tip -По умолчанию этот модуль отключен. Чтобы включить его, установите `disabled` на `false` в файле конфигурации. +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: ### Опции -| Option | По умолчанию | Описание | -| ----------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `format` | `"at [$time]($style) "` | The format string for the module. | -| `use_12hr` | `false` | Включить 12-часовое форматирование | -| `time_format` | см. ниже | [Строка формата chrono](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html), используемая для форматирования времени. | -| `style` | `"bold yellow"` | Стиль модуля времени | -| `utc_time_offset` | `"local"` | Устанавливает смещение UTC. Range from -24 < 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` | 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 `time_format` defaults to `"%r"`. Иначе по умолчанию используется `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. ### Variables | Переменная | Пример | Описание | | ---------- | ---------- | ----------------------------------- | -| время | `13:08:10` | The current time. | +| time | `13:08:10` | The current time. | | style\* | | Mirrors the value of option `style` | \*: This variable can only be used as a part of a style string @@ -1883,24 +2153,24 @@ utc_time_offset = "-5" time_range = "10:00:00-14:00:00" ``` -## Имя пользователя +## Username -Модуль `username` показывает имя текущего пользователя. Модуль будет показан, если любое из следующих условий соблюдено: +The `username` module shows active user's username. Модуль будет показан, если любое из следующих условий соблюдено: -- Текущий пользователь - root -- Текущий пользователь отличается от залогиненного -- Пользователь подключен к SSH-сессии -- Переменная `show_always` равна true +- The current user is root +- The current user isn't the same as the one that is logged in +- The user is currently connected as an SSH session +- The variable `show_always` is set to true ### Опции -| 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`. | +| Option | По умолчанию | Описание | +| ------------- | ----------------------- | ------------------------------------- | +| `style_root` | `"bold red"` | The style used when the user is root. | +| `style_user` | `"bold yellow"` | The style used for non-root users. | +| `format` | `"[$user]($style) in "` | The format for the module. | +| `show_always` | `false` | Always shows the `username` module. | +| `disabled` | `false` | Disables the `username` module. | ### Variables @@ -1975,7 +2245,13 @@ Multiple custom modules can be defined by using a `.`. ::: tip -The order in which custom modules are shown can be individually set by setting `custom.foo` in `prompt_order`. By default, the `custom` module will simply show all custom modules in the order they were defined. +The order in which custom modules are shown can be individually set by including `${custom.foo}` in the top level `format` (as it includes a dot, you need to use `${...}`). By default, the `custom` module will simply show all custom modules in the order they were defined. + +::: + +::: tip + +[Issue #1252](https://github.com/starship/starship/discussions/1252) contains examples of custom modules. If you have an interesting example not covered there, feel free to share it there! ::: @@ -1983,10 +2259,10 @@ The order in which custom modules are shown can be individually set by setting ` | Option | По умолчанию | Описание | | ------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. | +| `command` | | The command whose output should be printed. The command will be passed on stdin to the shell. | | `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | | `shell` | | [See below](#custom-command-shell) | -| `описание` | `""` | The description of the module that is shown when running `starship explain`. | +| `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. | @@ -2014,6 +2290,8 @@ The order in which custom modules are shown can be individually set by setting ` If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows. +The `command` will be passed in on stdin. + If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g. ```toml @@ -2041,12 +2319,11 @@ Automatic detection of shells and proper parameters addition are currently imple command = "echo foo" # shows output of command files = ["foo"] # can specify filters when = """ test "$HOME" == "$PWD" """ -prefix = " transcending " +format = " transcending [$output]($style)" [custom.time] command = "time /T" files = ["*.pst"] -prefix = "transcending " shell = ["pwsh.exe", "-NoProfile", "-Command", "-"] ``` @@ -2054,7 +2331,7 @@ shell = ["pwsh.exe", "-NoProfile", "-Command", "-"] The `purescript` module shows the currently installed version of PureScript version. Модуль будет показан, если любое из следующих условий соблюдено: -- Текущий каталог содержит файл `spago.dhall` +- The current directory contains a `spago.dhall` file - The current directory contains a \*.purs files ### Опции diff --git a/docs/ru-RU/faq/README.md b/docs/ru-RU/faq/README.md index f8322de8..a65c3dc9 100644 --- a/docs/ru-RU/faq/README.md +++ b/docs/ru-RU/faq/README.md @@ -10,11 +10,11 @@ - **Конфигурация**: [matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish) - **Подсказка**: [Starship](https://starship.rs/) -## `prompt_order` и `.disabled` - это одно и то же? +## Do top level `format` and `.disabled` do the same thing? Да, они могут быть использованы для отключения модулей в подсказке. Если всё, что вы хотите сделать - это отключить модули, `.disabled` - предпочитаемый способ сделать это по следующим причинам: -- Отключение модулей является более явным, чем удаление их из prompt_order +- Disabling modules is more explicit than omitting them from the top level `format` - Новосозданные модули будут добавлены в подсказку по мере обновления Starship ## В документации написано, что Starship - для многих оболочек, но он не поддерживает оболочку X. Почему? @@ -46,7 +46,7 @@ starship prompt --help ## Как запускать Starship на Linux-дистрибутивах с более ранними версиями 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`: +Если вы получаете ошибку типа "_version 'GLIBC_2.18' not found (required by starship)_" при использовании заранее собранного бинарного файла (например, на CentOS 6 или 7), вы можете использовать бинарный файл, скомпилированый с `musl` вместо `glibc`: ```sh curl -fsSL https://starship.rs/install.sh | bash -s -- --platform unknown-linux-musl diff --git a/docs/ru-RU/guide/README.md b/docs/ru-RU/guide/README.md index 6a01bee5..f820efb7 100644 --- a/docs/ru-RU/guide/README.md +++ b/docs/ru-RU/guide/README.md @@ -112,7 +112,7 @@ - **Легкая:** быстро установить - начните использовать ее в считанные минуты.

-Изучите документацию Starship  ▶ +Изучите документацию Starship  ▶

diff --git a/docs/ru-RU/migrating-to-0.45.0/README.md b/docs/ru-RU/migrating-to-0.45.0/README.md new file mode 100644 index 00000000..01e64cbc --- /dev/null +++ b/docs/ru-RU/migrating-to-0.45.0/README.md @@ -0,0 +1,265 @@ +# Migrating to v0.45.0 + +Starship v0.45.0 is a release containing breaking changes, in preparation for the big v1.0.0. We have made some major changes around how configuration is done on the prompt, to allow for a greater degree of customization. + +This guide is intended to walk you through the breaking changes. + +## `prompt_order` has been replaced by a root-level `format` + +Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship. + +Starship v0.45.0 will instead be accepting a `format` value, allowing for customization of the prompt outside of the modules themselves. + +**Example pre-v0.45.0 configuration** + +```toml +prompt_order = [ + "username", + "hostname", + "directory", + "git_branch", + "git_commit", + "git_state", + "git_status", + "cmd_duration", + "custom", + "line_break", + "jobs", + "battery", + "time", + "character", +] +``` + +**Example v0.45.0 configuration** + +```toml +format = """\ + $username\ + $hostname\ + $directory\ + $git_branch\ + $git_commit\ + $git_state\ + $git_status\ + $cmd_duration\ + $custom\ + $line_break\ + $jobs\ + $battery\ + $time\ + $character\ + """ +``` + +## Module `prefix` and `suffix` will be replaced by `format` + +Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered. + +Starship v0.45.0 will instead be accepting a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output. + +**Example pre-v0.45.0 configuration** + +```toml +[cmd_duration] +prefix = "took " +``` + +**Example v0.45.0 configuration** + +```toml +[cmd_duration] +# $duration – The command duration (e.g. "15s") +# $style – The default style of the module (e.g. "bold yellow") +format = "took [$duration]($style)" +``` + +### Affected Modules + +#### Символ + +| Removed Property | Replacement | +| ----------------------- | ---------------- | +| `symbol` | `success_symbol` | +| `use_symbol_for_status` | `error_symbol` | +| `style_success` | `success_symbol` | +| `style_failure` | `error_symbol` | + +**Changes to the Default Configuration** + +```diff +[character] +-- symbol = "❯" +-- error_symbol = "✖" +-- use_symbol_for_status = true +-- vicmd_symbol = "❮" +++ success_symbol = "[❯](bold green) " +++ error_symbol = "[❯](bold red) " +++ vicmd_symbol = "[❮](bold green)" +``` + +Previously, the `use_symbol_for_status` property was used to configure the prompt to show the `error_symbol` when the last command resulted in a non-zero status code. + +With the release of v0.45.0, we now always use `error_symbol` after non-zero status codes, unifying `use_symbol_for_status` and `error_symbol` properties. + +To configure the prompt to use the older `use_symbol_for_status = true` configuration, add the following to your config file: + +```toml +[character] +error_symbol = "[✖](bold red) " +``` + +#### Длительность команды + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | + +**Changes to the Default Configuration** + +```diff +[cmd_duration] +-- prefix = "took " +++ format = "took [$duration]($style)" +``` + +#### Directory + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | + +**Changes to the Default Configuration** + +```diff +[directory] +-- prefix = "in " +++ format = "[$path]($style)[$lock_symbol]($lock_style)" +``` + +#### Environment Variable + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[env_var] +-- prefix = "" +-- suffix = "" +++ format = "with [$env_value]($style) " +``` + +#### Git Commit + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[git_commit] +-- prefix = "(" +-- suffix = ")" +++ format = "[\\($hash\\)]($style) " +``` + +#### Git Status + +| Removed Property | Replacement | +| ----------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | +| `show_sync_count` | `format` | + +**Changes to the Default Configuration** + +```diff +[git_status] +-- prefix = "[" +-- suffix = "]" +-- show_sync_count = false +++ format = "([$all_status$ahead_behind] )" +``` + +Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch. + +With the release of v0.45.0, this has been replaced with the + +To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file: + +```toml +[git_status] +ahead = "⇡${count}" +diverged = "⇕⇡${ahead_count}⇣${behind_count}" +behind = "⇣${count}" +``` + +#### Hostname + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[hostname] +-- prefix = "" +-- suffix = "" +++ format = "[$hostname]($style) in " +``` + +#### Singularity + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `label` | `format` | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[singularity] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol\\[$env\\]]($style) " +``` + +#### Time + +| Removed Property | Replacement | +| ---------------- | ------------- | +| `format` | `time_format` | + +**Changes to the Default Configuration** + +```diff +[time] +-- format = "🕙[ %T ]" +++ time_format = "%T" +++ format = "at 🕙[$time]($style) +``` + +#### Custom Commands + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[custom.example] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol$output]($style) " +``` diff --git a/docs/ru-RU/presets/README.md b/docs/ru-RU/presets/README.md index c8d8d4dc..60af8f1a 100644 --- a/docs/ru-RU/presets/README.md +++ b/docs/ru-RU/presets/README.md @@ -26,6 +26,9 @@ discharging_symbol = "" [conda] symbol = " " +[dart] +symbol = " " + [docker] symbol = " " @@ -68,6 +71,9 @@ symbol = " " [package] symbol = " " +[perl] +symbol = " " + [php] symbol = " " @@ -79,4 +85,7 @@ symbol = " " [rust] symbol = " " + +[swift] +symbol = "ﯣ " ``` diff --git a/docs/zh-CN/advanced-config/README.md b/docs/zh-CN/advanced-config/README.md index 84dffb16..7d5738bb 100644 --- a/docs/zh-CN/advanced-config/README.md +++ b/docs/zh-CN/advanced-config/README.md @@ -1,6 +1,6 @@ -# 高级配置 +# Advanced Configuration -Starship 功能繁多,有时您必须在编辑 `starship.toml` 之外做更多工作才能实现某些效果。 此页面详细介绍了一些在 starship 中使用的高级配置技巧。 +`Starship 功能繁多,有时您必须在编辑 starship.toml` 之外做更多工作才能实现某些效果。 此页面详细介绍了一些在 starship 中使用的高级配置技巧。 ::: warning diff --git a/docs/zh-CN/config/README.md b/docs/zh-CN/config/README.md index b5c4c2b1..c176fd9a 100644 --- a/docs/zh-CN/config/README.md +++ b/docs/zh-CN/config/README.md @@ -1,18 +1,12 @@ # 配置 -::: tip - -Starship 目前正在开发中。 很多新的配置选项将会在之后的版本中被公开。 - -::: - -您需要创建配置文件 `~/.config/starship.toml` 以供 Starship 使用。 +To get started configuring starship, create the following file: `~/.config/starship.toml`. ```sh mkdir -p ~/.config && touch ~/.config/starship.toml ``` -Starship 的所有配置都在此 [TOML](https://github.com/toml-lang/toml) 配置文件中完成: +All configuration for starship is done in this [TOML](https://github.com/toml-lang/toml) file: ```toml # Don't print a new line at the start of the prompt @@ -27,7 +21,7 @@ success_symbol = "[➜](bold green)" # The "success_symbol" segment is being disabled = true ``` -你可以设置环境变量 `STARSHIP_CONFIG` 来修改 starship 查找配置文件 `starship.toml` 时查找的位置: +You can change default `starship.toml` file location with `STARSHIP_CONFIG` environment variable: ```sh export STARSHIP_CONFIG=~/.starship @@ -39,9 +33,23 @@ Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` -### 术语 +### Logging -**组件(Module)**:提示符的组成部分,通过来自系统的上下文信息向用户显示各种信息。 比如“nodejs”组件会在当前目录是一个 NodeJS 项目时显示您当前安装的 NodeJS 版本。 +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: + +```sh +export STARSHIP_CACHE=~/.starship/cache +``` + +Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: + +```ps1 +$ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" +``` + +### Terminology + +**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. **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. @@ -77,7 +85,7 @@ For example: #### 样式设定 -Starship 中的大多数组件允许您为其设置显示样式。 显示样式可以通过一个字符串字段(一般是 `style`)来设置。 以下的例子给出了一些样式字符串并描述了它们的效果。 样式字符串的完整语法请查阅 [高级配置指南](/advanced-config/)。 +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/). - `"fg:green bg:blue"` 在蓝色背景上显示绿色文本 - `"bg:blue fg:bright-green"` 在蓝色背景上显示亮绿色文本 @@ -86,7 +94,7 @@ Starship 中的大多数组件允许您为其设置显示样式。 显示样式 - `"bold italic fg:purple"` 设置文本为粗体、意大利体,颜色为紫色 - `""` 显式禁用所有样式 -请注意,最终的显示样式将由您的终端模拟器控制。 例如,有的终端模拟器对于“bold”属性的文本是加亮颜色而不是加粗文字,有的颜色主题对“普通”和“明亮”两种属性的颜色使用相同的颜色值。 此外,要获得意大利体文本(一般设计为斜体),您的终端必须支持意大利体显示。 +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 @@ -102,7 +110,7 @@ For example: 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 (`\`). -- $ +- \$ - \\ - [ - ] @@ -130,23 +138,21 @@ format = ''' ## 提示符 -以下是关于提示符的配置项。 +This is the list of prompt-wide configuration options. ### 配置项 -| Option | 默认值 | 描述 | -| -------------- | ----------------------------- | ----------------------------------- | -| `format` | [见下文](#default-prompt-format) | Configure the format of the prompt. | -| `scan_timeout` | `30` | Starship 扫描文件的超时时间(单位:毫秒)。 | +| Option | 默认值 | 描述 | +| -------------- | ----------------------------- | ----------------------------------------------------- | +| `format` | [见下文](#default-prompt-format) | Configure the format of the prompt. | +| `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). | +| `add_newline` | `true` | Add a new line before the start of the prompt. | ### 示例 ```toml # ~/.config/starship.toml -# Disable the newline at the start of the prompt -format = "$all" - # Use custom format format = """ [┌───────────────────>](bold green) @@ -155,20 +161,23 @@ format = """ # Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 + +# Disable the newline at the start of the prompt +add_newline = false ``` ### Default Prompt Format -The default `format` is used to define the format of the prompt, if empty or no `format` is provided. 默认设置如下: +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 -format = "\n$all" +format = "$all" # Which is equivalent to format = """ - $username\ $hostname\ +$shlvl\ $kubernetes\ $directory\ $git_branch\ @@ -179,6 +188,7 @@ $hg_branch\ $docker_context\ $package\ $cmake\ +$dart\ $dotnet\ $elixir\ $elm\ @@ -190,17 +200,20 @@ $julia\ $nim\ $nodejs\ $ocaml\ +$perl\ $php\ $purescript\ $python\ $ruby\ $rust\ +$swift\ $terraform\ $zig\ $nix_shell\ $conda\ $memory_usage\ $aws\ +$gcloud\ $env_var\ $crystal\ $cmd_duration\ @@ -209,12 +222,13 @@ $line_break\ $jobs\ $battery\ $time\ +$status\ $character""" ``` ## AWS -`aws` 组件显示当前 AWS 主机所在区域与配置信息。 各组件基于 `AWS_REGION`,`AWS_DEFAULT_REGION` 和 `AWS_PROFILE` 环境变量与 `~/.aws/config` 文件。 +The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var. @@ -282,7 +296,7 @@ symbol = "🅰 " ## Battery -`battery` 组件显示电池充电情况和当前充电状态。 这个组件只会在当前电量低于 10% 时显示。 +The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%. ### 配置项 @@ -296,14 +310,14 @@ symbol = "🅰 " | `disabled` | `false` | 禁用 `battery` 组件。 |
-也有一些给不常见的电源状态设立的字段。 +There are also options for some uncommon battery states. | 字段 | 描述 | | ---------------- | ---------- | | `unknown_symbol` | 显示于电池状态未知时 | | `empty_symbol` | 显示于电池状态为空时 | -注意:如果状态为 `unknown` 或 `empty`,电池指示器将被隐藏,除非您在配置中指定相关选项。 +Note: Battery indicator will be hidden if the status is `unknown` or `empty` unless you specify the option in the config.
@@ -318,9 +332,9 @@ charging_symbol = "⚡️" discharging_symbol = "💀" ``` -### Battery 组件的显示 +### Battery Display -`display` 选项用于定义电池指示器的显示阈值(threshold)和显示效果(style)。 如果 `display` 没有设置, 默认设置如下: +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: ```toml [[battery.display]] @@ -330,7 +344,7 @@ style = "bold red" #### 配置项 -`display` 字段的子字段如下: +The `display` option is an array of the following table. | 字段 | 描述 | | ----------- | ---------------- | @@ -340,23 +354,23 @@ style = "bold red" #### 示例 ```toml -[[battery.display]] # 当电量在 0% 到 10% 时以 "bold red" 样式显示 +[[battery.display]] # "bold red" style when capacity is between 0% and 10% threshold = 10 style = "bold red" -[[battery.display]] # 当电量在 10% 到 30% 时以 "bold yellow" 样式显示 +[[battery.display]] # "bold yellow" style when capacity is between 10% and 30% threshold = 30 style = "bold yellow" -# 当电量在 30% 时以上时,电池指示器组件将不会显示出来 +# when capacity is over 30%, the battery indicator will not be displayed ``` ## Character -`character` 组件用于在您输入终端的文本旁显示一个字符(通常是一个箭头)。 +The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal. -这个字符可以告诉您最后一个命令是否执行成功。 It can do this in two ways: +The character will tell you whether the last command was successful or not. It can do this in two ways: - changing color (`red`/`green`) - changing shape (`❯`/`✖`) @@ -437,15 +451,15 @@ The `cmake` module shows the currently installed version of CMake if: ## Command Duration -`cmd_duration` 组件显示上一个命令执行的时间。 此组件只在命令执行时间长于两秒时显示,或者当其 `min_time` 字段被设置时,按此值为执行时间的显示下限。 +The `cmd_duration` module shows how long the last command took to execute. The module will be shown only if the command took longer than two seconds, or the `min_time` config value, if it exists. -::: warning 不要在 Bash 里捕获 DEBUG 信号 +::: warning Do not hook the DEBUG trap in Bash -如果您正在 `bash` 上使用 Starship,在运行 `eval $(starship)` 后,不要捕获 `DEBUG` 信号,否则此组件**将会**坏掉。 +If you are running Starship in `bash`, do not hook the `DEBUG` trap after running `eval $(starship init $0)`, or this module **will** break. ::: -需要在自动每一条命令前执行某些操作的 Bash 用户可以使用 [rcaloras 的 bash_preexec 框架](https://github.com/rcaloras/bash-preexec)。 只需要在执行 `eval $(starship init $0)` 前简单地定义 `preexec_functions` 和 `precmd_functions` 两个列表,就可以照常运行了。 +Bash users who need preexec-like functionality can use [rcaloras's bash_preexec framework](https://github.com/rcaloras/bash-preexec). Simply define the arrays `preexec_functions` and `precmd_functions` before running `eval $(starship init $0)`, and then proceed as normal. ### 配置项 @@ -478,11 +492,11 @@ format = "underwent [$duration](bold yellow)" ## Conda -`conda` 组件在 `$CONDA_DEFAULT_ENV` 被设置时显示当前 conda 环境。 +The `conda` module shows the current conda environment, if `$CONDA_DEFAULT_ENV` is set. ::: tip -此组件没有禁用 conda 自带的提示符修改,您可能需要执行 `conda config --set changeps1 False`。 +This does not suppress conda's own prompt modifier, you may want to run `conda config --set changeps1 False`. ::: @@ -494,7 +508,8 @@ format = "underwent [$duration](bold yellow)" | `symbol` | `"🅒 "` | 在环境名之前显示的符号。 | | `style` | `"bold green"` | 此组件的样式。 | | `format` | `"[$symbol$environment]($style) "` | The format for the module. | -| `disabled` | `false` | 禁用 `conda` 组件。 | +| `ignore_base` | `true` | Ignores `base` environment when activated. | +| `disabled` | `false` | Disables the `conda` module. | ### Variables @@ -550,34 +565,70 @@ The `crystal` module shows the currently installed version of Crystal. 此组件 format = "via [✨ $version](bold blue) " ``` -## Directory +## Dart -`directory` 组件显示当前目录的路径,显示的路径会截断到三个父目录以内。 如果您处于一个 git 仓库中,显示的路径则最多会截断到该仓库的根目录。 +The `dart` module shows the currently installed version of Dart. 此组件将在符合以下任意条件之一时显示: -当使用 fish 风格的当前目录显示样式时,您会看到基于您的设置的每个上级目录的短名称,而不是隐藏被截断的上级目录。 - -例如,对于 `~/Dev/Nix/nixpkgs/pkgs`,其中 `nixpkgs` 是 git 仓库根目录,fish 风格相关选项设置为 `1`。 您将会看到 `~/D/N/nixpkgs/pkgs`,而在设置 fish 风格之前,当前路径将显示成 `nixpkgs/pkgs`。 +- The current directory contains a file with `.dart` extension +- The current directory contains a `.dart_tool` directory +- The current directory contains a `pubspec.yaml` or `pubspec.lock` file ### 配置项 -| 字段 | 默认值 | 描述 | -| ------------------------ | ----------------------------------------------- | ----------------------------------------------------- | -| `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. | +| 字段 | 默认值 | 描述 | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🎯 "` | A format string representing the symbol of Dart | +| `style` | `"bold blue"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `dart` module. | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | -------- | ------------------------------------ | +| version | `v2.8.4` | The version of `dart` | +| symbol | | Mirrors the 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 + +[dart] +format = "via [🔰 $version](bold red) " +``` + +## Directory + +The `directory` module shows the path to your current directory, truncated to three parent folders. Your directory will also be truncated to the root of the git repo that you're currently in. + +When using the fish style pwd option, instead of hiding the path that is truncated, you will see a shortened name of each directory based on the number you enable for the option. + +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`. + +### 配置项 + +| 字段 | 默认值 | 描述 | +| ------------------------ | ----------------------------------------------- | -------------------------------------------------------------------------------- | +| `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"` | 此组件的样式。 | +| `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. -| Advanced Option | 默认值 | 描述 | -| --------------------------- | ------ | ------------------------------------------------ | -| `substitutions` | | A table of substitutions to be made to the path. | -| `fish_style_pwd_dir_length` | `0` | 使用 fish shell 当前目录路径逻辑时每个省略目录名使用的字符数。 | -| `use_logical_path` | `true` | 显示由 shell 提供的逻辑路径(`PWD`)而不是 OS 提供的路径。 | +| Advanced Option | 默认值 | 描述 | +| --------------------------- | ------ | ---------------------------------------------------------------------------------------- | +| `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. @@ -644,7 +695,7 @@ format = "via [🐋 $context](blue bold)" ## Dotnet -`dotnet` 模块显示与当前目录下使用的 .NET Core SDK 相关联的版本。 如果当前目录已被绑定了一个版本的 SDK,则显示被帮定的版本。 否则此组件将显示最新安装的 SDK 版本。 +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 or more of the following files are present in the current directory: @@ -660,19 +711,19 @@ This module will only be shown in your prompt when one or more of the following You'll also need the .NET Core SDK installed in order to use it correctly. -在内部,此组件使用自己的版本检测机制。 一般来说此组件是直接执行 `dotnet --version` 的两倍快,但当你的 .NET 项目使用了不常见的目录布局时此组件可能显示一个错误的版本。 如果相比于速度您更需要正确的版本号,您可以在组件设置中设置 `heuristic = false` 来禁用该机制。 +Internally, this module uses its own mechanism for version detection. Typically it is twice as fast as running `dotnet --version`, but it may show an incorrect version if your .NET project has an unusual directory layout. If accuracy is more important than speed, you can disable the mechanism by setting `heuristic = false` in the module options. The module will also show the Target Framework Moniker () when there is a csproj file in the current directory. ### 配置项 -| Option | 默认值 | 描述 | -| ----------- | ---------------------------------------- | ------------------------------ | -| `format` | `"v[$symbol$version( 🎯 $tfm)]($style) "` | The format for the module. | -| `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 "` | The symbol used before displaying the version of dotnet. | +| `heuristic` | `true` | Use faster version detection to keep starship snappy. | +| `style` | `"bold blue"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `dotnet` module. | ### Variables @@ -700,7 +751,7 @@ heuristic = false The `elixir` module shows the currently installed version of Elixir and Erlang/OTP. 此组件将在符合以下任意条件之一时显示: -- 当前目录包含一个 `mix.exs` 文件. +- The current directory contains a `mix.exs` file. ### 配置项 @@ -735,8 +786,8 @@ symbol = "🔮 " The `elm` module shows the currently installed version of Elm. 此组件将在符合以下任意条件之一时显示: -- 当前目录包含一个 `elm.json` 文件 -- 当前目录包含 `elm-package.json` 文件 +- The current directory contains a `elm.json` file +- The current directory contains a `elm-package.json` file - The current directory contains a `.elm-version` file - The current directory contains a `elm-stuff` folder - The current directory contains a `*.elm` files @@ -771,26 +822,26 @@ format = "via [ $version](cyan bold) " ## Environment Variable -`env_var` 组件显示选定的环境变量的当前值。 此组件只有满足以下条件之一时才会被显示: +The `env_var` module displays the current value of a selected environment variable. The module will be shown only if any of the following conditions are met: -- 设置的 `variable` 是一个已存在的环境变量 -- 未定义 `variable`,但定义了 `default` +- The `variable` configuration option matches an existing environment variable +- The `variable` configuration option is not defined, but the `default` configuration option is ### 配置项 -| Option | 默认值 | 描述 | -| ---------- | ------------------------------ | -------------------------- | -| `symbol` | | 这个字段的内容会显示在环境变量值之前。 | -| `variable` | | 要显示的环境变量。 | -| `default` | | 所选变量未定义时显示的默认值。 | -| `format` | `"with [$env_value]($style) "` | The format for the module. | -| `disabled` | `false` | 禁用 `env_var` 组件。 | +| Option | 默认值 | 描述 | +| ---------- | ------------------------------ | ---------------------------------------------------------------------------- | +| `symbol` | | The symbol used before displaying the variable value. | +| `variable` | | The environment variable to be displayed. | +| `default` | | The default value to be displayed when the selected variable is not defined. | +| `format` | `"with [$env_value]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `env_var` module. | ### Variables | 字段 | 示例 | 描述 | | --------- | ------------------------------------------- | ------------------------------------------ | -| env_value | `Windows NT` (if *variable* would be `$OS`) | The environment value of option `variable` | +| 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` | @@ -810,8 +861,8 @@ default = "unknown shell" The `erlang` module shows the currently installed version of Erlang/OTP. 此组件将在符合以下任意条件之一时显示: -- 当前目录包含一个 `rebar.config` 文件. -- 当前目录包含一个 `erlang.mk` 文件. +- The current directory contains a `rebar.config` file. +- The current directory contains a `erlang.mk` file. ### 配置项 @@ -841,20 +892,80 @@ The `erlang` module shows the currently installed version of Erlang/OTP. 此组 format = "via [e $version](bold red) " ``` -## Git Branch +## Gcloud -`git_branch` 组件显示当前目录的 git 仓库的活动分支。 +The `gcloud` module shows the current configuration for [`gcloud`](https://cloud.google.com/sdk/gcloud) CLI. This is based on the `~/.config/gcloud/active_config` file and the `~/.config/gcloud/configurations/config_{CONFIG NAME}` file and the `CLOUDSDK_CONFIG` env var. ### 配置项 -| 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` 组件。 | +| 字段 | 默认值 | 描述 | +| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- | +| `format` | `"on [$symbol$account(\\($region\\))]($style) "` | The format for the module. | +| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. | +| `region_aliases` | | Table of region aliases to display in addition to the GCP name. | +| `style` | `"bold blue"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `gcloud` module. | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | ----------------- | ------------------------------------------------------------------ | +| region | `us-central1` | The current GCP region | +| account | `foo@example.com` | The current GCP profile | +| project | | The current GCP project | +| active | `default` | The active config name written in `~/.config/gcloud/active_config` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Examples + +#### Display account and project + +```toml +# ~/.config/starship.toml + +[gcloud] +format = "on [$symbol$account(\\($project\\))]($style) " +``` + +#### Display active config name only + +```toml +# ~/.config/starship.toml + +[gcloud] +format = "[$symbol$active]($style) " +style = "bold yellow" +``` + +#### Display account and aliased region + +```toml +# ~/.config/starship.toml + +[gcloud] +symbol = "️🇬️ " +[gcloud.region_aliases] +us-central1 = "uc1" +asia-northeast1 = "an1" +``` + +## Git Branch + +The `git_branch` module shows the active branch of the repo in your current directory. + +### 配置项 + +| 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` | `"…"` | The symbol used to indicate a branch name was truncated. You can use `""` for no symbol. | +| `disabled` | `false` | Disables the `git_branch` module. | ### Variables @@ -879,17 +990,17 @@ truncation_symbol = "" ## Git Commit -`git_commit` 组件显示当前目录的 git 仓库的当前提交的哈希值。 +The `git_commit` module shows the current commit hash of the repo in your current directory. ### 配置项 | Option | 默认值 | 描述 | | -------------------- | ------------------------------ | ----------------------------------------------------- | -| `commit_hash_length` | `7` | 显示的 git 提交哈希值的长度。 | +| `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` | 禁用 `git_commit` 组件。 | +| `disabled` | `false` | Disables the `git_commit` module. | ### Variables @@ -911,7 +1022,7 @@ commit_hash_length = 4 ## Git State -`git_state` 组件会显示当前目录在哪个 git 仓库中,以及正在进行的操作,例如:_REBASING_,_BISECTING_ 等。 进度信息(例如 REBASING 3/10)如果存在则也会被显示。 +The `git_state` module will show in directories which are part of a git repository, and where there is an operation in progress, such as: _REBASING_, _BISECTING_, etc. If there is progress information (e.g., REBASING 3/10), that information will be shown too. ### 配置项 @@ -925,8 +1036,8 @@ commit_hash_length = 4 | `am` | `"AM"` | A format string displayed when an `apply-mailbox` (`git am`) is in progress. | | `am_or_rebase` | `"AM/REBASE"` | A format string displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. | | `style` | `"bold yellow"` | 此组件的样式。 | -| `format` | `"[\\($state( $progress_current/$progress_total)\\)]($style) "` | The format for the module. | -| `disabled` | `false` | 禁用 `git_state` 模块 | +| `format` | `"\\([$state( $progress_current/$progress_total)]($style)\\) "` | The format for the module. | +| `disabled` | `false` | Disables the `git_state` module. | ### Variables @@ -951,26 +1062,25 @@ cherry_pick = "[🍒 PICKING](bold red)" ## Git Status -`git_status`组件通过相应的符号显示您当前目录中 git 仓库的状态。 +The `git_status` module shows symbols representing the state of the repo in your current directory. ### 配置项 -| Option | 默认值 | 描述 | -| ----------------- | ----------------------------------------------- | ----------------------------------- | -| `format` | "([\[$all_status$ahead_behind\]]($style) )" | The default format for `git_status` | -| `conflicted` | `"="` | 这个分支有合并冲突。 | -| `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` 组件。 | +| Option | 默认值 | 描述 | +| ------------ | --------------------------------------------- | ----------------------------------- | +| `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` | +| `style` | `"bold red"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables @@ -981,12 +1091,12 @@ 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. | +| `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 @@ -1000,9 +1110,9 @@ The following variables can be used in `diverged`: The following variables can be used in `conflicted`, `ahead`, `behind`, `untracked`, `stashed`, `modified`, `staged`, `renamed` and `deleted`: -| 字段 | 描述 | -| ------- | --------- | -| `count` | 显示相应的文件数量 | +| 字段 | 描述 | +| ------- | ------------------------ | +| `count` | Show the number of files | ### 示例 @@ -1022,18 +1132,28 @@ renamed = "👅" deleted = "🗑" ``` +Show ahead/behind count of the branch being tracked +```toml +# ~/.config/starship.toml + +[git_status] +ahead = "⇡${count}" +diverged = "⇕⇡${ahead_count}⇣${behind_count}" +behind = "⇣${count}" +``` + ## Golang -`golang` 组件显示当前安装的 Golang 版本。 此组件将在符合以下任意条件之一时显示: +The `golang` module shows the currently installed version of Golang. 此组件将在符合以下任意条件之一时显示: -- 当前目录包含 `go.mod` 文件 -- 当前目录包含 `go.sum` 文件 -- 当前目录包含 `glide.yaml` 文件 -- 当前目录包含 `Gopkg.yml` 文件 -- 当前目录包含 `Gopkg.lock` 文件 +- The current directory contains a `go.mod` file +- The current directory contains a `go.sum` file +- The current directory contains a `glide.yaml` file +- The current directory contains a `Gopkg.yml` file +- The current directory contains a `Gopkg.lock` file - The current directory contains a `.go-version` file -- 当前目录包含 `Godeps` 目录 -- 当前目录包含一个使用 `.go` 扩展名的文件 +- The current directory contains a `Godeps` directory +- The current directory contains a file with the `.go` extension ### 配置项 @@ -1042,7 +1162,7 @@ deleted = "🗑" | `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` 组件。 | +| `disabled` | `false` | Disables the `golang` module. | ### Variables @@ -1067,7 +1187,7 @@ format = "via [🏎💨 $version](bold cyan) " The `helm` module shows the currently installed version of Helm. 此组件将在符合以下任意条件之一时显示: -- 当前目录包含一个 `helmfile.yaml` 文件 +- The current directory contains a `helmfile.yaml` file - The current directory contains a `Chart.yaml` file ### 配置项 @@ -1100,25 +1220,24 @@ format = "via [⎈ $version](bold white) " ## Hostname -`hostname` 组件显示系统主机名。 +The `hostname` module shows the system hostname. ### 配置项 -| Option | 默认值 | 描述 | -| ---------- | --------------------------- | ------------------------------------------------------------------ | -| `ssh_only` | `true` | 仅在连接到 SSH 会话时显示主机名。 | -| `trim_at` | `"."` | 当主机名过长被截断时,会截断成第一次匹配该字符串之前的主机名。 `"."` 会让主机名截断到第一个点处。 `""` 会禁用任何截断。 | -| `format` | `"on [$hostname]($style) "` | The format for the module. | -| `style` | `"bold dimmed green"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `hostname` 组件。 | +| Option | 默认值 | 描述 | +| ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `ssh_only` | `true` | Only show hostname when connected to an SSH session. | +| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation | +| `format` | `"[$hostname]($style) in "` | The format for the module. | +| `style` | `"bold dimmed green"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `hostname` module. | ### Variables -| 字段 | 示例 | 描述 | -| --------- | --- | ------------------------------------ | -| number | `1` | The number of jobs | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| 字段 | 示例 | 描述 | +| --------- | -- | ------------------------------------ | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | \*: This variable can only be used as a part of a style string @@ -1136,10 +1255,10 @@ disabled = false ## Java -`java` 组件显示当前安装的 Java 版本。 此组件将在符合以下任意条件之一时显示: +The `java` module shows the currently installed version of Java. 此组件将在符合以下任意条件之一时显示: - The current directory contains a `pom.xml`, `build.gradle.kts`, `build.sbt` or `.java-version` file -- 当前目录包含一个扩展名为 `.java`,`.class`,`.gradle` 或 `.jar` 的文件 +- The current directory contains a file with the `.java`, `.class`, `.gradle` or `.jar` extension ### 配置项 @@ -1148,7 +1267,7 @@ disabled = false | `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` 组件。 | +| `disabled` | `false` | Disables the `java` module. | ### Variables @@ -1171,17 +1290,17 @@ symbol = "🌟 " ## Jobs -`jobs` 组件显示当前正在运行的任务数量。 仅当有后台任务运行时,此组件才会显示。 如果有超过 1 个作业,模块将显示正在运行的作业数量,如果配置了 `threshold` 字段,则使用它作为显示作业数量的下限。 +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. ### 配置项 | Option | 默认值 | 描述 | | ----------- | ----------------------------- | ------------------------------------------------ | -| `threshold` | `1` | 如果超过此字段的值,显示任务数量。 | +| `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"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `jobs` 组件。 | +| `disabled` | `false` | Disables the `jobs` module. | ### Variables @@ -1245,7 +1364,7 @@ Displays the current Kubernetes context name and, if set, the namespace from the ::: tip -此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1254,7 +1373,7 @@ Displays the current Kubernetes context name and, if set, the namespace from the | Option | 默认值 | 描述 | | ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- | | `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. | -| `format` | `"on [$symbol$context( \\($namespace\\))]($style) "` | The format for the module. | +| `format` | `"[$symbol$context( \\($namespace\\))]($style) in "` | The format for the module. | | `style` | `"cyan bold"` | 此组件的样式。 | | `namespace_spaceholder` | `none` | The value to display if no namespace was found. | | `context_aliases` | | Table of context aliases to display. | @@ -1285,13 +1404,13 @@ disabled = false ## Line Break -`line_break` 组件将提示分隔为两行。 +The `line_break` module separates the prompt into two lines. ### 配置项 -| Option | 默认值 | 描述 | -| ---------- | ------- | --------------------------- | -| `disabled` | `false` | 禁用 `line_break` 组件,使提示成为单行。 | +| Option | 默认值 | 描述 | +| ---------- | ------- | ------------------------------------------------------------------ | +| `disabled` | `false` | Disables the `line_break` module, making the prompt a single line. | ### 示例 @@ -1304,36 +1423,36 @@ disabled = true ## Memory Usage -`memory_usage` 组件显示当前系统内存和交换区使用情况。 +The `memory_usage` module shows current system memory and swap usage. -默认情况下,如果系统交换区使用不为 0,则会显示交换区使用情况。 +By default the swap usage is displayed if the total system swap is non-zero. ::: tip -此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: ### 配置项 -| Option | 默认值 | 描述 | -| ----------- | --------------------------------------------- | -------------------------- | -| `threshold` | `75` | 隐藏内存使用情况,除非它超过这个百分比。 | -| `format` | `"via $symbol [${ram}( | ${swap})]($style) "` | The format for the module. | -| `symbol` | `"🐏"` | 这个字段的内容会显示在当前内存使用情况之前。 | -| `style` | `"bold dimmed white"` | 此组件的样式。 | -| `disabled` | `true` | 禁用 `memory_usage` 模块 | +| Option | 默认值 | 描述 | +| ----------- | --------------------------------------------- | -------------------------------------------------------- | +| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. | +| `format` | `"via $symbol [${ram}( | ${swap})]($style) "` | The format for the module. | +| `symbol` | `"🐏"` | The symbol used before displaying the memory usage. | +| `style` | `"bold dimmed white"` | 此组件的样式。 | +| `disabled` | `true` | Disables the `memory_usage` module. | ### Variables -| 字段 | 示例 | 描述 | -| ------------- | ------------- | ------------------------------------------------------------------ | -| 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` | +| 字段 | 示例 | 描述 | +| ---------------- | ------------- | ------------------------------------------------------------------ | +| 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 @@ -1354,18 +1473,18 @@ style = "bold dimmed green" ## Mercurial Branch -`hg_branch` 组件显示当前目录的 hg 仓库的活动分支。 +The `hg_branch` module shows the active branch of the repo in your current directory. ### 配置项 -| Option | 默认值 | 描述 | -| ------------------- | -------------------------------- | ------------------------------- | -| `symbol` | `" "` | 该字段的内容显示于当前仓库的 hg 书签或活动分支名之前。 | -| `style` | `"bold purple"` | 此组件的样式。 | -| `format` | `"on [$symbol$branch]($style) "` | The format for the module. | -| `truncation_length` | `2^63 - 1` | 将显示的 hg 分支名截断到该数量的字素(graphemes) | -| `truncation_symbol` | `"…"` | 此字段的内容用来表示分支名称被截断。 | -| `disabled` | `true` | 禁用 `hg_branch` 组件。 | +| Option | 默认值 | 描述 | +| ------------------- | -------------------------------- | -------------------------------------------------------------------------------------------- | +| `symbol` | `" "` | The symbol used before the hg bookmark or branch name of the repo in your current directory. | +| `style` | `"bold purple"` | 此组件的样式。 | +| `format` | `"on [$symbol$branch]($style) "` | 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 @@ -1392,7 +1511,7 @@ truncation_symbol = "" The `nim` module shows the currently installed version of Nim. 此组件将在符合以下任意条件之一时显示: -- 当前目录包含一个 `nim.cfg` 文件 +- 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 @@ -1428,18 +1547,18 @@ symbol = "🎣 " ## Nix-shell -`nix_shell` 组件显示 nix-shell 环境。 当处于一个 nix-shell 环境中时,此组件会被显示。 +The `nix_shell` module shows the nix-shell environment. The module will be shown when inside a nix-shell environment. ### 配置项 | Option | 默认值 | 描述 | | ------------ | -------------------------------------------------- | ----------------------------------------------------- | | `format` | `"via [$symbol$state( \\($name\\))]($style) "` | The format for the module. | -| `symbol` | `"❄️ "` | A format string representing the symbol of nix-shell. | +| `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` 组件。 | +| `disabled` | `false` | Disables the `nix_shell` module. | ### Variables @@ -1466,11 +1585,11 @@ format = "via [☃️ $state( \\($name\\))](bold blue) " ## NodeJS -`nodejs` 组件显示当前安装的 NodeJS 版本。 此组件将在符合以下任意条件之一时显示: +The `nodejs` module shows the currently installed version of NodeJS. 此组件将在符合以下任意条件之一时显示: -- 当前目录包含 `package.json` 文件 +- The current directory contains a `package.json` file - The current directory contains a `.node-version` file -- 当前目录包含 `node_modules` 目录 +- The current directory contains a `node_modules` directory - The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension - The current directory contains a file with the `.ts` extension @@ -1481,7 +1600,7 @@ format = "via [☃️ $state( \\($name\\))](bold blue) " | `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` 组件。 | +| `disabled` | `false` | Disables the `nodejs` module. | ###  Variables @@ -1504,27 +1623,29 @@ format = "via [🤖 $version](bold green) " ## Package Version -当前目录是软件包的代码仓库时,将显示 `package` 组件,并显示软件包当前版本。 The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages. +The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix` and `helm` packages. -- **npm** —— `npm` 软件包版本从当前目录下的 `package.json` 中得到 -- **cargo** —— `cargo` 软件包的版本从当前目录下的 `Cargo.toml` 中得到 -- **poetry** —— `poetry` 软件包版本从当前目录下的 `pyproject.toml` 中得到 -- **composer** —— `composer` 软件包版本从当前目录下的 `composer.json` 中得到 +- **npm** – The `npm` package version is extracted from the `package.json` present in the current directory +- **cargo** – The `cargo` package version is extracted from the `Cargo.toml` present in the current directory +- **poetry** – The `poetry` package version is extracted from the `pyproject.toml` present in the current directory +- **composer** – The `composer` package version is extracted from the `composer.json` present in the current directory - **gradle** – The `gradle` package version is extracted from the `build.gradle` present - **julia** - The package version is extracted from the `Project.toml` present - **mix** - The `mix` package version is extracted from the `mix.exs` present +- **helm** - The `helm` chart version is extracted from the `Chart.yaml` present +- **maven** - The `maven` package version is extracted from the `pom.xml` present > ⚠ 此组件显示的是源代码在当前目录中的软件包的版本,而不是包管理器的版本。 ### 配置项 -| 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` 组件。 | +| Option | 默认值 | 描述 | +| ----------------- | ---------------------------------- | ---------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"📦 "` | The symbol used before displaying the version the package. | +| `style` | `"bold 208"` | 此组件的样式。 | +| `display_private` | `false` | Enable displaying version for packages marked as private. | +| `disabled` | `false` | Disables the `package` module. | ### Variables @@ -1567,11 +1688,11 @@ The `ocaml` module shows the currently installed version of OCaml. 此组件将 ### Variables -| 字段 | 示例 | 描述 | -| --------- | --------- | ------------------------------------ | -| version | `v4.10.0` | The version of `ocaml` | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| 字段 | 示例 | 描述 | +| --------- | --------- | ---------------------- | +| version | `v4.10.0` | The version of `ocaml` | +| symbol | | `symbol`对应值 | +| style\* | | `style`对应值 | \*: This variable can only be used as a part of a style string @@ -1584,22 +1705,58 @@ The `ocaml` module shows the currently installed version of OCaml. 此组件将 format = "via [🐪 $version]($style) " ``` -## PHP +## Perl -`php` 组件显示当前安装的 PHP 版本。 此组件将在符合以下任意条件之一时显示: +The `perl` module shows the currently installed version of Perl. 此组件将在符合以下任意条件之一时显示: -- 当前目录包含一个 `composer.json` 文件 -- The current directory contains a `.php-version` file -- 当前目录包含一个 `.php` 文件 +- The current directory contains a `Makefile.PL` or `Build.PL` file +- The current directory contains a `cpanfile` or `cpanfile.snapshot` file +- The current directory contains a `META.json` file or `META.yml` file +- The current directory contains a `.perl-version` file +- The current directory contains a `.pl`, `.pm` or `.pod` ### 配置项 -| Option | 默认值 | 描述 | -| ---------- | ---------------------------------- | -------------------------- | -| `format` | `"via [$symbol$version]($style) "` | The format for the module. | -| `symbol` | `"🐘 "` | 这个字段的内容会显示在当前 PHP 版本之前。 | -| `style` | `"147 bold"` | 此组件的样式。 | -| `disabled` | `false` | 禁用 `php` 组件。 | +| 字段 | 默认值 | 描述 | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format string for the module. | +| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl | +| `style` | `"bold 149"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `perl` module. | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | --------- | ------------------------------------ | +| version | `v5.26.1` | The version of `perl` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +### 示例 + +```toml +# ~/.config/starship.toml + +[perl] +format = "via [🦪 $version]($style) " +``` + +## PHP + +The `php` module shows the currently installed version of PHP. 此组件将在符合以下任意条件之一时显示: + +- The current directory contains a `composer.json` file +- The current directory contains a `.php-version` file +- The current directory contains a `.php` file + +### 配置项 + +| 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 @@ -1628,35 +1785,37 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name 此组件将在符合以下任意条件之一时显示: -- 当前目录包含 `.python-version` 文件 -- 当前目录包含 `requirements.txt` 文件 -- 当前目录包含 `pyproject.toml` 文件 +- The current directory contains a `.python-version` file +- The current directory contains a `requirements.txt` file +- The current directory contains a `pyproject.toml` file - The current directory contains a file with the `.py` extension (and `scan_for_pyfiles` is true) -- 当前目录包含 `Pipfile` 文件 -- 当前目录包含一个 `tox.ini` 文件 -- 当前目录包含一个 `setup.py` 文件 +- The current directory contains a `Pipfile` file +- The current directory contains a `tox.ini` file +- The current directory contains a `setup.py` file - The current directory contains a `__init__.py` file -- 当前处于一个活跃的 python 虚拟环境中 +- A virtual environment is currently activated ### 配置项 -| 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` 组件。 | +| Option | 默认值 | 描述 | +| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | The format for the module. | +| `symbol` | `"🐍 "` | A format string representing the symbol of Python | +| `style` | `"yellow bold"` | 此组件的样式。 | +| `pyenv_version_name` | `false` | Use pyenv to get Python version | +| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `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 | +| 字段 | 示例 | 描述 | +| ------------ | --------------- | ------------------------------------------ | +| version | `"v3.8.1"` | The version of `python` | +| symbol | `"🐍 "` | Mirrors the value of option `symbol` | +| style | `"yellow bold"` | Mirrors the value of option `style` | +| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` | +| virtualenv | `"venv"` | The current `virtualenv` name |
This module has some advanced configuration options. @@ -1684,16 +1843,15 @@ python_binary = "python3" [python] symbol = "👾 " pyenv_version_name = true -pyenv_prefix = "foo " ``` ## Ruby -`ruby` 组件显示当前安装的 Ruby 版本。 此组件将在符合以下任意条件之一时显示: +The `ruby` module shows the currently installed version of Ruby. 此组件将在符合以下任意条件之一时显示: -- 当前目录包含 `Gemfile` 文件 +- The current directory contains a `Gemfile` file - The current directory contains a `.ruby-version` file -- 当前目录包含 `.rb` 文件 +- The current directory contains a `.rb` file ### 配置项 @@ -1702,7 +1860,7 @@ pyenv_prefix = "foo " | `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` 组件。 | +| `disabled` | `false` | Disables the `ruby` module. | ### Variables @@ -1725,10 +1883,10 @@ symbol = "🔺 " ## Rust -`rust` 组件显示当前安装的 Rust 版本。 此组件将在符合以下任意条件之一时显示: +The `rust` module shows the currently installed version of Rust. 此组件将在符合以下任意条件之一时显示: -- 当前目录包含 `Cargo.toml` 文件 -- 当前目录包含一个使用 `.rs` 扩展名的文件 +- The current directory contains a `Cargo.toml` file +- The current directory contains a file with the `.rs` extension ### 配置项 @@ -1737,7 +1895,7 @@ symbol = "🔺 " | `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` 组件。 | +| `disabled` | `false` | Disables the `rust` module. | ### Variables @@ -1758,6 +1916,41 @@ symbol = "🔺 " format = "via [⚙️ $version](red bold)" ``` +## SHLVL + +The `shlvl` module shows the current SHLVL ("shell level") environment variable, if it is set to a number and meets or exceeds the specified threshold. + +### 配置项 + +| 字段 | 默认值 | 描述 | +| ----------- | ---------------------------- | --------------------------------------- | +| `threshold` | `2` | Display threshold. | +| `format` | `"[$symbol$shlvl]($style) "` | The format for the module. | +| `symbol` | `"↕️ "` | The symbol used to represent the SHLVL. | +| `style` | `"bold yellow"` | 此组件的样式。 | +| `disabled` | `true` | Disables the `shlvl` module. | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | --- | ------------------------------------ | +| shlvl | `3` | The current value of SHLVL | +| symbol | | Mirrors the 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 + +[shlvl] +disabled = false +format = "$shlvl level(s) down" +threshold = 3 +``` + ## Singularity The `singularity` module shows the current singularity image, if inside a container and `$SINGULARITY_NAME` is set. @@ -1790,12 +1983,89 @@ The `singularity` module shows the current singularity image, if inside a contai format = "[📦 \\[$env\\]]($style) " ``` +## Swift + +The `swift` module shows the currently installed version of Swift. 此组件将在符合以下任意条件之一时显示: + +- The current directory contains a `Package.swift` file +- The current directory contains a file with the `.swift` extension + +### 配置项 + +| Option | 默认值 | 描述 | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐦 "` | A format string representing the symbol of Swift | +| `style` | `"bold 202"` | 此组件的样式。 | +| `disabled` | `false` | Disables the `swift` module. | + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | -------- | ------------------------------------ | +| version | `v5.2.4` | The version of `swift` | +| symbol | | Mirrors the 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 + +[swift] +format = "via [🏎 $version](red bold)" +``` + +## Status + +The `status` module displays the exit code of the previous command. The module will be shown only if the exit code is not `0`. + +::: tip + +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: + +### 配置项 + +| 字段 | 默认值 | 描述 | +| ---------- | -------------------------- | ------------------------------------------------------ | +| `format` | `[$symbol$status]($style)` | The format of the module | +| `symbol` | `"✖"` | A format string representing the symbol for the status | +| `style` | `"bold red"` | 此组件的样式。 | +| `disabled` | `true` | Disables the `status` module. | + + +### Variables + +| 字段 | 示例 | 描述 | +| --------- | ----- | ------------------------------------ | +| status | `127` | The exit code of the last command | +| symbol | | Mirrors the 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 + +[status] +style = "bg:blue" +symbol = "💣 " +format = "[\\[$symbol$status\\]]($style) " +disabled = false + +``` + ## Terraform -`terraform` 组件显示当前选定的 terraform 工作区和版本。 默认情况下不会显示 terraform 版本,因为当使用大量插件时,当前版本 terraform 查询版本号很慢。 If you still want to enable it, [follow the example shown below](#with-version). 此组件将在符合以下任意条件之一时显示: +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). 此组件将在符合以下任意条件之一时显示: -- 当前目录包含 `.terraform` 目录 -- 当前目录包含一个使用 `.tf` 扩展名的文件 +- The current directory contains a `.terraform` folder +- Current directory contains a file with the `.tf` extension ### 配置项 @@ -1804,7 +2074,7 @@ format = "[📦 \\[$env\\]]($style) " | `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` 组件。 | +| `disabled` | `false` | Disables the `terraform` module. | ### Variables @@ -1839,27 +2109,27 @@ format = "[🏎💨 $workspace]($style) " ## Time -`time` 组件显示当前的 **本地** 时间。 `format` 字段值会提供给 [`chrono`](https://crates.io/crates/chrono) crate 用来控制时间显示方式。 请参阅 [chrono strftime 文档](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) 以了解可用格式选项。 +The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available. ::: tip -此组件默认被禁用。 若要启用此组件,请在配置文件中设置 `disable` 字段为 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: ### 配置项 -| Option | 默认值 | 描述 | -| ----------------- | ----------------------- | ----------------------------------------------------------------------------------------------------- | -| `format` | `"at [$time]($style) "` | The format string for the module. | -| `use_12hr` | `false` | 启用 12 小时格式 | -| `time_format` | 见下文解释 | 用来格式化时间显示的 [chrono 格式字符串](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) | -| `style` | `"bold yellow"` | 显示时间的样式。 | -| `utc_time_offset` | `"local"` | 设置所用 UTC 偏移量。 Range from -24 < 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` | 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 `time_format` defaults to `"%r"`. 否则,其默认值为 `"%T"`。 Manually setting `time_format` will override the `use_12hr` setting. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. ### Variables @@ -1885,22 +2155,22 @@ time_range = "10:00:00-14:00:00" ## Username -`username` 组件显示当前活跃的用户名。 此组件将在符合以下任意条件之一时显示: +The `username` module shows active user's username. 此组件将在符合以下任意条件之一时显示: -- 当前用户是 root -- 当前用户与登录用户不相同 -- 用户正通过 SSH 会话连接访问 -- 字段 `show_always` 被设置为 true +- The current user is root +- The current user isn't the same as the one that is logged in +- The user is currently connected as an SSH session +- The variable `show_always` is set to true ### 配置项 -| 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` 组件。 | +| Option | 默认值 | 描述 | +| ------------- | ----------------------- | ------------------------------------- | +| `style_root` | `"bold red"` | The style used when the user is root. | +| `style_user` | `"bold yellow"` | The style used for non-root users. | +| `format` | `"[$user]($style) in "` | The format for the module. | +| `show_always` | `false` | Always shows the `username` module. | +| `disabled` | `false` | Disables the `username` module. | ### Variables @@ -1975,7 +2245,13 @@ Multiple custom modules can be defined by using a `.`. ::: tip -The order in which custom modules are shown can be individually set by setting `custom.foo` in `prompt_order`. By default, the `custom` module will simply show all custom modules in the order they were defined. +The order in which custom modules are shown can be individually set by including `${custom.foo}` in the top level `format` (as it includes a dot, you need to use `${...}`). By default, the `custom` module will simply show all custom modules in the order they were defined. + +::: + +::: tip + +[Issue #1252](https://github.com/starship/starship/discussions/1252) contains examples of custom modules. If you have an interesting example not covered there, feel free to share it there! ::: @@ -1983,10 +2259,10 @@ The order in which custom modules are shown can be individually set by setting ` | Option | 默认值 | 描述 | | ------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. | +| `command` | | The command whose output should be printed. The command will be passed on stdin to the shell. | | `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | | `shell` | | [See below](#custom-command-shell) | -| `描述` | `""` | The description of the module that is shown when running `starship explain`. | +| `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. | @@ -2014,6 +2290,8 @@ The order in which custom modules are shown can be individually set by setting ` If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows. +The `command` will be passed in on stdin. + If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g. ```toml @@ -2041,12 +2319,11 @@ Automatic detection of shells and proper parameters addition are currently imple command = "echo foo" # shows output of command files = ["foo"] # can specify filters when = """ test "$HOME" == "$PWD" """ -prefix = " transcending " +format = " transcending [$output]($style)" [custom.time] command = "time /T" files = ["*.pst"] -prefix = "transcending " shell = ["pwsh.exe", "-NoProfile", "-Command", "-"] ``` @@ -2054,7 +2331,7 @@ shell = ["pwsh.exe", "-NoProfile", "-Command", "-"] The `purescript` module shows the currently installed version of PureScript version. 此组件将在符合以下任意条件之一时显示: -- 当前目录包含一个 `spago.dhall` 文件 +- The current directory contains a `spago.dhall` file - The current directory contains a \*.purs files ### 配置项 diff --git a/docs/zh-CN/faq/README.md b/docs/zh-CN/faq/README.md index ffc08f85..0f840ddb 100644 --- a/docs/zh-CN/faq/README.md +++ b/docs/zh-CN/faq/README.md @@ -10,11 +10,11 @@ - **fish 配置**:[matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish) - **提示符工具**:[Starship](https://starship.rs/) -## `prompt_order` 和 `.disabled` 的效果是一样的吗? +## Do top level `format` and `.disabled` do the same thing? 是的,他们都可以用来禁用提示符中的组件。 如果你只是想禁用组件,推荐使用 `.disabled`,原因如下: -- “禁用组件”比在 prompt_order 中忽略某个组件更为清晰明确 +- Disabling modules is more explicit than omitting them from the top level `format` - 当 Starship 升级后,新组件将能够自动被加入提示符中 ## 你们的文档说“Starship 是跨 shell 的”,但它不支持 X shell。 为什么? diff --git a/docs/zh-CN/guide/README.md b/docs/zh-CN/guide/README.md index 8f61b2f0..d99773b2 100644 --- a/docs/zh-CN/guide/README.md +++ b/docs/zh-CN/guide/README.md @@ -112,7 +112,7 @@ - **Easy:** quick to install – start using it in minutes.

-Explore the Starship docs  ▶ +Explore the Starship docs  ▶

diff --git a/docs/zh-CN/migrating-to-0.45.0/README.md b/docs/zh-CN/migrating-to-0.45.0/README.md new file mode 100644 index 00000000..015af64f --- /dev/null +++ b/docs/zh-CN/migrating-to-0.45.0/README.md @@ -0,0 +1,265 @@ +# Migrating to v0.45.0 + +Starship v0.45.0 is a release containing breaking changes, in preparation for the big v1.0.0. We have made some major changes around how configuration is done on the prompt, to allow for a greater degree of customization. + +This guide is intended to walk you through the breaking changes. + +## `prompt_order` has been replaced by a root-level `format` + +Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship. + +Starship v0.45.0 will instead be accepting a `format` value, allowing for customization of the prompt outside of the modules themselves. + +**Example pre-v0.45.0 configuration** + +```toml +prompt_order = [ + "username", + "hostname", + "directory", + "git_branch", + "git_commit", + "git_state", + "git_status", + "cmd_duration", + "custom", + "line_break", + "jobs", + "battery", + "time", + "character", +] +``` + +**Example v0.45.0 configuration** + +```toml +format = """\ + $username\ + $hostname\ + $directory\ + $git_branch\ + $git_commit\ + $git_state\ + $git_status\ + $cmd_duration\ + $custom\ + $line_break\ + $jobs\ + $battery\ + $time\ + $character\ + """ +``` + +## Module `prefix` and `suffix` will be replaced by `format` + +Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered. + +Starship v0.45.0 will instead be accepting a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output. + +**Example pre-v0.45.0 configuration** + +```toml +[cmd_duration] +prefix = "took " +``` + +**Example v0.45.0 configuration** + +```toml +[cmd_duration] +# $duration – The command duration (e.g. "15s") +# $style – The default style of the module (e.g. "bold yellow") +format = "took [$duration]($style)" +``` + +### Affected Modules + +#### Character + +| Removed Property | Replacement | +| ----------------------- | ---------------- | +| `symbol` | `success_symbol` | +| `use_symbol_for_status` | `error_symbol` | +| `style_success` | `success_symbol` | +| `style_failure` | `error_symbol` | + +**Changes to the Default Configuration** + +```diff +[character] +-- symbol = "❯" +-- error_symbol = "✖" +-- use_symbol_for_status = true +-- vicmd_symbol = "❮" +++ success_symbol = "[❯](bold green) " +++ error_symbol = "[❯](bold red) " +++ vicmd_symbol = "[❮](bold green)" +``` + +Previously, the `use_symbol_for_status` property was used to configure the prompt to show the `error_symbol` when the last command resulted in a non-zero status code. + +With the release of v0.45.0, we now always use `error_symbol` after non-zero status codes, unifying `use_symbol_for_status` and `error_symbol` properties. + +To configure the prompt to use the older `use_symbol_for_status = true` configuration, add the following to your config file: + +```toml +[character] +error_symbol = "[✖](bold red) " +``` + +#### Command Duration + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | + +**Changes to the Default Configuration** + +```diff +[cmd_duration] +-- prefix = "took " +++ format = "took [$duration]($style)" +``` + +#### Directory + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | + +**Changes to the Default Configuration** + +```diff +[directory] +-- prefix = "in " +++ format = "[$path]($style)[$lock_symbol]($lock_style)" +``` + +#### Environment Variable + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[env_var] +-- prefix = "" +-- suffix = "" +++ format = "with [$env_value]($style) " +``` + +#### Git Commit + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[git_commit] +-- prefix = "(" +-- suffix = ")" +++ format = "[\\($hash\\)]($style) " +``` + +#### Git Status + +| Removed Property | Replacement | +| ----------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | +| `show_sync_count` | `format` | + +**Changes to the Default Configuration** + +```diff +[git_status] +-- prefix = "[" +-- suffix = "]" +-- show_sync_count = false +++ format = "([$all_status$ahead_behind] )" +``` + +Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch. + +With the release of v0.45.0, this has been replaced with the + +To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file: + +```toml +[git_status] +ahead = "⇡${count}" +diverged = "⇕⇡${ahead_count}⇣${behind_count}" +behind = "⇣${count}" +``` + +#### Hostname + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[hostname] +-- prefix = "" +-- suffix = "" +++ format = "[$hostname]($style) in " +``` + +#### Singularity + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `label` | `format` | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[singularity] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol\\[$env\\]]($style) " +``` + +#### Time + +| Removed Property | Replacement | +| ---------------- | ------------- | +| `format` | `time_format` | + +**Changes to the Default Configuration** + +```diff +[time] +-- format = "🕙[ %T ]" +++ time_format = "%T" +++ format = "at 🕙[$time]($style) +``` + +#### Custom Commands + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[custom.example] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol$output]($style) " +``` diff --git a/docs/zh-CN/presets/README.md b/docs/zh-CN/presets/README.md index c01e1e9b..1adea8dd 100644 --- a/docs/zh-CN/presets/README.md +++ b/docs/zh-CN/presets/README.md @@ -26,6 +26,9 @@ discharging_symbol = "" [conda] symbol = " " +[dart] +symbol = " " + [docker] symbol = " " @@ -68,6 +71,9 @@ symbol = " " [package] symbol = " " +[perl] +symbol = " " + [php] symbol = " " @@ -79,4 +85,7 @@ symbol = " " [rust] symbol = " " + +[swift] +symbol = "ﯣ " ``` diff --git a/docs/zh-TW/config/README.md b/docs/zh-TW/config/README.md index 15868a0f..f418ddfc 100644 --- a/docs/zh-TW/config/README.md +++ b/docs/zh-TW/config/README.md @@ -1,18 +1,12 @@ # 設定 -::: tip - -🔥 「設定」現在還在建置中。 許多新的設定選項會在之後的版本釋出。 - -::: - -為了開始設定 Starship,請建立下右檔案: `~/.config/starship.toml`. +To get started configuring starship, create the following file: `~/.config/starship.toml`. ```sh mkdir -p ~/.config && touch ~/.config/starship.toml ``` -所有關於 Starship 的設定都在這個 [TOML](https://github.com/toml-lang/toml) 檔案內: +All configuration for starship is done in this [TOML](https://github.com/toml-lang/toml) file: ```toml # Don't print a new line at the start of the prompt @@ -27,7 +21,7 @@ success_symbol = "[➜](bold green)" # The "success_symbol" segment is being disabled = true ``` -你可以藉由修改 `STARSHIP_CONFIG`環境變數而改變預設的`starship.toml` 檔案位置 +You can change default `starship.toml` file location with `STARSHIP_CONFIG` environment variable: ```sh export STARSHIP_CONFIG=~/.starship @@ -39,9 +33,23 @@ Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE $ENV:STARSHIP_CONFIG = "$HOME\.starship" ``` -### 術語 +### Logging -**模組 (Module)**: 提示字元中的一個元件,基於你的作業系統提供的背景資訊來提供訊息。 舉例來說,如果你現在的資料夾是一個 NodeJS 專案,"nodejs" 模組會顯示出現在安裝在你的電腦上的 NodeJS 版本。 +By default starship logs warnings and errors into a file named `~/.cache/starship/session_${STARSHIP_SESSION_KEY}.log`, where the session key is corresponding to a instance of your terminal. This, however can be changed using the `STARSHIP_CACHE` environment variable: + +```sh +export STARSHIP_CACHE=~/.starship/cache +``` + +Equivalently in PowerShell (Windows) would be adding this line to your `$PROFILE`: + +```ps1 +$ENV:STARSHIP_CACHE = "$HOME\AppData\Local\Temp" +``` + +### Terminology + +**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. **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. @@ -77,7 +85,7 @@ For example: #### 風格字串 -Starship 內大多數的模組允許你設定他們的顯示風格。 這要透過一個條目 (通常叫做 `style`),這個條目使用一個字串來進行設定。 這裡給幾個風格字串的例子,以及這些字串的功用。 對於完整語法的詳細說明,請參照 [進階設定指南](/advanced-config/)。 +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/). - `"fg:green bg:blue"` 在一個藍色背景上設定綠色文字 - `"bg:blue fg:bright-green"` 在一個藍色背景上設定亮綠色文字 @@ -86,7 +94,7 @@ Starship 內大多數的模組允許你設定他們的顯示風格。 這要透 - `"bold italic fg:purple"` 設定粗體、斜體且紫色的文字 - `""` 明確地關閉所有風格 -注意風格產出的樣子取決於你的終端機模擬器。 例如,有些終端機模擬器會提升顏色的亮度而不是讓文字變粗體,而且有些色彩主題對一般與加亮顏色使用的是相同色碼。 除此之外,為了要有斜體字,你的終端機一定要支援斜體。 +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 @@ -102,7 +110,7 @@ For example: 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 (`\`). -- $ +- \$ - \\ - [ - ] @@ -130,7 +138,7 @@ format = ''' ## 提示字元 -以下是針對提示字元內容的設定。 +This is the list of prompt-wide configuration options. ### 選項 @@ -138,15 +146,13 @@ format = ''' | -------------- | ---------------------------- | ----------------------------------------------------- | | `format` | [連結](#default-prompt-format) | Configure the format of the prompt. | | `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). | +| `add_newline` | `true` | Add a new line before the start of the prompt. | ### 範例 ```toml # ~/.config/starship.toml -# Disable the newline at the start of the prompt -format = "$all" - # Use custom format format = """ [┌───────────────────>](bold green) @@ -155,20 +161,23 @@ format = """ # Wait 10 milliseconds for starship to check files under the current directory. scan_timeout = 10 + +# Disable the newline at the start of the prompt +add_newline = false ``` ### Default Prompt Format -The default `format` is used to define the format of the prompt, if empty or no `format` is provided. 預設如下: +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 -format = "\n$all" +format = "$all" # Which is equivalent to format = """ - $username\ $hostname\ +$shlvl\ $kubernetes\ $directory\ $git_branch\ @@ -179,6 +188,7 @@ $hg_branch\ $docker_context\ $package\ $cmake\ +$dart\ $dotnet\ $elixir\ $elm\ @@ -190,17 +200,20 @@ $julia\ $nim\ $nodejs\ $ocaml\ +$perl\ $php\ $purescript\ $python\ $ruby\ $rust\ +$swift\ $terraform\ $zig\ $nix_shell\ $conda\ $memory_usage\ $aws\ +$gcloud\ $env_var\ $crystal\ $cmd_duration\ @@ -209,14 +222,15 @@ $line_break\ $jobs\ $battery\ $time\ +$status\ $character""" ``` ## AWS -`aws` 模組顯示現在 AWS 的區域與概況。 這是根據 `AWS_REGION`、`AWS_DEFAULT_REGION` 與 `AWS_PROFILE` 環境變數及 `~/.aws/config` 檔案。 +The `aws` module shows the current AWS region and profile. This is based on `AWS_REGION`, `AWS_DEFAULT_REGION`, and `AWS_PROFILE` env var with `~/.aws/config` file. -從 `AWS_VAULT`讀取而使用 [aws-vault](https://github.com/99designs/aws-vault) 這個設定檔 +When using [aws-vault](https://github.com/99designs/aws-vault) the profile is read from the `AWS_VAULT` env var. ### 選項 @@ -282,7 +296,7 @@ symbol = "🅰 " ## 電池 -`battery` 模組顯示電池的電量以及現在的充電狀態。 這個模組只會在裝置的電量低於 10% 的時候看見。 +The `battery` module shows how charged the device's battery is and its current charging status. The module is only visible when the device's battery is below 10%. ### 選項 @@ -296,14 +310,14 @@ symbol = "🅰 " | `disabled` | `false` | 停用 `battery` 模組。 |
-也有些針對不常見的電池狀態設定的選項。 +There are also options for some uncommon battery states. | 變數 | 說明 | | ---------------- | -------------- | | `unknown_symbol` | 當電池狀態不明時顯示的符號。 | | `empty_symbol` | 當電池沒電時顯示的符號。 | -注意:電池指示會在電池狀態`不明`或`沒電`時隱藏起來,除非你在設定之中有特別指定選項。 +Note: Battery indicator will be hidden if the status is `unknown` or `empty` unless you specify the option in the config.
@@ -318,9 +332,9 @@ charging_symbol = "⚡️" discharging_symbol = "💀" ``` -### 電池顯示 +### Battery Display -`display` 設定是用來定義甚麼時候電池指示會顯示出來 (threshold),以及它長甚麼樣子 (style)。 如果沒有提供 `display`。 預設如下: +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: ```toml [[battery.display]] @@ -330,7 +344,7 @@ style = "bold red" #### 選項 -`display` 選項是一個下列表格的陣列。 +The `display` option is an array of the following table. | 變數 | 說明 | | ----------- | ----------- | @@ -340,23 +354,23 @@ style = "bold red" #### 範例 ```toml -[[battery.display]] # 0% 到 10% 電量之間時,使用 "bold red" 風格 +[[battery.display]] # "bold red" style when capacity is between 0% and 10% threshold = 10 style = "bold red" -[[battery.display]] # 10% 到 30% 電量之間時,使用 "bold yellow" 風格 +[[battery.display]] # "bold yellow" style when capacity is between 10% and 30% threshold = 30 style = "bold yellow" -# 當電量超過 30% 時,電量指示就不會顯示出來 +# when capacity is over 30%, the battery indicator will not be displayed ``` ## 字元 -`character` 模組在你的文字輸入處旁顯示一個字元 (通常是箭頭)。 +The `character` module shows a character (usually an arrow) beside where the text is entered in your terminal. -這個字元會告訴你最後的指令是成功還是失敗。 It can do this in two ways: +The character will tell you whether the last command was successful or not. It can do this in two ways: - changing color (`red`/`green`) - changing shape (`❯`/`✖`) @@ -437,15 +451,15 @@ The `cmake` module shows the currently installed version of CMake if: ## 指令持續時間 -`cmd_duration` 模組顯示最後一個指令執行所花費的時間。 這個模組只會在指令花費超過兩秒或是有設定 `min_time` 時,超過設定值時出現。 +The `cmd_duration` module shows how long the last command took to execute. The module will be shown only if the command took longer than two seconds, or the `min_time` config value, if it exists. -::: warning 不要在 Bash 中設置 DEBUG trap +::: warning Do not hook the DEBUG trap in Bash -如果你在 `bash` 中使用 Starship,不要在執行 `eval $(starship init $0)` 之後設置 `DEBUG` trap,不然這個模組**會**壞掉。 +If you are running Starship in `bash`, do not hook the `DEBUG` trap after running `eval $(starship init $0)`, or this module **will** break. ::: -想使用類似 preexec 功能的 Bash 使用者可以 [rcaloras 的 bash_preexec 框架](https://github.com/rcaloras/bash-preexec)。 只要在 `eval $(starship init $0)` 之前簡單地定義 `preexec_functions` 與 `precmd_functions` 兩個陣列,然後就可以照常進行。 +Bash users who need preexec-like functionality can use [rcaloras's bash_preexec framework](https://github.com/rcaloras/bash-preexec). Simply define the arrays `preexec_functions` and `precmd_functions` before running `eval $(starship init $0)`, and then proceed as normal. ### 選項 @@ -478,7 +492,7 @@ format = "underwent [$duration](bold yellow)" ## Conda -如果有設定 `$CONDA_DEFAULT_ENV` 時,`conda` 模組顯示現在 conda 的環境。 +The `conda` module shows the current conda environment, if `$CONDA_DEFAULT_ENV` is set. ::: tip @@ -494,7 +508,8 @@ This does not suppress conda's own prompt modifier, you may want to run `conda c | `symbol` | `"🅒 "` | 環境名稱前使用的符號。 | | `style` | `"bold green"` | 這個模組的風格。 | | `format` | `"[$symbol$environment]($style) "` | The format for the module. | -| `disabled` | `false` | 停用 `conda` 模組。 | +| `ignore_base` | `true` | Ignores `base` environment when activated. | +| `disabled` | `false` | Disables the `conda` module. | ### Variables @@ -517,7 +532,7 @@ format = "[$symbol$environment](dimmed green) " ## Crystal -`crystal` 模組顯示現在所安裝的Crystal版本 這個模組在下列其中一個條件達成時顯示: +The `crystal` module shows the currently installed version of Crystal. 這個模組在下列其中一個條件達成時顯示: - 現在資料夾中含有一個 `shard.yml` 檔案 - 現在資料夾中含有一個`.cr`檔案 @@ -550,34 +565,70 @@ format = "[$symbol$environment](dimmed green) " format = "via [✨ $version](bold blue) " ``` -## 資料夾 +## Dart -`directory` 模組顯示到現在資料夾的路徑,並裁減到前三層資料夾。 你的資料夾也會被裁減到你所在的 git 儲存庫的根目錄。 +The `dart` module shows the currently installed version of Dart. 這個模組在下列其中一個條件達成時顯示: -如果正在使用 fish 風格的 pwd 選項,將不會隱藏被裁減的資料夾,而是會根據你在選項中設定的數字看到每一層資料夾的縮寫。 - -例如,給定一個右列的路徑 `~/Dev/Nix/nixpkgs/pkgs` 其中 `nixpkgs` 是儲存庫的根目錄,而且該選項被設定為 `1`。 你會看到 `~/D/N/nixpkgs/pkgs`,而在這個設定之前則是 `nixpkgs/pkgs`。 +- The current directory contains a file with `.dart` extension +- The current directory contains a `.dart_tool` directory +- The current directory contains a `pubspec.yaml` or `pubspec.lock` file ### 選項 -| 變數 | 預設 | 說明 | -| ------------------------ | ----------------------------------------------- | ----------------------------------------------------- | -| `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. | +| 變數 | 預設 | 說明 | +| ---------- | ---------------------------------- | ----------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🎯 "` | A format string representing the symbol of Dart | +| `style` | `"bold blue"` | 這個模組的風格。 | +| `disabled` | `false` | Disables the `dart` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | -------- | ------------------------------------ | +| version | `v2.8.4` | The version of `dart` | +| symbol | | Mirrors the 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 + +[dart] +format = "via [🔰 $version](bold red) " +``` + +## Directory + +The `directory` module shows the path to your current directory, truncated to three parent folders. Your directory will also be truncated to the root of the git repo that you're currently in. + +When using the fish style pwd option, instead of hiding the path that is truncated, you will see a shortened name of each directory based on the number you enable for the option. + +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`. + +### 選項 + +| 變數 | 預設 | 說明 | +| ------------------------ | ----------------------------------------------- | -------------------------------------------------------------------------------- | +| `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"` | 這個模組的風格。 | +| `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. -| Advanced Option | 預設 | 說明 | -| --------------------------- | ------ | ------------------------------------------------ | -| `substitutions` | | A table of substitutions to be made to the path. | -| `fish_style_pwd_dir_length` | `0` | 當使用 fish shell 的 pwd 路徑邏輯時使用的字元數量。 | -| `use_logical_path` | `true` | 顯示 shell (`PWD`) 提供的邏輯路徑,而不是 OS 的路徑。 | +| Advanced Option | 預設 | 說明 | +| --------------------------- | ------ | ---------------------------------------------------------------------------------------- | +| `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. @@ -644,7 +695,7 @@ format = "via [🐋 $context](blue bold)" ## Dotnet -`dotnet` 模組顯示現在資料夾使用的 .NET Core SDK 的版本。 如果這個資料夾已經選定一個 SDK,則顯示這個 SDK 的版本。 如果沒有的話,則顯示最新安裝的 SDK 版本。 +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 or more of the following files are present in the current directory: @@ -660,19 +711,19 @@ This module will only be shown in your prompt when one or more of the following You'll also need the .NET Core SDK installed in order to use it correctly. -這個模組內部是使用它自己的機制來偵測版本。 一般來說這個模組有 `dotnet --version` 的兩倍快,但是它可能會在你的 .NET 專案有不尋常的資料夾結構時顯示不正確的版本。 如果精確度比速度更重要的話,你可以藉由設定模組中的 `heuristic = false` 選項來停用這個功能。 +Internally, this module uses its own mechanism for version detection. Typically it is twice as fast as running `dotnet --version`, but it may show an incorrect version if your .NET project has an unusual directory layout. If accuracy is more important than speed, you can disable the mechanism by setting `heuristic = false` in the module options. The module will also show the Target Framework Moniker () when there is a csproj file in the current directory. ### 選項 -| Option | 預設 | 說明 | -| ----------- | ---------------------------------------- | ---------------------------- | -| `format` | `"v[$symbol$version( 🎯 $tfm)]($style) "` | The format for the module. | -| `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 "` | The symbol used before displaying the version of dotnet. | +| `heuristic` | `true` | Use faster version detection to keep starship snappy. | +| `style` | `"bold blue"` | 這個模組的風格。 | +| `disabled` | `false` | Disables the `dotnet` module. | ### Variables @@ -700,7 +751,7 @@ heuristic = false The `elixir` module shows the currently installed version of Elixir and Erlang/OTP. 這個模組在下列其中一個條件達成時顯示: -- 現在資料夾中包含一個 `mix.exs` 檔案. +- The current directory contains a `mix.exs` file. ### 選項 @@ -735,8 +786,8 @@ symbol = "🔮 " The `elm` module shows the currently installed version of Elm. 這個模組在下列其中一個條件達成時顯示: -- 現在資料夾中包含一個 `elm.json` 檔案 -- 現在資料夾中包含一個 `elm-package.json` 檔案 +- The current directory contains a `elm.json` file +- The current directory contains a `elm-package.json` file - The current directory contains a `.elm-version` file - The current directory contains a `elm-stuff` folder - The current directory contains a `*.elm` files @@ -769,28 +820,28 @@ The `elm` module shows the currently installed version of Elm. 這個模組在 format = "via [ $version](cyan bold) " ``` -## 環境變數 +## Environment Variable -`env_var`模組顯示一個選擇的環境變數的現在數值。 這個模組只在下列條件其中之一達到時顯示: +The `env_var` module displays the current value of a selected environment variable. The module will be shown only if any of the following conditions are met: -- `variable` 設定選項符合一個存在的環境變數。 -- 沒有設定 `variable` 選項,但是有設定 `default` 選項。 +- The `variable` configuration option matches an existing environment variable +- The `variable` configuration option is not defined, but the `default` configuration option is ### 選項 -| Option | 預設 | 說明 | -| ---------- | ------------------------------ | -------------------------- | -| `symbol` | | 顯示在變數數值之前的符號。 | -| `variable` | | 要顯示的環境變數。 | -| `default` | | 在選擇的變數值沒有定義時,顯示的預設值。 | -| `format` | `"with [$env_value]($style) "` | The format for the module. | -| `disabled` | `false` | 停用 `env_var` 模組。 | +| Option | 預設 | 說明 | +| ---------- | ------------------------------ | ---------------------------------------------------------------------------- | +| `symbol` | | The symbol used before displaying the variable value. | +| `variable` | | The environment variable to be displayed. | +| `default` | | The default value to be displayed when the selected variable is not defined. | +| `format` | `"with [$env_value]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `env_var` module. | ### Variables | 變數 | 範例 | 說明 | | --------- | ------------------------------------------- | ------------------------------------------ | -| env_value | `Windows NT` (if *variable* would be `$OS`) | The environment value of option `variable` | +| 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` | @@ -810,8 +861,8 @@ default = "unknown shell" The `erlang` module shows the currently installed version of Erlang/OTP. 這個模組在下列其中一個條件達成時顯示: -- 現在資料夾中包含一個 `rebar.config` 檔案. -- 現在資料夾中包含一個 `erlang.mk` 檔案. +- The current directory contains a `rebar.config` file. +- The current directory contains a `erlang.mk` file. ### 選項 @@ -841,20 +892,80 @@ The `erlang` module shows the currently installed version of Erlang/OTP. 這個 format = "via [e $version](bold red) " ``` -## Git 分支 +## Gcloud -`git_branch` 模組顯示現在的資料夾中使用中的儲存庫的分支。 +The `gcloud` module shows the current configuration for [`gcloud`](https://cloud.google.com/sdk/gcloud) CLI. This is based on the `~/.config/gcloud/active_config` file and the `~/.config/gcloud/configurations/config_{CONFIG NAME}` file and the `CLOUDSDK_CONFIG` env var. ### 選項 -| 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` 模組。 | +| 變數 | 預設 | 說明 | +| ---------------- | ---------------------------------------------------- | --------------------------------------------------------------- | +| `format` | `"on [$symbol$account(\\($region\\))]($style) "` | The format for the module. | +| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. | +| `region_aliases` | | Table of region aliases to display in addition to the GCP name. | +| `style` | `"bold blue"` | 這個模組的風格。 | +| `disabled` | `false` | Disables the `gcloud` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | ----------------- | ------------------------------------------------------------------ | +| region | `us-central1` | The current GCP region | +| account | `foo@example.com` | The current GCP profile | +| project | | The current GCP project | +| active | `default` | The active config name written in `~/.config/gcloud/active_config` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +\*: This variable can only be used as a part of a style string + +### Examples + +#### Display account and project + +```toml +# ~/.config/starship.toml + +[gcloud] +format = "on [$symbol$account(\\($project\\))]($style) " +``` + +#### Display active config name only + +```toml +# ~/.config/starship.toml + +[gcloud] +format = "[$symbol$active]($style) " +style = "bold yellow" +``` + +#### Display account and aliased region + +```toml +# ~/.config/starship.toml + +[gcloud] +symbol = "️🇬️ " +[gcloud.region_aliases] +us-central1 = "uc1" +asia-northeast1 = "an1" +``` + +## Git Branch + +The `git_branch` module shows the active branch of the repo in your current directory. + +### 選項 + +| 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` | `"…"` | The symbol used to indicate a branch name was truncated. You can use `""` for no symbol. | +| `disabled` | `false` | Disables the `git_branch` module. | ### Variables @@ -911,7 +1022,7 @@ commit_hash_length = 4 ## Git State -`git_state` 模組會顯示在 git 儲存庫中的資料夾內,以及會在有作業正在進行時顯示,像是:_REBASING_、_BISECTING_ 等等。 如果有進展的資訊 (像是 REBASING 3/10),也會一併顯示出來。 +The `git_state` module will show in directories which are part of a git repository, and where there is an operation in progress, such as: _REBASING_, _BISECTING_, etc. If there is progress information (e.g., REBASING 3/10), that information will be shown too. ### 選項 @@ -925,8 +1036,8 @@ commit_hash_length = 4 | `am` | `"AM"` | A format string displayed when an `apply-mailbox` (`git am`) is in progress. | | `am_or_rebase` | `"AM/REBASE"` | A format string displayed when an ambiguous `apply-mailbox` or `rebase` is in progress. | | `style` | `"bold yellow"` | 這個模組的風格。 | -| `format` | `"[\\($state( $progress_current/$progress_total)\\)]($style) "` | The format for the module. | -| `disabled` | `false` | 停用 `git_state` 模組。 | +| `format` | `"\\([$state( $progress_current/$progress_total)]($style)\\) "` | The format for the module. | +| `disabled` | `false` | Disables the `git_state` module. | ### Variables @@ -951,26 +1062,25 @@ cherry_pick = "[🍒 PICKING](bold red)" ## Git Status -`git_status` 模組顯示用來表示現在資料夾之中儲存庫狀態的符號。 +The `git_status` module shows symbols representing the state of the repo in your current directory. ### 選項 -| Option | 預設 | 說明 | -| ----------------- | ----------------------------------------------- | ----------------------------------- | -| `format` | "([\[$all_status$ahead_behind\]]($style) )" | The default format for `git_status` | -| `conflicted` | `"="` | 這個分支有合併衝突。 | -| `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` 模組。 | +| Option | 預設 | 說明 | +| ------------ | --------------------------------------------- | ----------------------------------- | +| `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` | +| `style` | `"bold red"` | 這個模組的風格。 | +| `disabled` | `false` | Disables the `git_status` module. | ### Variables @@ -981,12 +1091,12 @@ 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. | +| `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 @@ -1022,18 +1132,28 @@ renamed = "👅" deleted = "🗑" ``` +Show ahead/behind count of the branch being tracked +```toml +# ~/.config/starship.toml + +[git_status] +ahead = "⇡${count}" +diverged = "⇕⇡${ahead_count}⇣${behind_count}" +behind = "⇣${count}" +``` + ## Golang -`golang` 模組顯示現在安裝的 Golang 版本。 這個模組在下列其中一個條件達成時顯示: +The `golang` module shows the currently installed version of Golang. 這個模組在下列其中一個條件達成時顯示: -- 現在資料夾中含有一個 `go.mod` 檔案 -- 現在資料夾中含有一個 `go.sum` 檔案 -- 現在資料夾中含有一個 `glide.yaml` 檔案 -- 現在資料夾中含有一個 `Gopkg.yml` 檔案 -- 現在資料夾中含有一個 `Gopkg.lock` 檔案 +- The current directory contains a `go.mod` file +- The current directory contains a `go.sum` file +- The current directory contains a `glide.yaml` file +- The current directory contains a `Gopkg.yml` file +- The current directory contains a `Gopkg.lock` file - The current directory contains a `.go-version` file -- 現在資料夾中含有一個 `Godeps` 資料夾 -- 現在資料夾中含有一個檔案具有 `.go` 副檔名 +- The current directory contains a `Godeps` directory +- The current directory contains a file with the `.go` extension ### 選項 @@ -1042,7 +1162,7 @@ deleted = "🗑" | `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` 模組。 | +| `disabled` | `false` | Disables the `golang` module. | ### Variables @@ -1067,7 +1187,7 @@ format = "via [🏎💨 $version](bold cyan) " The `helm` module shows the currently installed version of Helm. 這個模組在下列其中一個條件達成時顯示: -- 現在資料夾中包含一個 `helmfile.yaml` 檔案 +- The current directory contains a `helmfile.yaml` file - The current directory contains a `Chart.yaml` file ### 選項 @@ -1098,27 +1218,26 @@ The `helm` module shows the currently installed version of Helm. 這個模組在 format = "via [⎈ $version](bold white) " ``` -## 主機名稱 +## Hostname -`hostname` 模組顯示系統的主機名稱。 +The `hostname` module shows the system 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` 模組。 | +| Option | 預設 | 說明 | +| ---------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `ssh_only` | `true` | Only show hostname when connected to an SSH session. | +| `trim_at` | `"."` | String that the hostname is cut off at, after the first match. `"."` will stop after the first dot. `""` will disable any truncation | +| `format` | `"[$hostname]($style) in "` | The format for the module. | +| `style` | `"bold dimmed green"` | 這個模組的風格。 | +| `disabled` | `false` | Disables the `hostname` module. | ### Variables -| 變數 | 範例 | 說明 | -| --------- | --- | ------------------------------------ | -| number | `1` | The number of jobs | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| 變數 | 範例 | 說明 | +| --------- | -- | ------------------------------------ | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | \*: This variable can only be used as a part of a style string @@ -1136,7 +1255,7 @@ disabled = false ## Java -`java` 模組顯示現在安裝的 Java 版本。 這個模組在下列其中一個條件達成時顯示: +The `java` module shows the currently installed version of Java. 這個模組在下列其中一個條件達成時顯示: - 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 @@ -1148,7 +1267,7 @@ disabled = false | `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` 模組。 | +| `disabled` | `false` | Disables the `java` module. | ### Variables @@ -1169,19 +1288,19 @@ disabled = false symbol = "🌟 " ``` -## 工作 +## Jobs -`jobs` 模組顯示現在正在執行中的工作。 這個模組只會在有背景工作正在執行時顯示。 這個模組會在工作數量超過一個,或者有設定 `threshold` 時且數量超過設定值時,顯示工作的數量。 +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. ### 選項 | Option | 預設 | 說明 | | ----------- | ----------------------------- | ------------------------------------------------ | -| `threshold` | `1` | 在超過指定值時顯示工作數量。 | +| `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"` | 這個模組的風格。 | -| `disabled` | `false` | 停用 `jobs` 模組。 | +| `disabled` | `false` | Disables the `jobs` module. | ### Variables @@ -1245,7 +1364,7 @@ Displays the current Kubernetes context name and, if set, the namespace from the ::: tip -這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: @@ -1254,7 +1373,7 @@ Displays the current Kubernetes context name and, if set, the namespace from the | Option | 預設 | 說明 | | ----------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- | | `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. | -| `format` | `"on [$symbol$context( \\($namespace\\))]($style) "` | The format for the module. | +| `format` | `"[$symbol$context( \\($namespace\\))]($style) in "` | The format for the module. | | `style` | `"cyan bold"` | 這個模組的風格。 | | `namespace_spaceholder` | `none` | The value to display if no namespace was found. | | `context_aliases` | | Table of context aliases to display. | @@ -1283,15 +1402,15 @@ disabled = false "dev.local.cluster.k8s" = "dev" ``` -## 換行 +## Line Break -`line_break` 模組將提示字元分成兩行。 +The `line_break` module separates the prompt into two lines. ### 選項 -| Option | 預設 | 說明 | -| ---------- | ------- | ----------------------------- | -| `disabled` | `false` | 停用 `line_break` 模組,讓提示字元變成一行。 | +| Option | 預設 | 說明 | +| ---------- | ------- | ------------------------------------------------------------------ | +| `disabled` | `false` | Disables the `line_break` module, making the prompt a single line. | ### 範例 @@ -1302,38 +1421,38 @@ disabled = false disabled = true ``` -## 記憶體使用量 +## Memory Usage -`memory_usage` 模組顯示現在系統記憶體與 swap 的使用量。 +The `memory_usage` module shows current system memory and swap usage. -預設 swap 使用量會在系統總 swap 使用量不為 0 時顯示出來。 +By default the swap usage is displayed if the total system swap is non-zero. ::: tip -這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: ### 選項 -| Option | 預設 | 說明 | -| ----------- | --------------------------------------------- | -------------------------- | -| `threshold` | `75` | 將記憶體使用量隱藏,除非使用量超過指定值。 | -| `format` | `"via $symbol [${ram}( | ${swap})]($style) "` | The format for the module. | -| `symbol` | `"🐏"` | 顯示在記憶體使用量之前的符號。 | -| `style` | `"bold dimmed white"` | 這個模組的風格。 | -| `disabled` | `true` | 停用 `memory_usage` 模組。 | +| Option | 預設 | 說明 | +| ----------- | --------------------------------------------- | -------------------------------------------------------- | +| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. | +| `format` | `"via $symbol [${ram}( | ${swap})]($style) "` | The format for the module. | +| `symbol` | `"🐏"` | The symbol used before displaying the memory usage. | +| `style` | `"bold dimmed white"` | 這個模組的風格。 | +| `disabled` | `true` | Disables the `memory_usage` module. | ### Variables -| 變數 | 範例 | 說明 | -| ------------- | ------------- | ------------------------------------------------------------------ | -| 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` | +| 變數 | 範例 | 說明 | +| ---------------- | ------------- | ------------------------------------------------------------------ | +| 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 @@ -1364,7 +1483,7 @@ The `hg_branch` module shows the active branch of the repo in your current direc | `style` | `"bold purple"` | 這個模組的風格。 | | `format` | `"on [$symbol$branch]($style) "` | The format for the module. | | `truncation_length` | `2^63 - 1` | Truncates the hg branch name to X graphemes | -| `truncation_symbol` | `"…"` | 用來指示分支名稱被縮減的符號。 | +| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. | | `disabled` | `true` | Disables the `hg_branch` module. | ### Variables @@ -1392,7 +1511,7 @@ truncation_symbol = "" The `nim` module shows the currently installed version of Nim. 這個模組在下列其中一個條件達成時顯示: -- 現在資料夾中包含一個 `nim.cfg` 檔案 +- 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 @@ -1428,18 +1547,18 @@ symbol = "🎣 " ## Nix-shell -`nix_shell` 模組顯示 nix-shell 環境。 這個模組會在 nix-shell 環境中顯示。 +The `nix_shell` module shows the nix-shell environment. The module will be shown when inside a nix-shell environment. ### 選項 | Option | 預設 | 說明 | | ------------ | -------------------------------------------------- | ----------------------------------------------------- | | `format` | `"via [$symbol$state( \\($name\\))]($style) "` | The format for the module. | -| `symbol` | `"❄️ "` | A format string representing the symbol of nix-shell. | +| `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` 模組。 | +| `disabled` | `false` | Disables the `nix_shell` module. | ### Variables @@ -1466,11 +1585,11 @@ format = "via [☃️ $state( \\($name\\))](bold blue) " ## NodeJS -`nodejs` 模組顯示現在安裝的 NodeJS 版本。 這個模組在下列其中一個條件達成時顯示: +The `nodejs` module shows the currently installed version of NodeJS. 這個模組在下列其中一個條件達成時顯示: -- 現在資料夾中包含一個 `package.json` 檔案 +- The current directory contains a `package.json` file - The current directory contains a `.node-version` file -- 現在資料夾中包含一個 `node_modules` 資料夾 +- The current directory contains a `node_modules` directory - The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension - The current directory contains a file with the `.ts` extension @@ -1481,7 +1600,7 @@ format = "via [☃️ $state( \\($name\\))](bold blue) " | `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` 模組。 | +| `disabled` | `false` | Disables the `nodejs` module. | ###  Variables @@ -1502,29 +1621,31 @@ format = "via [☃️ $state( \\($name\\))](bold blue) " format = "via [🤖 $version](bold green) " ``` -## 套件版本 +## Package Version -The `package` 模組在現在資料夾是一個套件的儲藏庫時出現,並顯示他的現在版本。 The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia` and `mix` packages. +The `package` module is shown when the current directory is the repository for a package, and shows its current version. The module currently supports `npm`, `cargo`, `poetry`, `composer`, `gradle`, `julia`, `mix` and `helm` packages. -- **npm** – `npm` 套件的版本是從現在資料夾中的 `package.json` 之中擷取出來的 -- **cargo** – `cargo` 套件的版本是從現在資料夾中的 `Cargo.toml` 之中擷取出來的 -- **poetry** – `poetry` 套件的版本是從現在資料夾中的 `pyproject.toml` 之中擷取出來的 +- **npm** – The `npm` package version is extracted from the `package.json` present in the current directory +- **cargo** – The `cargo` package version is extracted from the `Cargo.toml` present in the current directory +- **poetry** – The `poetry` package version is extracted from the `pyproject.toml` present in the current directory - **composer** – The `composer` package version is extracted from the `composer.json` present in the current directory - **gradle** – The `gradle` package version is extracted from the `build.gradle` present - **julia** - The package version is extracted from the `Project.toml` present - **mix** - The `mix` package version is extracted from the `mix.exs` present +- **helm** - The `helm` chart version is extracted from the `Chart.yaml` present +- **maven** - The `maven` package version is extracted from the `pom.xml` present > ⚠️ 顯示出來的版本是從你的現在資料夾之中擷取出來的,並非從套件管理員取得。 ### 選項 -| 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` 模組。 | +| Option | 預設 | 說明 | +| ----------------- | ---------------------------------- | ---------------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"📦 "` | The symbol used before displaying the version the package. | +| `style` | `"bold 208"` | 這個模組的風格。 | +| `display_private` | `false` | Enable displaying version for packages marked as private. | +| `disabled` | `false` | Disables the `package` module. | ### Variables @@ -1584,11 +1705,47 @@ The `ocaml` module shows the currently installed version of OCaml. 這個模組 format = "via [🐪 $version]($style) " ``` +## Perl + +The `perl` module shows the currently installed version of Perl. 這個模組在下列其中一個條件達成時顯示: + +- The current directory contains a `Makefile.PL` or `Build.PL` file +- The current directory contains a `cpanfile` or `cpanfile.snapshot` file +- The current directory contains a `META.json` file or `META.yml` file +- The current directory contains a `.perl-version` file +- The current directory contains a `.pl`, `.pm` or `.pod` + +### 選項 + +| 變數 | 預設 | 說明 | +| ---------- | ---------------------------------- | ----------------------------------------------------- | +| `format` | `"via [$symbol$version]($style) "` | The format string for the module. | +| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl | +| `style` | `"bold 149"` | 這個模組的風格。 | +| `disabled` | `false` | Disables the `perl` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | --------- | ------------------------------------ | +| version | `v5.26.1` | The version of `perl` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | + +### 範例 + +```toml +# ~/.config/starship.toml + +[perl] +format = "via [🦪 $version]($style) " +``` + ## PHP The `php` module shows the currently installed version of PHP. 這個模組在下列其中一個條件達成時顯示: -- 現在資料夾中包含一個 `composer.json` 檔案 +- The current directory contains a `composer.json` file - The current directory contains a `.php-version` file - The current directory contains a `.php` file @@ -1628,35 +1785,37 @@ If `pyenv_version_name` is set to `true`, it will display the pyenv version name 這個模組在下列其中一個條件達成時顯示: -- 目前資料夾中有一個 `.python-version` 檔案 -- 目前資料夾中有一個 `requirements.txt` 檔案 -- 目前資料夾中有一個 `pyproject.toml` 檔案 +- The current directory contains a `.python-version` file +- The current directory contains a `requirements.txt` file +- The current directory contains a `pyproject.toml` file - The current directory contains a file with the `.py` extension (and `scan_for_pyfiles` is true) -- 目前資料夾中有一個 `Pipfile` 檔案 -- 目前資料夾中有一個 `tox.ini` 檔案 -- 現在資料夾中包含一個 `setup.py` 檔案 +- The current directory contains a `Pipfile` file +- The current directory contains a `tox.ini` file +- The current directory contains a `setup.py` file - The current directory contains a `__init__.py` file - A virtual environment is currently activated ### 選項 -| 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` 模組。 | +| Option | 預設 | 說明 | +| -------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `format` | `"via [${symbol}${pyenv_prefix}${version}( \\($virtualenv\\))]($style) "` | The format for the module. | +| `symbol` | `"🐍 "` | A format string representing the symbol of Python | +| `style` | `"yellow bold"` | 這個模組的風格。 | +| `pyenv_version_name` | `false` | Use pyenv to get Python version | +| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used | +| `scan_for_pyfiles` | `true` | If false, Python files in the current directory will not show this module. | +| `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 | +| 變數 | 範例 | 說明 | +| ------------ | --------------- | ------------------------------------------ | +| version | `"v3.8.1"` | The version of `python` | +| symbol | `"🐍 "` | Mirrors the value of option `symbol` | +| style | `"yellow bold"` | Mirrors the value of option `style` | +| pyenv_prefix | `"pyenv "` | Mirrors the value of option `pyenv_prefix` | +| virtualenv | `"venv"` | The current `virtualenv` name |
This module has some advanced configuration options. @@ -1684,16 +1843,15 @@ python_binary = "python3" [python] symbol = "👾 " pyenv_version_name = true -pyenv_prefix = "foo " ``` ## Ruby -`ruby` 模組顯示現在安裝的 Ruby 版本。 這個模組在下列其中一個條件達成時顯示: +The `ruby` module shows the currently installed version of Ruby. 這個模組在下列其中一個條件達成時顯示: -- 目前資料夾中有一個 `Gemfile` 檔案 +- The current directory contains a `Gemfile` file - The current directory contains a `.ruby-version` file -- 目前資料夾中有一個 `.rb` 檔案 +- The current directory contains a `.rb` file ### 選項 @@ -1702,7 +1860,7 @@ pyenv_prefix = "foo " | `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` 模組。 | +| `disabled` | `false` | Disables the `ruby` module. | ### Variables @@ -1725,10 +1883,10 @@ symbol = "🔺 " ## Rust -`rust` 模組顯示現在安裝的 Rust 版本。 這個模組在下列其中一個條件達成時顯示: +The `rust` module shows the currently installed version of Rust. 這個模組在下列其中一個條件達成時顯示: -- 目前資料夾中有一個 `Cargo.toml` 檔案 -- 現在資料夾中包含一個檔案具有 `.rs` 副檔名 +- The current directory contains a `Cargo.toml` file +- The current directory contains a file with the `.rs` extension ### 選項 @@ -1737,7 +1895,7 @@ symbol = "🔺 " | `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` 模組。 | +| `disabled` | `false` | Disables the `rust` module. | ### Variables @@ -1758,6 +1916,41 @@ symbol = "🔺 " format = "via [⚙️ $version](red bold)" ``` +## SHLVL + +The `shlvl` module shows the current SHLVL ("shell level") environment variable, if it is set to a number and meets or exceeds the specified threshold. + +### 選項 + +| 變數 | 預設 | 說明 | +| ----------- | ---------------------------- | --------------------------------------- | +| `threshold` | `2` | Display threshold. | +| `format` | `"[$symbol$shlvl]($style) "` | The format for the module. | +| `symbol` | `"↕️ "` | The symbol used to represent the SHLVL. | +| `style` | `"bold yellow"` | 這個模組的風格。 | +| `disabled` | `true` | Disables the `shlvl` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | --- | ------------------------------------ | +| shlvl | `3` | The current value of SHLVL | +| symbol | | Mirrors the 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 + +[shlvl] +disabled = false +format = "$shlvl level(s) down" +threshold = 3 +``` + ## Singularity The `singularity` module shows the current singularity image, if inside a container and `$SINGULARITY_NAME` is set. @@ -1790,6 +1983,83 @@ The `singularity` module shows the current singularity image, if inside a contai format = "[📦 \\[$env\\]]($style) " ``` +## Swift + +The `swift` module shows the currently installed version of Swift. 這個模組在下列其中一個條件達成時顯示: + +- The current directory contains a `Package.swift` file +- The current directory contains a file with the `.swift` extension + +### 選項 + +| Option | 預設 | 說明 | +| ---------- | ---------------------------------- | ------------------------------------------------ | +| `format` | `"via [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"🐦 "` | A format string representing the symbol of Swift | +| `style` | `"bold 202"` | 這個模組的風格。 | +| `disabled` | `false` | Disables the `swift` module. | + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | -------- | ------------------------------------ | +| version | `v5.2.4` | The version of `swift` | +| symbol | | Mirrors the 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 + +[swift] +format = "via [🏎 $version](red bold)" +``` + +## Status + +The `status` module displays the exit code of the previous command. The module will be shown only if the exit code is not `0`. + +::: tip + +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: + +### 選項 + +| 變數 | 預設 | 說明 | +| ---------- | -------------------------- | ------------------------------------------------------ | +| `format` | `[$symbol$status]($style)` | The format of the module | +| `symbol` | `"✖"` | A format string representing the symbol for the status | +| `style` | `"bold red"` | 這個模組的風格。 | +| `disabled` | `true` | Disables the `status` module. | + + +### Variables + +| 變數 | 範例 | 說明 | +| --------- | ----- | ------------------------------------ | +| status | `127` | The exit code of the last command | +| symbol | | Mirrors the 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 + +[status] +style = "bg:blue" +symbol = "💣 " +format = "[\\[$symbol$status\\]]($style) " +disabled = false + +``` + ## 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. If you still want to enable it, [follow the example shown below](#with-version). 這個模組在下列其中一個條件達成時顯示: @@ -1837,35 +2107,35 @@ format = "[🏎💨 $version$workspace]($style) " format = "[🏎💨 $workspace]($style) " ``` -## 時間 +## Time -`time` 模組顯示目前的**當地**時間. `format` 設定值被 [`chrono`](https://crates.io/crates/chrono) crate 用來控制時間如何顯示。 請看 [chrono 的 strftime 文件](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html)來了解有那些選項可以使用。 +The `time` module shows the current **local** time. The `format` configuration value is used by the [`chrono`](https://crates.io/crates/chrono) crate to control how the time is displayed. Take a look [at the chrono strftime docs](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html) to see what options are available. ::: tip -這個模組預設是停用的。 想要啟用它的話,請在設定檔中將 `disabled` 設定為 `false`。 +This module is disabled by default. To enable it, set `disabled` to `false` in your configuration file. ::: ### 選項 -| Option | 預設 | 說明 | -| ----------------- | ----------------------- | ----------------------------------------------------------------------------------------------------- | -| `format` | `"at [$time]($style) "` | The format string for the module. | -| `use_12hr` | `false` | 啟用 12 小時格式。 | -| `time_format` | 請看下列 | 用來顯示時間的 [chrono 格式字串](https://docs.rs/chrono/0.4.7/chrono/format/strftime/index.html)。 | -| `style` | `"bold yellow"` | 這個模組的時間的風格。 | -| `utc_time_offset` | `"local"` | 設定相對於 UTC 的時差。 Range from -24 < 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` | 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 `time_format` defaults to `"%r"`. 不然的話,它會被預設為 `"%T"`。 Manually setting `time_format` will override the `use_12hr` setting. +If `use_12hr` is `true`, then `time_format` defaults to `"%r"`. Otherwise, it defaults to `"%T"`. Manually setting `time_format` will override the `use_12hr` setting. ### Variables | 變數 | 範例 | 說明 | | --------- | ---------- | ----------------------------------- | -| 時間 | `13:08:10` | The current time. | +| time | `13:08:10` | The current time. | | style\* | | Mirrors the value of option `style` | \*: This variable can only be used as a part of a style string @@ -1883,24 +2153,24 @@ utc_time_offset = "-5" time_range = "10:00:00-14:00:00" ``` -## 使用者名稱 +## Username -`username` 模組顯示現在使用中的使用者名稱。 這個模組在下列其中一個條件達成時顯示: +The `username` module shows active user's username. 這個模組在下列其中一個條件達成時顯示: -- 目前使用者為 root -- 目前使用者並非登入時的使用者 -- 使用者透過 SSH session 進行連線 -- 變數 `show_always` 被設為 true +- The current user is root +- The current user isn't the same as the one that is logged in +- The user is currently connected as an SSH session +- The variable `show_always` is set to true ### 選項 -| 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` 模組。 | +| Option | 預設 | 說明 | +| ------------- | ----------------------- | ------------------------------------- | +| `style_root` | `"bold red"` | The style used when the user is root. | +| `style_user` | `"bold yellow"` | The style used for non-root users. | +| `format` | `"[$user]($style) in "` | The format for the module. | +| `show_always` | `false` | Always shows the `username` module. | +| `disabled` | `false` | Disables the `username` module. | ### Variables @@ -1975,7 +2245,13 @@ Multiple custom modules can be defined by using a `.`. ::: tip -The order in which custom modules are shown can be individually set by setting `custom.foo` in `prompt_order`. By default, the `custom` module will simply show all custom modules in the order they were defined. +The order in which custom modules are shown can be individually set by including `${custom.foo}` in the top level `format` (as it includes a dot, you need to use `${...}`). By default, the `custom` module will simply show all custom modules in the order they were defined. + +::: + +::: tip + +[Issue #1252](https://github.com/starship/starship/discussions/1252) contains examples of custom modules. If you have an interesting example not covered there, feel free to share it there! ::: @@ -1983,10 +2259,10 @@ The order in which custom modules are shown can be individually set by setting ` | Option | 預設 | 說明 | | ------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `command` | | The command whose output should be printed. | +| `command` | | The command whose output should be printed. The command will be passed on stdin to the shell. | | `when` | | A shell command used as a condition to show the module. The module will be shown if the command returns a `0` status code. | | `shell` | | [See below](#custom-command-shell) | -| `說明` | `""` | The description of the module that is shown when running `starship explain`. | +| `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. | @@ -2014,6 +2290,8 @@ The order in which custom modules are shown can be individually set by setting ` If unset, it will fallback to STARSHIP_SHELL and then to "sh" on Linux, and "cmd /C" on Windows. +The `command` will be passed in on stdin. + If `shell` is not given or only contains one element and Starship detects PowerShell will be used, the following arguments will automatically be added: `-NoProfile -Command -`. This behavior can be avoided by explicitly passing arguments to the shell, e.g. ```toml @@ -2041,12 +2319,11 @@ Automatic detection of shells and proper parameters addition are currently imple command = "echo foo" # shows output of command files = ["foo"] # can specify filters when = """ test "$HOME" == "$PWD" """ -prefix = " transcending " +format = " transcending [$output]($style)" [custom.time] command = "time /T" files = ["*.pst"] -prefix = "transcending " shell = ["pwsh.exe", "-NoProfile", "-Command", "-"] ``` @@ -2054,7 +2331,7 @@ shell = ["pwsh.exe", "-NoProfile", "-Command", "-"] The `purescript` module shows the currently installed version of PureScript version. 這個模組在下列其中一個條件達成時顯示: -- 現在資料夾中包含一個 `spago.dhall` 檔案 +- The current directory contains a `spago.dhall` file - The current directory contains a \*.purs files ### 選項 diff --git a/docs/zh-TW/faq/README.md b/docs/zh-TW/faq/README.md index 84be958c..6c1cf627 100644 --- a/docs/zh-TW/faq/README.md +++ b/docs/zh-TW/faq/README.md @@ -10,11 +10,11 @@ - **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? +## Do top level `format` and `.disabled` do the same thing? Yes, they can both be used to disable modules in the prompt. If all you plan to do is disable modules, `.disabled` is the preferred way to do so for these reasons: -- Disabling modules is more explicit than omitting them from the prompt_order +- Disabling modules is more explicit than omitting them from the top level `format` - Newly created modules will be added to the prompt as Starship is updated ## The docs say Starship is cross-shell, but it doesn't support X shell. Why? diff --git a/docs/zh-TW/guide/README.md b/docs/zh-TW/guide/README.md index f2142f91..d6fb58f2 100644 --- a/docs/zh-TW/guide/README.md +++ b/docs/zh-TW/guide/README.md @@ -112,7 +112,7 @@ - **Easy:** quick to install – start using it in minutes.

-Explore the Starship docs  ▶ +Explore the Starship docs  ▶

diff --git a/docs/zh-TW/migrating-to-0.45.0/README.md b/docs/zh-TW/migrating-to-0.45.0/README.md new file mode 100644 index 00000000..6dacbc10 --- /dev/null +++ b/docs/zh-TW/migrating-to-0.45.0/README.md @@ -0,0 +1,265 @@ +# Migrating to v0.45.0 + +Starship v0.45.0 is a release containing breaking changes, in preparation for the big v1.0.0. We have made some major changes around how configuration is done on the prompt, to allow for a greater degree of customization. + +This guide is intended to walk you through the breaking changes. + +## `prompt_order` has been replaced by a root-level `format` + +Previously to v0.45.0, `prompt_order` would accept an array of module names in the order which they should be rendered by Starship. + +Starship v0.45.0 will instead be accepting a `format` value, allowing for customization of the prompt outside of the modules themselves. + +**Example pre-v0.45.0 configuration** + +```toml +prompt_order = [ + "username", + "hostname", + "directory", + "git_branch", + "git_commit", + "git_state", + "git_status", + "cmd_duration", + "custom", + "line_break", + "jobs", + "battery", + "time", + "character", +] +``` + +**Example v0.45.0 configuration** + +```toml +format = """\ + $username\ + $hostname\ + $directory\ + $git_branch\ + $git_commit\ + $git_state\ + $git_status\ + $cmd_duration\ + $custom\ + $line_break\ + $jobs\ + $battery\ + $time\ + $character\ + """ +``` + +## Module `prefix` and `suffix` will be replaced by `format` + +Previously to v0.45.0, some modules would accept `prefix` and/or `suffix` in order to stylize the way that modules are rendered. + +Starship v0.45.0 will instead be accepting a `format` value, allowing for further customization of how modules are rendered. Instead of defining a prefix and suffix for the context-based variables, the variables can now be substituted from within a format string, which represents the module's output. + +**Example pre-v0.45.0 configuration** + +```toml +[cmd_duration] +prefix = "took " +``` + +**Example v0.45.0 configuration** + +```toml +[cmd_duration] +# $duration – The command duration (e.g. "15s") +# $style – The default style of the module (e.g. "bold yellow") +format = "took [$duration]($style)" +``` + +### Affected Modules + +#### 字元 + +| Removed Property | Replacement | +| ----------------------- | ---------------- | +| `symbol` | `success_symbol` | +| `use_symbol_for_status` | `error_symbol` | +| `style_success` | `success_symbol` | +| `style_failure` | `error_symbol` | + +**Changes to the Default Configuration** + +```diff +[character] +-- symbol = "❯" +-- error_symbol = "✖" +-- use_symbol_for_status = true +-- vicmd_symbol = "❮" +++ success_symbol = "[❯](bold green) " +++ error_symbol = "[❯](bold red) " +++ vicmd_symbol = "[❮](bold green)" +``` + +Previously, the `use_symbol_for_status` property was used to configure the prompt to show the `error_symbol` when the last command resulted in a non-zero status code. + +With the release of v0.45.0, we now always use `error_symbol` after non-zero status codes, unifying `use_symbol_for_status` and `error_symbol` properties. + +To configure the prompt to use the older `use_symbol_for_status = true` configuration, add the following to your config file: + +```toml +[character] +error_symbol = "[✖](bold red) " +``` + +#### 指令持續時間 + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | + +**Changes to the Default Configuration** + +```diff +[cmd_duration] +-- prefix = "took " +++ format = "took [$duration]($style)" +``` + +#### Directory + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | + +**Changes to the Default Configuration** + +```diff +[directory] +-- prefix = "in " +++ format = "[$path]($style)[$lock_symbol]($lock_style)" +``` + +#### Environment Variable + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[env_var] +-- prefix = "" +-- suffix = "" +++ format = "with [$env_value]($style) " +``` + +#### Git Commit + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[git_commit] +-- prefix = "(" +-- suffix = ")" +++ format = "[\\($hash\\)]($style) " +``` + +#### Git Status + +| Removed Property | Replacement | +| ----------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | +| `show_sync_count` | `format` | + +**Changes to the Default Configuration** + +```diff +[git_status] +-- prefix = "[" +-- suffix = "]" +-- show_sync_count = false +++ format = "([$all_status$ahead_behind] )" +``` + +Previously, the `show_sync_count` property was used to configure the prompt to show the number of commits the branch was ahead or behind the remote branch. + +With the release of v0.45.0, this has been replaced with the + +To configure the prompt to use the older `show_sync_count = true` configuration, set the following to your config file: + +```toml +[git_status] +ahead = "⇡${count}" +diverged = "⇕⇡${ahead_count}⇣${behind_count}" +behind = "⇣${count}" +``` + +#### Hostname + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[hostname] +-- prefix = "" +-- suffix = "" +++ format = "[$hostname]($style) in " +``` + +#### Singularity + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `label` | `format` | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[singularity] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol\\[$env\\]]($style) " +``` + +#### Time + +| Removed Property | Replacement | +| ---------------- | ------------- | +| `format` | `time_format` | + +**Changes to the Default Configuration** + +```diff +[time] +-- format = "🕙[ %T ]" +++ time_format = "%T" +++ format = "at 🕙[$time]($style) +``` + +#### Custom Commands + +| Removed Property | Replacement | +| ---------------- | ----------- | +| `prefix` | `format` | +| `suffix` | `format` | + +**Changes to the Default Configuration** + +```diff +[custom.example] +-- prefix = "" +-- suffix = "" +++ format = "[$symbol$output]($style) " +``` diff --git a/docs/zh-TW/presets/README.md b/docs/zh-TW/presets/README.md index 59eb8fb4..4587398b 100644 --- a/docs/zh-TW/presets/README.md +++ b/docs/zh-TW/presets/README.md @@ -26,6 +26,9 @@ discharging_symbol = "" [conda] symbol = " " +[dart] +symbol = " " + [docker] symbol = " " @@ -68,6 +71,9 @@ symbol = " " [package] symbol = " " +[perl] +symbol = " " + [php] symbol = " " @@ -79,4 +85,7 @@ symbol = " " [rust] symbol = " " + +[swift] +symbol = "ﯣ " ```