diff options
Diffstat (limited to 'docs')
38 files changed, 5739 insertions, 31 deletions
diff --git a/docs/ar-SA/config/README.md b/docs/ar-SA/config/README.md index 40b5598d6..87ccb80b3 100644 --- a/docs/ar-SA/config/README.md +++ b/docs/ar-SA/config/README.md @@ -534,7 +534,7 @@ The `buf` module shows the currently installed version of [Buf](https://buf.buil | ------------------- | ----------------------------------------------- | ----------------------------------------------------- | | `format` | `'with [$symbol($version )]($style)'` | The format for the `buf` module. | | `version_format` | `'v${raw}'` | The version format. | -| `symbol` | `'🦬 '` | The symbol used before displaying the version of Buf. | +| `symbol` | `'🐃 '` | The symbol used before displaying the version of Buf. | | `detect_extensions` | `[]` | Which extensions should trigger this module. | | `detect_files` | `['buf.yaml', 'buf.gen.yaml', 'buf.work.yaml']` | Which filenames should trigger this module. | | `detect_folders` | `[]` | Which folders should trigger this modules. | diff --git a/docs/ckb-IR/config/README.md b/docs/ckb-IR/config/README.md index dcc6c1c40..9ef5e91ef 100644 --- a/docs/ckb-IR/config/README.md +++ b/docs/ckb-IR/config/README.md @@ -534,7 +534,7 @@ The `buf` module shows the currently installed version of [Buf](https://buf.buil | ------------------- | ----------------------------------------------- | ----------------------------------------------------- | | `format` | `'with [$symbol($version )]($style)'` | The format for the `buf` module. | | `version_format` | `'v${raw}'` | The version format. | -| `symbol` | `'🦬 '` | The symbol used before displaying the version of Buf. | +| `symbol` | `'🐃 '` | The symbol used before displaying the version of Buf. | | `detect_extensions` | `[]` | Which extensions should trigger this module. | | `detect_files` | `['buf.yaml', 'buf.gen.yaml', 'buf.work.yaml']` | Which filenames should trigger this module. | | `detect_folders` | `[]` | Which folders should trigger this modules. | diff --git a/docs/de-DE/config/README.md b/docs/de-DE/config/README.md index e1ad49c02..4dae32b0d 100644 --- a/docs/de-DE/config/README.md +++ b/docs/de-DE/config/README.md @@ -534,7 +534,7 @@ The `buf` module shows the currently installed version of [Buf](https://buf.buil | ------------------- | ----------------------------------------------- | ----------------------------------------------------- | | `format` | `'with [$symbol($version )]($style)'` | The format for the `buf` module. | | `version_format` | `'v${raw}'` | The version format. | -| `symbol` | `'🦬 '` | The symbol used before displaying the version of Buf. | +| `symbol` | `'🐃 '` | The symbol used before displaying the version of Buf. | | `detect_extensions` | `[]` | Which extensions should trigger this module. | | `detect_files` | `['buf.yaml', 'buf.gen.yaml', 'buf.work.yaml']` | Which filenames should trigger this module. | | `detect_folders` | `[]` | Which folders should trigger this modules. | diff --git a/docs/es-ES/config/README.md b/docs/es-ES/config/README.md index 65d08938b..113d1ff31 100644 --- a/docs/es-ES/config/README.md +++ b/docs/es-ES/config/README.md @@ -534,7 +534,7 @@ El módulo `buf` muestra la versión instalada de [Buf](https://buf.build). Por | ------------------- | ----------------------------------------------- | ---------------------------------------------------- | | `format` | `'with [$symbol($version )]($style)'` | El formato para el módulo `buf`. | | `version_format` | `'v${raw}'` | El formato de versión. | -| `symbol` | `'🦬 '` | El símbolo usado antes de mostrar la versión de Buf. | +| `symbol` | `'🐃 '` | El símbolo usado antes de mostrar la versión de Buf. | | `detect_extensions` | `[]` | Qué extensiones deberían activar este módulo. | | `detect_files` | `['buf.yaml', 'buf.gen.yaml', 'buf.work.yaml']` | Qué nombres de archivo deberían activar este módulo. | | `detect_folders` | `[]` | Qué carpetas deberían activar estos módulos. | diff --git a/docs/fr-FR/config/README.md b/docs/fr-FR/config/README.md index 30ad1c437..c307f9c0f 100644 --- a/docs/fr-FR/config/README.md +++ b/docs/fr-FR/config/README.md @@ -534,7 +534,7 @@ Le module `buf` affiche la version de [Buf](https://buf.build) installée. Par d | ------------------------------------ | ----------------------------------------------- | ------------------------------------------------------ | | `format` | `'with [$symbol($version )]($style)'` | Le format du module `buf`. | | `version_format` | `'v${raw}'` | Le format de la version. | -| `symbol` | `'🦬 '` | Le symbole utilisé avant d’afficher la version de Buf. | +| `symbol` | `'🐃 '` | Le symbole utilisé avant d’afficher la version de Buf. | | `detect_extensionsdetect_extensions` | `[]` | Les extensions qui déclenchent ce module. | | `detect_files` | `['buf.yaml', 'buf.gen.yaml', 'buf.work.yaml']` | Les fichiers qui activent ce module. | | `detect_folders` | `[]` | Quels dossiers devraient activer ce module. | diff --git a/docs/id-ID/config/README.md b/docs/id-ID/config/README.md index 626f61c66..ddb995926 100644 --- a/docs/id-ID/config/README.md +++ b/docs/id-ID/config/README.md @@ -534,7 +534,7 @@ The `buf` module shows the currently installed version of [Buf](https://buf.buil | ------------------- | ----------------------------------------------- | ----------------------------------------------------- | | `fromat` | `'with [$symbol($version )]($style)'` | The format for the `buf` module. | | `version_format` | `'v${raw}'` | Format dari versi. | -| `symbol` | `'🦬 '` | The symbol used before displaying the version of Buf. | +| `symbol` | `'🐃 '` | The symbol used before displaying the version of Buf. | | `detect_extensions` | `[]` | Ekstensi mana yang sebaiknya memicu modul ini. | | `detect_files` | `['buf.yaml', 'buf.gen.yaml', 'buf.work.yaml']` | filenames mana yang sebaiknya memicu modul ini. | | `detect_folders` | `[]` | Folder mana yang sebaiknya memicul modul ini. | diff --git a/docs/it-IT/config/README.md b/docs/it-IT/config/README.md index 68940af4e..0b4c7d38e 100644 --- a/docs/it-IT/config/README.md +++ b/docs/it-IT/config/README.md @@ -534,7 +534,7 @@ The `buf` module shows the currently installed version of [Buf](https://buf.buil | ------------------- | ----------------------------------------------- | ----------------------------------------------------- | | `format` | `'with [$symbol($version )]($style)'` | The format for the `buf` module. | | `version_format` | `'v${raw}'` | Il formato della versione. | -| `symbol` | `'🦬 '` | The symbol used before displaying the version of Buf. | +| `symbol` | `'🐃 '` | The symbol used before displaying the version of Buf. | | `detect_extensions` | `[]` | Quali estensioni dovrebbero attivare questo modulo. | | `detect_files` | `['buf.yaml', 'buf.gen.yaml', 'buf.work.yaml']` | Quali nomi di file dovrebbero attivare questo modulo. | | `detect_folders` | `[]` | Which folders should trigger this modules. | diff --git a/docs/ja-JP/config/README.md b/docs/ja-JP/config/README.md index 05df16c0e..12342cda2 100644 --- a/docs/ja-JP/config/README.md +++ b/docs/ja-JP/config/README.md @@ -534,7 +534,7 @@ discharging_symbol = '💦' | ------------------- | ----------------------------------------------- | -------------------------- | | `format` | `'with [$symbol($version )]($style)'` | `buf`モジュールの形式。 | | `version_format` | `'v${raw}'` | バージョンのフォーマット。 | -| `symbol` | `'🦬 '` | Bufのバージョンを表示する前に使用される記号です。 | +| `symbol` | `'🐃 '` | Bufのバージョンを表示する前に使用される記号です。 | | `detect_extensions` | `[]` | どの拡張子がこのモジュールをアクティブにするか | | `detect_files` | `['buf.yaml', 'buf.gen.yaml', 'buf.work.yaml']` | どのファイル名がこのモジュールをアクティブにするか | | `detect_folders` | `[]` | どのフォルダーがこのモジュールをアクティブにするか | diff --git a/docs/ko-KR/config/README.md b/docs/ko-KR/config/README.md index 63a5e67b7..95bd8201a 100644 --- a/docs/ko-KR/config/README.md +++ b/docs/ko-KR/config/README.md @@ -534,7 +534,7 @@ The `buf` module shows the currently installed version of [Buf](https://buf.buil | ------------------- | ----------------------------------------------- | ----------------------------------------------------- | | `format` | `'with [$symbol($version )]($style)'` | The format for the `buf` module. | | `version_format` | `'v${raw}'` | The version format. | -| `symbol` | `'🦬 '` | The symbol used before displaying the version of Buf. | +| `symbol` | `'🐃 '` | The symbol used before displaying the version of Buf. | | `detect_extensions` | `[]` | Which extensions should trigger this module. | | `detect_files` | `['buf.yaml', 'buf.gen.yaml', 'buf.work.yaml']` | Which filenames should trigger this module. | | `detect_folders` | `[]` | Which folders should trigger this modules. | diff --git a/docs/nl-NL/config/README.md b/docs/nl-NL/config/README.md index 63a5e67b7..95bd8201a 100644 --- a/docs/nl-NL/config/README.md +++ b/docs/nl-NL/config/README.md @@ -534,7 +534,7 @@ The `buf` module shows the currently installed version of [Buf](https://buf.buil | ------------------- | ----------------------------------------------- | ----------------------------------------------------- | | `format` | `'with [$symbol($version )]($style)'` | The format for the `buf` module. | | `version_format` | `'v${raw}'` | The version format. | -| `symbol` | `'🦬 '` | The symbol used before displaying the version of Buf. | +| `symbol` | `'🐃 '` | The symbol used before displaying the version of Buf. | | `detect_extensions` | `[]` | Which extensions should trigger this module. | | `detect_files` | `['buf.yaml', 'buf.gen.yaml', 'buf.work.yaml']` | Which filenames should trigger this module. | | `detect_folders` | `[]` | Which folders should trigger this modules. | diff --git a/docs/no-NO/README.md b/docs/no-NO/README.md new file mode 100644 index 000000000..c6ecdcd04 --- /dev/null +++ b/docs/no-NO/README.md @@ -0,0 +1,187 @@ +--- +home: true +heroImage: /logo.svg +heroText: +tagline: The minimal, blazing-fast, and infinitely customizable prompt for any shell! +actionText: Get Started → +actionLink: ./guide/ +features: + - + title: Compatibility First + details: Works on the most common shells on the most common operating systems. Use it everywhere! + - + title: Rust-Powered + details: Brings the best-in-class speed and safety of Rust, to make your prompt as quick and reliable as possible. + - + title: Customizable + details: Every little detail is customizable to your liking, to make this prompt as minimal or feature-rich as you'd like it to be. +footer: ISC Licensed | Copyright © 2019-present Starship Contributors +#Used for the description meta tag, for SEO +metaTitle: "Starship: Cross-Shell Prompt" +description: Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and PowerShell. +--- + +<div class="center"> + <video class="demo-video" muted autoplay loop playsinline> + <source src="/demo.webm" type="video/webm"> + <source src="/demo.mp4" type="video/mp4"> + </video> +</div> + +### Prerequisites + +- A [Nerd Font](https://www.nerdfonts.com/) installed and enabled in your terminal. + +### Quick Install + +1. Install the **starship** binary: + + + #### Install Latest Version + + With Shell: + + ```sh + curl -sS https://starship.rs/install.sh | sh + ``` + + To update the Starship itself, rerun the above script. It will replace the current version without touching Starship's configuration. + + + #### Install via Package Manager + + With [Homebrew](https://brew.sh/): + + ```sh + brew install starship + ``` + With [Winget](https://github.com/microsoft/winget-cli): + + ```powershell + winget install starship + ``` + +1. Add the init script to your shell's config file: + + + #### Bash + + Add the following to the end of `~/.bashrc`: + + ```sh + # ~/.bashrc + + eval "$(starship init bash)" + ``` + + + #### Fish + + Add the following to the end of `~/.config/fish/config.fish`: + + ```sh + # ~/.config/fish/config.fish + + starship init fish | source + ``` + + + #### Zsh + + Add the following to the end of `~/.zshrc`: + + ```sh + # ~/.zshrc + + eval "$(starship init zsh)" + ``` + + + #### Powershell + + Add the following to the end of `Microsoft.PowerShell_profile.ps1`. You can check the location of this file by querying the `$PROFILE` variable in PowerShell. Typically the path is `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1` or `~/.config/powershell/Microsoft.PowerShell_profile.ps1` on -Nix. + + ```sh + Invoke-Expression (&starship init powershell) + ``` + + + #### Ion + + Add the following to the end of `~/.config/ion/initrc`: + + ```sh + # ~/.config/ion/initrc + + eval $(starship init ion) + ``` + + + #### Elvish + + ::: warning + + Only elvish v0.18 or higher is supported. + + ::: + + Add the following to the end of `~/.elvish/rc.elv`: + + ```sh + # ~/.elvish/rc.elv + + eval (starship init elvish) + ``` + + + #### Tcsh + + Add the following to the end of `~/.tcshrc`: + + ```sh + # ~/.tcshrc + + eval `starship init tcsh` + ``` + + + #### Nushell + + ::: warning + + This will change in the future. Only Nushell v0.61+ is supported. + + ::: + + Add the following to to the end of your Nushell env file (find it by running `$nu.env-path` in Nushell): + ```sh + mkdir ~/.cache/starship + starship init nu | save ~/.cache/starship/init.nu + ``` + + And add the following to the end of your Nushell configuration (find it by running `$nu.config-path`): + + ```sh + source ~/.cache/starship/init.nu + ``` + + #### Xonsh + + Add the following to the end of `~/.xonshrc`: + + ```sh + # ~/.xonshrc + + execx($(starship init xonsh)) + ``` + + + #### Cmd + + You need to use [Clink](https://chrisant996.github.io/clink/clink.html) (v1.2.30+) with Cmd. Add the following to a file `starship.lua` and place this file in Clink scripts directory: + + ```lua + -- starship.lua + + load(io.popen('starship init cmd'):read("*a"))() + ``` diff --git a/docs/no-NO/advanced-config/README.md b/docs/no-NO/advanced-config/README.md new file mode 100644 index 000000000..9a8b0fffa --- /dev/null +++ b/docs/no-NO/advanced-config/README.md @@ -0,0 +1,286 @@ +# Advanced Configuration + +While Starship is a versatile shell, sometimes you need to do more than edit `starship.toml` to get it to do certain things. This page details some of the more advanced configuration techniques used in starship. + +::: warning + +The configurations in this section are subject to change in future releases of Starship. + +::: + +## TransientPrompt in PowerShell + +It is possible to replace the previous-printed prompt with a custom string. This is useful in cases where all the prompt information is not always needed. To enable this, run `Enable-TransientPrompt` in the shell session. To make it permanent, put this statement in your `$PROFILE`. Transience can be disabled on-the-fly with `Disable-TransientPrompt`. + +By default, the left side of input gets replaced with `>`. To customize this, define a new function called `Invoke-Starship-TransientFunction`. For example, to display Starship's `character` module here, you would do + +```powershell +function Invoke-Starship-TransientFunction { + &starship module character +} + +Invoke-Expression (&starship init powershell) + +Enable-TransientPrompt +``` + +## TransientPrompt and TransientRightPrompt in Cmd + +Clink allows you to replace the previous-printed prompt with custom strings. This is useful in cases where all the prompt information is not always needed. To enable this, run `clink set prompt.transient <value>` where \<value\> can be one of: + +- `always`: always replace the previous prompt +- `same_dir`: replace the previous prompt only if the working directory is same +- `off`: do not replace the prompt (i.e. turn off transience) + +You need to do this only once. Make the following changes to your `starship.lua` to customize what gets displayed on the left and on the right: + +- By default, the left side of input gets replaced with `>`. To customize this, define a new function called `starship_transient_prompt_func`. This function receives the current prompt as a string that you can utilize. For example, to display Starship's `character` module here, you would do + +```lua +function starship_transient_prompt_func(prompt) + return io.popen("starship module character" + .." --keymap="..rl.getvariable('keymap') + ):read("*a") +end +load(io.popen('starship init cmd'):read("*a"))() +``` + +- By default, the right side of input is empty. To customize this, define a new function called `starship_transient_rprompt_func`. This function receives the current prompt as a string that you can utilize. For example, to display the time at which the last command was started here, you would do + +```lua +function starship_transient_rprompt_func(prompt) + return io.popen("starship module time"):read("*a") +end +load(io.popen('starship init cmd'):read("*a"))() +``` + +## TransientPrompt and TransientRightPrompt in Fish + +It is possible to replace the previous-printed prompt with a custom string. This is useful in cases where all the prompt information is not always needed. To enable this, run `enable_transience` in the shell session. To make it permanent, put this statement in your `~/.config/fish/config.fish`. Transience can be disabled on-the-fly with `disable_transience`. + +Note that in case of Fish, the transient prompt is only printed if the commandline is non-empty, and syntactically correct. + +- By default, the left side of input gets replaced with a bold-green `❯`. To customize this, define a new function called `starship_transient_prompt_func`. For example, to display Starship's `character` module here, you would do + +```fish +function starship_transient_prompt_func + starship module character +end +starship init fish | source +enable_transience +``` + +- By default, the right side of input is empty. To customize this, define a new function called `starship_transient_rprompt_func`. For example, to display the time at which the last command was started here, you would do + +```fish +function starship_transient_rprompt_func + starship module time +end +starship init fish | source +enable_transience +``` + +## Custom pre-prompt and pre-execution Commands in 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: + +- 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 + +```lua +function starship_preprompt_user_func(prompt) + print("🚀") +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 + +```lua +function starship_precmd_user_func(line) + print("Executing: "..line) +end + +load(io.popen('starship init cmd'):read("*a"))() +``` + +## Custom pre-prompt and pre-execution Commands in Bash + +Bash does not have a formal preexec/precmd framework like most other shells. Because of this, it is difficult to provide fully customizable hooks in `bash`. However, Starship does give you limited ability to insert your own functions into the prompt-rendering procedure: + +- 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 + +```bash +function blastoff(){ + echo "🚀" +} +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. + +```bash +function blastoff(){ + echo "🚀" +} +trap blastoff DEBUG # Trap DEBUG *before* running starship +set -o functrace +eval $(starship init bash) +set +o functrace +``` + +## Custom pre-prompt and pre-execution Commands in 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`. However, Starship does give you limited ability to insert your own functions into the prompt-rendering procedure: + +Create a function named `Invoke-Starship-PreCommand` + +```powershell +function Invoke-Starship-PreCommand { + $host.ui.Write("🚀") +} +``` + +## Change Window Title + +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`. + +First, define a window title change function (identical in bash and zsh): + +```bash +function set_win_title(){ + echo -ne "\033]0; YOUR_WINDOW_TITLE_HERE \007" +} +``` + +You can use variables to customize this title (`$USER`, `$HOSTNAME`, and `$PWD` are popular choices). + +In `bash`, set this function to be the precmd starship function: + +```bash +starship_precmd_user_func="set_win_title" +``` + +In `zsh`, add this to the `precmd_functions` array: + +```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. + +For example, if you want to display your current directory in your terminal tab title, add the following snippet to your `~/.bashrc` or `~/.zshrc`: + +```bash +function set_win_title(){ + echo -ne "\033]0; $(basename "$PWD") \007" +} +starship_precmd_user_func="set_win_title" +``` + +For Cmd, you can change the window title using the `starship_preprompt_user_func` function. + +```lua +function starship_preprompt_user_func(prompt) + console.settitle(os.getenv('USERNAME').."@"..os.getenv('COMPUTERNAME')..": "..os.getcwd()) +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`. + +```powershell +# edit $PROFILE +function Invoke-Starship-PreCommand { + $host.ui.Write("`e]0; PS> $env:USERNAME@$env:COMPUTERNAME`: $pwd `a") +} + +Invoke-Expression (&starship init powershell) +``` + +## Enable Right Prompt + +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`. + +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). + +`right_format` is currently supported for the following shells: elvish, fish, zsh, xonsh, cmd, nushell. + +Note: Nushell 0.71.0 or later is required + +### Example + +```toml +# ~/.config/starship.toml + +# A minimal left prompt +format = """$character""" + +# move the rest of the prompt to the right +right_format = """$all""" +``` + +Produces a prompt like the following: + +``` +▶ starship on rprompt [!] is 📦 v0.57.0 via 🦀 v1.54.0 took 17s +``` + +## Continuation Prompt + +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). + +Starship can set the continuation prompt using the `continuation_prompt` option. The default prompt is `"[∙](bright-black) "`. + +Note: `continuation_prompt` should be set to a literal string without any variables. + +Note: Continuation prompts are only available in the following shells: + +- `bash` +- `zsh` +- `PowerShell` + +### Example + +```toml +# ~/.config/starship.toml + +# A continuation prompt that displays two filled in arrows +continuation_prompt = "▶▶" +``` + +## Style Strings + +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: + +- `bold` +- `italic` +- `underline` +- `dimmed` +- `inverted` +- `blink` +- `hidden` +- `strikethrough` +- `bg:<color>` +- `fg:<color>` +- `<color>` +- `none` + +whe |