From 0cd9a9ef52db4572668a91597e25adb6a83b4c29 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Mon, 20 May 2024 13:45:42 +0200 Subject: [PATCH] chore(starship): improve configuration notes --- examples/dotfiles/.config/starship.toml | 19 +++++++++ knowledge base/starship.md | 52 ++++++++++++++++++------- 2 files changed, 57 insertions(+), 14 deletions(-) create mode 100644 examples/dotfiles/.config/starship.toml diff --git a/examples/dotfiles/.config/starship.toml b/examples/dotfiles/.config/starship.toml new file mode 100644 index 0000000..c98a758 --- /dev/null +++ b/examples/dotfiles/.config/starship.toml @@ -0,0 +1,19 @@ +################################################################################ +## ~/.config/starship.toml +## +## Starship's user configuration file. +## +## Sources: +## - https://starship.rs/config/ +################################################################################ + +# Get editor completions based on the config schema. +"$schema" = 'https://starship.rs/config-schema.json' + +# Allow longer-running commands to keep executing. +command_timeout = 750 + +# Replace the default '❯' symbol in the prompt with '$'. +[character] +success_symbol = '[\$](bold green)' +error_symbol = '[\$](bold red)' diff --git a/knowledge base/starship.md b/knowledge base/starship.md index eba8ef9..d7ac8e8 100644 --- a/knowledge base/starship.md +++ b/knowledge base/starship.md @@ -5,10 +5,12 @@ Fast and customizable prompt for most shells. 1. [TL;DR](#tldr) 1. [Configuration](#configuration) 1. [Further readings](#further-readings) -1. [Sources](#sources) ## TL;DR +
+ Installation and configuration + ```sh # Installation. brew install 'starship' @@ -16,48 +18,72 @@ zypper in 'starship' # Start when the shell starts. eval "$(starship init bash)" | tee -a ~'/.bashrc' -echo 'starship init fish | source' | tee -a ~'/.config/fish/config.fish' eval "$(starship init zsh)" | tee -a ~'/.zshrc' +echo 'starship init fish | source' | tee -a ~'/.config/fish/config.fish' # Initialize starship configuration. mkdir -p ~'/.config' && touch ~'/.config/starship.toml' +# Change configuration. +starship config +vim ~'/.config/starship.toml' + +# Print the whole configuration. +starship print-config +cat ~'/.config/starship.toml' +``` + +
+
+ Usage + +```sh # List available presets (prompt styles). starship preset -l ``` +
+ ## Configuration ```sh +# Change configuration. +starship config +vim ~'/.config/starship.toml' + +# Print the whole configuration. +starship print-config +cat ~'/.config/starship.toml' +``` + +```toml # ~/.config/starship.toml # Get editor completions based on the config schema. "$schema" = 'https://starship.rs/config-schema.json' +command_timeout = 750 # Replace the default '❯' symbol in the prompt with '$'. # The '$' character needs to be escaped. [character] success_symbol = '[\$](bold green)' +error_symbol = '[\$](bold red)' ``` ## Further readings - [Website] -- [Nerd fonts] - -## Sources - -All the references in the [further readings] section, plus the following: - - [Github] +- [Nerd fonts] +- [Bash] +- [Zsh] +- [Fish] - -[further readings]: #further-readings - [bash]: bash.md [fish]: fish.md @@ -68,5 +94,3 @@ All the references in the [further readings] section, plus the following: [github]: https://github.com/starship/starship [website]: https://starship.rs/ - -