summaryrefslogtreecommitdiffstats
path: root/docs/pt-BR/advanced-config
diff options
context:
space:
mode:
authorMatan Kushner <hello@matchai.dev>2022-02-07 15:53:55 +0100
committerGitHub <noreply@github.com>2022-02-07 15:53:55 +0100
commit1d965a9d24509d500954669b4e5fb08e54733411 (patch)
treed2d0714bad4ba9ac79a8a8385a690ad0e454c2a3 /docs/pt-BR/advanced-config
parentdb86a93824ae0ce985db463ea34807990b3b879b (diff)
docs(i18n): new Crowdin updates (#3460)
Diffstat (limited to 'docs/pt-BR/advanced-config')
-rw-r--r--docs/pt-BR/advanced-config/README.md122
1 files changed, 62 insertions, 60 deletions
diff --git a/docs/pt-BR/advanced-config/README.md b/docs/pt-BR/advanced-config/README.md
index 27567d7d1..df09878f6 100644
--- a/docs/pt-BR/advanced-config/README.md
+++ b/docs/pt-BR/advanced-config/README.md
@@ -1,18 +1,18 @@
# Configuração avançada
-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.
+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 técnicas de configuração avançadas utilizadas no starship.
-::: warning
+::: atenção
As configurações nesta seção estão sujeitas a alterações em futuras versões do Starship.
:::
-## Custom pre-prompt and pre-execution Commands in Cmd
+## Comandos personalizados de pré-prompt e pré-execução no Cmd
-Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands in Cmd shell. It is fairly simple to use with Starship. Make the following changes to your `starship.lua` file as per your requirements:
+O Clink fornece APIs extremamente flexíveis para executar comandos pré-prompt e pré-execução em Cmd shell. É bastante simples de usar com o Starship. Faça as seguintes alterações no seu arquivo `starship.lua` conforme suas necessidades:
-- To run a custom function right before the prompt is drawn, define a new function called `starship_preprompt_user_func`. This function receives the current prompt as a string that you can utilize. For example, to draw a rocket before the prompt, you would do
+- Para executar uma função personalizada logo antes do prompt ser inicializado, defina um novo função chamada `starship_preprompt_user_func`. Esta função recebe o prompt atual como uma string que você pode utilizar. Por exemplo, para exibir um foguete antes do prompt, você faria
```lua
function starship_preprompt_user_func(prompt)
@@ -22,7 +22,7 @@ end
load(io.popen('starship init cmd'):read("*a"))()
```
-- To run a custom function right before a command is executed, define a new function called `starship_precmd_user_func`. This function receives the current commandline as a string that you can utilize. For example, to print the command that's about to be executed, you would do
+- Para executar uma função personalizada logo antes de um comando ser executado, defina um novo função chamada `starship_precmd_user_func`. Esta função recebe a linha de comando atual como uma string que você pode utilizar. Por exemplo, para imprimir o comando que está prestes a ser executado, você faria
```lua
function starship_precmd_user_func(line)
@@ -32,11 +32,11 @@ end
load(io.popen('starship init cmd'):read("*a"))()
```
-## Custom pre-prompt and pre-execution Commands in Bash
+## Comandos personalizados de pré-prompt e pré-execução no Bash
-Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. No entanto, Starship te oferece uma capacidade limitada de inserir suas próprias funções na processo de prompt-rendering:
+Bash não possui uma estrutura formal pré-prompt/pré-execução como a maioria dos outros shells. Por causa disso, é difícil fornecer ganchos totalmente personalizáveis no `bash`. No entanto, Starship te oferece uma capacidade limitada de inserir suas próprias funções na processo de prompt-rendering:
-- To run a custom function right before the prompt is drawn, define a new function and then assign its name to `starship_precmd_user_func`. For example, to draw a rocket before the prompt, you would do
+- Para executar uma função personalizada logo antes de o prompt ser inicializado, define uma nova função e, em seguida, atribui seu nome a `starship_precmd_user_func`. Por exemplo, para exibir um foguete antes do prompt, você faria
```bash
function blastoff(){
@@ -45,21 +45,23 @@ function blastoff(){
starship_precmd_user_func="blastoff"
```
-- To run a custom function right before a command runs, you can use the [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). However, you **must** trap the DEBUG signal *before* initializing Starship! Starship can preserve the value of the DEBUG trap, but if the trap is overwritten after starship starts up, some functionality will break.
+- Para executar uma função personalizada logo antes de um comando ser executado, você pode usar o [`DEBUG` mecanismo de captura](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). No entanto, você **deve** capturar o sinal DEBUG _antes_ de inicializar o Starship! Starship pode preservar o valor da captura do DEBUG, mas se a captura for substituída após a inicialização do starship, algumas funcionalidades serão interrompidas.
```bash
function blastoff(){
echo "🚀"
}
-trap blastoff DEBUG # Trap DEBUG *before* running starship
+trap blastoff DEBUG # Captura o DEBUG *antes* de executar a nave estelar
+set -o functrace
eval $(starship init bash)
+set +o functrace
```
-## Custom pre-prompt and pre-execution Commands in PowerShell
+## Comandos personalizados de pré-prompt e pré-execução 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:
+PowerShell não possui uma estrutura formal pré-prompt/pré-execução como a maioria dos outros shells. Por causa disso, é difícil fornecer ganchos totalmente personalizá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 {
@@ -67,11 +69,11 @@ function Invoke-Starship-PreCommand {
}
```
-## Change Window Title
+## Alterar 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`, `zsh`, `cmd` or `powershell`.
+Alguns prompts do shell alterarão automaticamente o título da janela para você (ex., para refletir no seu diretório de trabalho). Fish ainda faz isso por padrão. Starship não faz isso, mas é bastante simples adicionar essa funcionalidade para `bash`, `zsh`, `cmd` ou `powershell`.
-First, define a window title change function (identical in bash and zsh):
+Primeiro, defina uma função de mudança de título da janela (idêntica em bash e zsh):
```bash
function set_win_title(){
@@ -79,23 +81,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 personalizar este título (`$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 função precmd da nave estelar:
```bash
starship_precmd_user_func="set_win_title"
```
-In `zsh`, add this to the `precmd_functions` array:
+No `zsh`, adicione isso ao 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 estas linhas ao seu arquivo de configuração do shell (`~/.bashrc` ou `~/.zshrc`) para torná-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ê deseja exibir seu diretório atual no título da guia do terminal, adicione o seguinte trecho ao seu `~/.bashrc` ou `~/.zshrc`:
```bash
function set_win_title(){
@@ -104,7 +106,7 @@ function set_win_title(){
starship_precmd_user_func="set_win_title"
```
-For Cmd, you can change the window title using the `starship_preprompt_user_func` function.
+Para Cmd, você pode alterar o título da janela usando a função `starship_preprompt_user_func`.
```lua
function starship_preprompt_user_func(prompt)
@@ -114,88 +116,88 @@ end
load(io.popen('starship init cmd'):read("*a"))()
```
-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
+# editar $PROFILE
function Invoke-Starship-PreCommand {
- $host.ui.Write("`e]0; PS> $env:USERNAME@$env:COMPUTERNAME`: $pwd `a")
+ $host.ui.Write("`e]0; PS> $env:USERNAME@$env:COMPUTERNAME`: $pwd `a")
}
-Invoke-Expression (&starship init powershell)
+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 direito que é renderizado na mesma linha que a entrada. Starship pode definir o conteúdo do prompt correto usando a opção `right_format`. Qualquer módulo que pode ser usado no `format` também é compatível com `right_format`. A variável `$all` conterá apenas módulos não usado explicitamente em `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 única linha após 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, xonsh, cmd.
+`right_format` é atualmente compatível com os seguintes shells: elvish, fish, zsh, xonsh, cmd.
### Exemplo
```toml
# ~/.config/starship.toml
-# A minimal left prompt
+# Um prompt mínimo à esquerda
format = """$character"""
-# move the rest of the prompt to the right
+# movw o restante do prompt para a direita
right_format = """$all"""
```
-Produces a prompt like the following:
+Produz um prompt como o seguinte:
```
▶ starship on  rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s
```
-## Continuation Prompt
+## Prompt de Continuação
-Some shells support a continuation prompt along with the normal prompt. This prompt is rendered instead of the normal prompt when the user has entered an incomplete statement (such as a single left parenthesis or quote).
+Alguns shells suportam um prompt de continuação junto com o prompt normal. Esse prompt é renderizado em vez do prompt normal quando o usuário insere uma instrução incompleta (como um único parêntese esquerdo ou aspas).
-Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`.
+Starship pode definir o prompt de continuação usando a opção `continuation_prompt`. O prompt padrão é `"[∙](bright-black) "`.
-Note: `continuation_prompt` should be set to a literal string without any variables.
+Nota: `continuation_prompt` deve ser definido como uma string literal sem nenhuma variável.
-Note: Continuation prompts are only available in the following shells:
+Nota: os prompts de continuação estão disponíveis apenas nos seguintes shells:
- - `bash`
- - `zsh`
- - `PowerShell`
+- `bash`
+- `zsh`
+- `PowerShell`
### Exemplo
```toml
# ~/.config/starship.toml
-# A continuation prompt that displays two filled in arrows
+# Um prompt de continuação que exibe duas setas preenchidas
continuation_prompt = "▶▶"
```
## 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:
+As strings de estilo são uma lista de palavras, separadas por espaços em branco. As palavras não diferenciam maiúsculas de minúsculas (ou seja, `bold` e `BoLd` são considerados a mesma string). Cada palavra pode ser uma das seguintes:
- - `bold`
- - `italic`
- - `underline`
- - `dimmed`
- - `inverted`
- - `bg:<color>`
- - `fg:<color>`
- - `<color>`
- - `none`
+- `bold`
+- `italic`
+- `underline`
+- `dimmed`
+- `inverted`
+- `bg:<color>`
+- `fg:<color>`
+- `<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>` é um especificador de cor (discutido abaixo). `fg:<color>` e `<color>` atualmente fazem a mesma coisa, embora isso possa mudar no futuro. `inverted` troca as cores de fundo e primeiro plano. A ordem das 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 em uma string se não fizer parte de um especificador `bg:`, de modo que, ex., `fg:red none fg:blue` ainda criará uma string sem estilo. `bg:none` define o plano de fundo para a cor padrão para que `fg:red bg:none` seja equivalente a `red` ou `fg:red` e `bg:green fg:red bg:none` também é equivalente a `fg:red` ou `red`. Pode ser um erro usar `none` em conjunto com outros tokens no futuro.
-A color specifier can be one of the following:
+Um especificador de cor pode ser um dos seguintes:
- - One of the standard terminal colors: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these with `bright-` to get the bright version (e.g. `bright-white`).
- - A `#` followed by a six-digit hexadecimal number. This specifies an [RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp).
- - A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png).
+- Uma das cores padrão do terminal: `black`, `red`, `green`, `blue`, `yellow`, `purple`, `cyan`, `white`. Você pode, opcionalmente, prefixar esses com `bright-` para obter a versão brilhante/clara (por exemplo, `bright-white`).
+- Um `#` seguido por um número hexadecimal de seis dígitos. Especifica um [Código hexadecimal de cor RGB](https://www.w3schools.com/colors/colors_hexadecimal.asp).
+- Um número entre 0-255. Especifica um [Código de cores ANSI de 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 várias cores forem especificadas para primeiro plano/plano de fundo, a última na string terá prioridade.