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

This commit is contained in:
Matan Kushner 2020-09-30 16:26:13 -04:00 committed by GitHub
parent d63c7ce3f9
commit d8dcf04cff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
52 changed files with 7854 additions and 2895 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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 `<module>.disabled` dasselbe?
## Do top level `format` and `<module>.disabled` do the same thing?
Ja, beide können benutzt werden, um Module in der Prompt zu deaktivieren. Wenn nur Module deaktiviert werden wollen, sollte `<module>.disabled` benutzt werden, aus den folgenden Gründen:
- 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?

View File

@ -112,7 +112,7 @@
- **Easy:** quick to install  start using it in minutes.
<p align="center">
<a href="https://starship.rs/"><strong>Explore the Starship docs&nbsp;&nbsp;</strong></a>
<a href="https://starship.rs/config/"><strong>Explore the Starship docs&nbsp;&nbsp;</strong></a>
</p>
<a name="🚀-installation"></a>

View File

@ -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) "
```

View File

@ -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 = "ﯣ "
```

View File

@ -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.

View File

@ -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 `<color>` es un especificador de color (discutido a continuación). `fg:<color>` y `<color>` 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.

File diff suppressed because it is too large Load Diff

View File

@ -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 `<module>.disabled` hacen lo mismo?
## Do top level `format` and `<module>.disabled` do the same thing?
Sí, se pueden usar ambos para desactivar los módulos en el símbolo del sistema. Si todo lo que planeas es desactivar módulos, `<module>.disabled` es el método preferido por las siguientes razones:
- 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

View File

@ -30,11 +30,11 @@
</p>
<p align="center">
<a href="https://starship.rs">Web</a>
<a href="https://starship.rs">Sitio Web</a>
·
<a href="#🚀-installation">Instalación</a>
·
<a href="https://starship.rs/config/">Configuration</a>
<a href="https://starship.rs/config/">Configuración</a>
</p>
<p align="center">
@ -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.
<p align="center">
<a href="https://starship.rs/"><strong>Explora la documentación de Starship&nbsp;&nbsp;</strong></a>
<a href="https://starship.rs/config/"><strong>Explora la documentación de Starship&nbsp;&nbsp;</strong></a>
</p>
<a name="🚀-installation"></a>
## 🚀 Instalacíon
## 🚀 Instalacn
### 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)]
<a href="https://opencollective.com/starship/organization/0/website"><img src="https://opencollective.com/starship/organization/0/avatar.svg"></a>
<a href="https://opencollective.com/starship/organization/1/website"><img src="https://opencollective.com/starship/organization/1/avatar.svg"></a>
@ -250,11 +250,11 @@ Apoya este proyecto con tu organización. Vuestro logo se mostrará aquí con un
<a href="https://opencollective.com/starship/organization/8/website"><img src="https://opencollective.com/starship/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/starship/organization/9/website"><img src="https://opencollective.com/starship/organization/9/avatar.svg"></a>
## 💭 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.

View File

@ -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) "
```

View File

@ -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 = "ﯣ "
```

View File

@ -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.
---
<div class="center">
@ -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 dinitialisation au fichier configuration de votre shell:
#### Bash

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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 `<module>.disabled` font la même chose ?
## Est-ce que l'option globale `format` et `<module>.disabled` font la même chose ?
Oui, ils peuvent tous deux être utilisés pour désactiver les modules dans l'invite de commande. Si tout ce que vous prévoyez de faire est de désactiver les modules, `<module>.disabled` est le meilleur moyen de le faire pour ces raisons :
- 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

View File

@ -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.
<p align="center">
<a href="https://starship.rs/"><strong>Consulter la documentation de Starship&nbsp;&nbsp;</strong></a>
<a href="https://starship.rs/config/"><strong>Consulter la documentation de Starship&nbsp;&nbsp;</strong></a>
</p>
<a name="🚀-installation"></a>
@ -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 dinitialisation 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)].
<a href="https://github.com/starship/starship/graphs/contributors"><img src="https://opencollective.com/starship/contributors.svg?width=890&button=false" /></a>
@ -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.

View File

@ -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) "
```

View File

@ -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 = "ﯣ "
```

View File

@ -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(){

File diff suppressed because it is too large Load Diff

View File

@ -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``<module>.disabled` は同じことをしますか?
## Do top level `format` and `<module>.disabled` do the same thing?
はい、両方ともプロンプトでモジュールを無効にするために使用できます。 モジュールを無効にするだけの場合は、これらの理由から` <module> .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</ 0>などのUTF-8値に設定されています。 <code>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)"
```

View File

@ -112,7 +112,7 @@
- **簡単:** 迅速なインストールが可能であり、数分で使用開始可能です。
<p align="center">
<a href="https://starship.rs/"><strong>Starshipのドキュメントを見る&nbsp;&nbsp;</strong></a>
<a href="https://starship.rs/config/"><strong>Starshipのドキュメントを見る&nbsp;&nbsp;</strong></a>
</p>
<a name="🚀-installation"></a>
@ -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)を試してみてください)。
### 入門

View File

@ -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) "
```

View File

@ -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 = "ﯣ "
```

View File

@ -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 <code>starship.toml`. Esta página detalha algumas das configurações mais avançadas usadas em starship.
::: warning

View File

