mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
docs(i18n): new Crowdin updates (#3218)
This commit is contained in:
@@ -31,11 +31,11 @@ trap blastoff DEBUG # Trap Inicia o debug antes de iniciar o starship
|
||||
eval $(starship init bash)
|
||||
```
|
||||
|
||||
## Custom pre-prompt and pre-execution Commands in PowerShell
|
||||
## Comandos personalizados de pre-prompt e pre-execution no PowerShell
|
||||
|
||||
PowerShell does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `powershell`. No entanto, Starship te oferece uma capacidade limitada de inserir suas próprias funções na processo de prompt-rendering:
|
||||
O PowerShell não possui uma estrutura formal para os hooks preexec/precmd como a maioria dos outros shells. Por esse motivo, é difícil fornecer hooks totalmente customizáveis no `powershell`. No entanto, Starship te oferece uma capacidade limitada de inserir suas próprias funções na processo de prompt-rendering:
|
||||
|
||||
Create a function named `Invoke-Starship-PreCommand`
|
||||
Crie uma função chamada `Invoke-Starship-PreCommand`
|
||||
|
||||
```powershell
|
||||
function Invoke-Starship-PreCommand {
|
||||
@@ -43,11 +43,11 @@ function Invoke-Starship-PreCommand {
|
||||
}
|
||||
```
|
||||
|
||||
## Change Window Title
|
||||
## Altera o título da janela
|
||||
|
||||
Some shell prompts will automatically change the window title for you (e.g. to reflect your working directory). Fish even does it by default. Starship does not do this, but it's fairly straightforward to add this functionality to `bash` or `zsh`.
|
||||
Alguns shell prompts iram alterar o titulo da janela automaticamente para você (e.x: para espelhar o diretório atual). Fish faz isso por padrão. Starship não faz isso, mas é bastante simples adicionar esta funcionalidade ao `bash` ou `zsh`.
|
||||
|
||||
First, define a window title change function (identical in bash and zsh):
|
||||
Primeiro, defina uma função de alteração de titulo de janela (é o mesmo para bash e zsh):
|
||||
|
||||
```bash
|
||||
function set_win_title(){
|
||||
@@ -55,23 +55,23 @@ function set_win_title(){
|
||||
}
|
||||
```
|
||||
|
||||
You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices).
|
||||
Você pode usar variáveis para customizar o titulo (`$USER`, `$HOSTNAME`, e `$PWD` são escolhas populares).
|
||||
|
||||
In `bash`, set this function to be the precmd starship function:
|
||||
No `bash`, defina esta função como a precedente da função starship:
|
||||
|
||||
```bash
|
||||
starship_precmd_user_func="set_win_title"
|
||||
```
|
||||
|
||||
In `zsh`, add this to the `precmd_functions` array:
|
||||
No `zsh`, adicione no array `precmd_functions`:
|
||||
|
||||
```bash
|
||||
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.
|
||||
Se você gostar do resultado, adicione esta linha ao seu arquivo de configuração de shell (`~/.bashrc` or `~/.zshrc`) para torna-lo 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 exemplo, se você quiser exibir seu diretório atual no seu titulo de aba do terminal, adicione o seguinte snippet ao seu `~/.bashrc` ou `~/.zshrc`:
|
||||
|
||||
```bash
|
||||
function set_win_title(){
|
||||
@@ -80,7 +80,7 @@ function set_win_title(){
|
||||
starship_precmd_user_func="set_win_title"
|
||||
```
|
||||
|
||||
You can also set a similar output with PowerShell by creating a function named `Invoke-Starship-PreCommand`.
|
||||
Você também pode definir uma saída semelhante com o PowerShell criando uma função chamada `Invoke-Starship-PreCommand`.
|
||||
|
||||
```powershell
|
||||
# edit $PROFILE
|
||||
@@ -91,27 +91,27 @@ function Invoke-Starship-PreCommand {
|
||||
Invoke-Expression (&starship init powershell)
|
||||
```
|
||||
|
||||
## Enable Right Prompt
|
||||
## Ativando o Prompt Direito
|
||||
|
||||
Some shells support a right prompt which renders on the same line as the input. Starship can set the content of the right prompt using the `right_format` option. Any module that can be used in `format` is also supported in `right_format`. The `$all` variable will only contain modules not explicitly used in either `format` or `right_format`.
|
||||
Alguns shells suportam um prompt no lado direito que renderiza na mesma linha do input. Starship consegue definir o conteúdo do prompt direito usando a opção `right_format`. Qualquer módulo pode ser usado no `format` é suportado o `right_format`. A variável `$all` só irá alterar os módulos que não usaram de forma explicita o `format` ou `right_format`.
|
||||
|
||||
Note: The right prompt is a single line following the input location. To right align modules above the input line in a multi-line prompt, see the [fill module](/config/#fill).
|
||||
Nota: O prompt direito é uma linha única seguindo o local de entrada. Para alinhar à direita os módulos acima a linha de entrada em um prompt de várias linhas, consulte o [módulo fill](/config/#fill).
|
||||
|
||||
`right_format` is currently supported for the following shells: elvish, fish, zsh.
|
||||
`right_format` é atualmente suportado para os seguintes shells: elvish, fish, zsh.
|
||||
|
||||
### Exemplo
|
||||
|
||||
```toml
|
||||
# ~/.config/starship.toml
|
||||
|
||||
# A minimal left prompt
|
||||
# Um prompt esquerdo minimo
|
||||
format = """$character"""
|
||||
|
||||
# move the rest of the prompt to the right
|
||||
# Move o resto do prompt para direita
|
||||
right_format = """$all"""
|
||||
```
|
||||
|
||||
Produces a prompt like the following:
|
||||
Gera um prompt parecido com o seguinte:
|
||||
|
||||
```
|
||||
▶ starship on rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s
|
||||
@@ -120,7 +120,7 @@ Produces a prompt like the following:
|
||||
|
||||
## Estilo dos textos
|
||||
|
||||
Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following:
|
||||
Estilo de strings são uma lista de palavras, separadas por espaço. As palavras não são case sensitive (ou seja `bold` e `BoLd` são consideradas iguais). Cada palavra pode ser uma das seguintes:
|
||||
|
||||
- `bold`
|
||||
- `italic`
|
||||
@@ -132,14 +132,14 @@ Style strings are a list of words, separated by whitespace. The words are not ca
|
||||
- `<color>`
|
||||
- `none`
|
||||
|
||||
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter.
|
||||
onde `<color>` é uma especialista de cores (discutido abaixo). `fg:<color>` e `<color>` atualmente fazem a mesma coisa, isto deve mudar no futuro. `inverted` troca as cores de background e foreground. A ordem de palavras na string não importa.
|
||||
|
||||
The `none` token overrides all other tokens in a string if it is not part of a `bg:` specifier, so that e.g. `fg:red none fg:blue` will still create a string with no styling. `bg:none` sets the background to the default color so `fg:red bg:none` is equivalent to `red` or `fg:red` and `bg:green fg:red bg:none` is also equivalent to `fg:red` or `red`. It may become an error to use `none` in conjunction with other tokens in the future.
|
||||
O token `none` substitui todos os outros tokens na string se ele não fizer parte de um `bg:` especificado que seja, por exemplo `fg:red none fg:blue` ainda criará uma string sem estilo. `bg:none` define a cor padrão de background então `fg:red bg:none` é equivalente a `red` ou `fg:red` e `bg:green fg:red bg:none` é equivalente a `fg:red` ou`red`. Pode se transformar em um erro ao usar `none` em um conjunto de outros tokens no futuro.
|
||||
|
||||
A color specifier can be one of the following:
|
||||
Um especialista em cores pode ser um dos seguintes:
|
||||
|
||||
- Um dos padrões de cores no terminal: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. Você pode de forma opcional prefixar com `bright-` para obter uma versão mais brilhante/clara (ex `bright-white`).
|
||||
- Um `#` seguido por um número de seis dígitos hexadecimais. Isto especifica um [Código RGB em formato hexadecimal](https://www.w3schools.com/colors/colors_hexadecimal.asp).
|
||||
- Um número entre 0-255. Este especifica um [Código de Cor ANSI 8 bits](https://i.stack.imgur.com/KTSQa.png).
|
||||
|
||||
If multiple colors are specified for foreground/background, the last one in the string will take priority.
|
||||
Se múltiplas cores forem especificadas para foreground/background, a ultima da string que terá prioridade.
|
||||
|
||||
Reference in New Issue
Block a user