@ -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 |
<details>
<summary>This module has some advanced configuration options.</summary>
@ -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` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `description` | `"<custom module>"` | The description of the module that is shown when running `starship explain`. |
| `files` | `[]` | The files that will be searched in the working directory for a match. |
| `directories` | `[]` | The directories that will be searched in the working directory for a match. |
| `extensions` | `[]` | The extensions that will be searched in the working directory for a match. |
@ -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", "-"]
```

View File

@ -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 `<module>.disabled` do the same thing?
## Do top level `format` and `<module>.disabled` do the same thing?
Yes, they can both be used to disable modules in the prompt. If all you plan to do is disable modules, `<module>.disabled` is the preferred way to do so for these reasons:
- 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?

View File

@ -112,7 +112,7 @@
- **Fácil:**Instalação rápida comece a usar em minutos.
<p align="center">
<a href="https://starship.rs/"><strong>Consulte a documentação&nbsp;&nbsp;</strong></a>
<a href="https://starship.rs/config/"><strong>Consulte a documentação&nbsp;&nbsp;</strong></a>
</p>
<a name="🚀-installation"></a>

View File

@ -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) "
```

View File

@ -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 = "ﯣ "
```

View File

@ -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 |
<details>
<summary>This module has some advanced configuration options.</summary>
@ -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` | `"<custom module>"` | 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", "-"]
```

View File

@ -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 `<module>.disabled` do the same thing?
## Do top level `format` and `<module>.disabled` do the same thing?
Yes, they can both be used to disable modules in the prompt. If all you plan to do is disable modules, `<module>.disabled` is the preferred way to do so for these reasons:
- 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?

View File

@ -112,7 +112,7 @@
- **Easy:** quick to install  start using it in minutes.
<p align="center">
<a href="https://starship.rs/"><strong>Explore the Starship docs&nbsp;&nbsp;</strong></a>
<a href="https://starship.rs/config/"><strong>Explore the Starship docs&nbsp;&nbsp;</strong></a>
</p>
<a name="🚀-installation"></a>

View File

@ -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) "
```

View File

@ -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 = "ﯣ "
```

File diff suppressed because it is too large Load Diff

View File

@ -10,11 +10,11 @@
- **Конфигурация**: [matchai's Dotfiles](https://github.com/matchai/dotfiles/blob/b6c6a701d0af8d145a8370288c00bb9f0648b5c2/.config/fish/config.fish)
- **Подсказка**: [Starship](https://starship.rs/)
## `prompt_order` и `<module>.disabled` - это одно и то же?
## Do top level `format` and `<module>.disabled` do the same thing?
Да, они могут быть использованы для отключения модулей в подсказке. Если всё, что вы хотите сделать - это отключить модули, `<module>.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

View File

@ -112,7 +112,7 @@
- **Легкая:** быстро установить - начните использовать ее в считанные минуты.
<p align="center">
<a href="https://starship.rs/"><strong>Изучите документацию Starship&nbsp;&nbsp;</strong></a>
<a href="https://starship.rs/config/"><strong>Изучите документацию Starship&nbsp;&nbsp;</strong></a>
</p>
<a name="🚀-installation"></a>

View File

@ -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) "
```

View File

@ -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 = "ﯣ "
```

View File

@ -1,6 +1,6 @@
# 高级配置
# Advanced Configuration
Starship 功能繁多,有时您必须在编辑 `starship.toml` 之外做更多工作才能实现某些效果。 此页面详细介绍了一些在 starship 中使用的高级配置技巧。
`Starship 功能繁多,有时您必须在编辑 <code>starship.toml` 之外做更多工作才能实现某些效果。 此页面详细介绍了一些在 starship 中使用的高级配置技巧。
::: warning

File diff suppressed because it is too large Load Diff

View File

@ -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``<module>.disabled` 的效果是一样的吗?
## Do top level `format` and `<module>.disabled` do the same thing?
是的,他们都可以用来禁用提示符中的组件。 如果你只是想禁用组件,推荐使用 `<module>.disabled`,原因如下:
- “禁用组件”比在 prompt_order 中忽略某个组件更为清晰明确
- Disabling modules is more explicit than omitting them from the top level `format`
- 当 Starship 升级后,新组件将能够自动被加入提示符中
## 你们的文档说“Starship 是跨 shell 的”,但它不支持 X shell。 为什么?

View File

@ -112,7 +112,7 @@
- **Easy:** quick to install  start using it in minutes.
<p align="center">
<a href="https://starship.rs/"><strong>Explore the Starship docs&nbsp;&nbsp;</strong></a>
<a href="https://starship.rs/config/"><strong>Explore the Starship docs&nbsp;&nbsp;</strong></a>
</p>
<a name="🚀-installation"></a>

View File

@ -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) "
```

View File

@ -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 = "ﯣ "
```

File diff suppressed because it is too large Load Diff

View File

@ -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 `<module>.disabled` do the same thing?
## Do top level `format` and `<module>.disabled` do the same thing?
Yes, they can both be used to disable modules in the prompt. If all you plan to do is disable modules, `<module>.disabled` is the preferred way to do so for these reasons:
- 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?

View File

@ -112,7 +112,7 @@
- **Easy:** quick to install  start using it in minutes.
<p align="center">
<a href="https://starship.rs/"><strong>Explore the Starship docs&nbsp;&nbsp;</strong></a>
<a href="https://starship.rs/config/"><strong>Explore the Starship docs&nbsp;&nbsp;</strong></a>
</p>
<a name="🚀-installation"></a>

View File

@ -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) "
```

View File

@ -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 = "ﯣ "
```