From 0965667807e4af5606a1412c14435482c5b7d2b7 Mon Sep 17 00:00:00 2001 From: Kevin Song <4605384+chipbuster@users.noreply.github.com> Date: Thu, 20 Jan 2022 02:32:09 -0600 Subject: [PATCH] ci: Use `dprint` to format documentation + TOML files (#3426) Adds Rust-based standardized markdown formatting and a CI step to catch unformatted files. --- .cargo/audit.toml | 24 +- .dprint.json | 43 ++ .github/workflows/format-workflow.yml | 17 + CODE_OF_CONDUCT.md | 27 +- CONTRIBUTING.md | 19 +- Cargo.toml | 92 ++- README.md | 6 +- clippy.toml | 8 +- docs/.vuepress/config.js | 682 ++++++++++---------- docs/README.md | 6 +- docs/advanced-config/README.md | 38 +- docs/config/README.md | 759 +++++++++++------------ docs/faq/README.md | 3 +- docs/installing/README.md | 2 +- docs/migrating-to-0.45.0/README.md | 2 +- starship_module_config_derive/Cargo.toml | 16 +- 16 files changed, 907 insertions(+), 837 deletions(-) create mode 100644 .dprint.json create mode 100644 .github/workflows/format-workflow.yml diff --git a/.cargo/audit.toml b/.cargo/audit.toml index 62d130215..4c8efaa15 100644 --- a/.cargo/audit.toml +++ b/.cargo/audit.toml @@ -1,14 +1,14 @@ [advisories] ignore = [ - # Out-of-bounds write in nix::unistd::getgrouplist - # Tracked in #3140 - "RUSTSEC-2021-0119", - # Potential segfault in the time crate - # chrono dependency, but vulnerable function is never called - # Tacked in #3163 - "RUSTSEC-2020-0071", - # chrono: Potential segfault in localtime_r invocations - # starship avoids setting any environment variables to avoid this issue - # Tracked in #3166 - "RUSTSEC-2020-0159", -] \ No newline at end of file + # Out-of-bounds write in nix::unistd::getgrouplist + # Tracked in #3140 + "RUSTSEC-2021-0119", + # Potential segfault in the time crate + # chrono dependency, but vulnerable function is never called + # Tacked in #3163 + "RUSTSEC-2020-0071", + # chrono: Potential segfault in localtime_r invocations + # starship avoids setting any environment variables to avoid this issue + # Tracked in #3166 + "RUSTSEC-2020-0159", +] diff --git a/.dprint.json b/.dprint.json new file mode 100644 index 000000000..3e2606307 --- /dev/null +++ b/.dprint.json @@ -0,0 +1,43 @@ +{ + "incremental": true, + "typescript": {}, + "json": {}, + "markdown": { + "lineWidth": 100 + }, + "toml": {}, + "includes": [ + "docs/**/*.{ts,js,cjs,mjs}", + "**/*.{md,toml,json}" + ], + "excludes": [ + "**/node_modules", + "**/*-lock.json", + ".github/*", + "docs/ar-SA/**", + "docs/ckb-IR/**", + "docs/de-DE/**", + "docs/es-ES/**", + "docs/fr-FR/**", + "docs/id-ID/**", + "docs/it-IT/**", + "docs/ja-JP/**", + "docs/ko-KR/**", + "docs/nl-NL/**", + "docs/pl-PL/**", + "docs/pt-BR/**", + "docs/pt-PT/**", + "docs/ru-RU/**", + "docs/tr-TR/**", + "docs/vi-VN/**", + "docs/zh-CN/**", + "docs/zh-TW/**", + "target/" + ], + "plugins": [ + "https://plugins.dprint.dev/typescript-0.62.0.wasm", + "https://plugins.dprint.dev/json-0.14.0.wasm", + "https://plugins.dprint.dev/markdown-0.12.0.wasm", + "https://plugins.dprint.dev/toml-0.5.3.wasm" + ] +} diff --git a/.github/workflows/format-workflow.yml b/.github/workflows/format-workflow.yml new file mode 100644 index 000000000..08336e12e --- /dev/null +++ b/.github/workflows/format-workflow.yml @@ -0,0 +1,17 @@ +name: Format + Docs Workflow +on: + push: + paths: ["docs/**","**.md","**.toml","**.js","**.json","**.ts"] + pull_request: + paths: ["docs/**","**.md","**.toml","**.js","**.json","**.ts"] + +jobs: + # Run the dprint code formatter for documentation + dprint: + name: Dprint [Docs Formatter] + runs-on: ubuntu-latest + steps: + - name: Setup | Checkout + uses: actions/checkout@v2.4.0 + - name: Docs | Format + uses: dprint/check@v2.0 \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 69646459f..0fc30f1ab 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,4 +1,3 @@ - # Contributor Covenant Code of Conduct ## Our Pledge @@ -18,23 +17,23 @@ diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -* Focusing on what is best not just for us as individuals, but for the +- Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or +- The use of sexualized language or imagery, and sexual attention or advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities @@ -107,7 +106,7 @@ Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an +standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within @@ -119,11 +118,11 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. -Community Impact Guidelines were inspired by +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. [homepage]: https://www.contributor-covenant.org diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1873ccfa2..710342e1a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -95,13 +95,24 @@ cargo clippy --all-targets --all-features ## Formatting -Starship source files are formatted with [rustfmt](https://crates.io/crates/rustfmt-nightly), using the default configuration. Rustfmt will be ran as part of CI. Unformatted code will fail a build, so it is suggested that you run rustfmt locally: +Starship source files are formatted with [rustfmt](https://crates.io/crates/rustfmt-nightly). Markdown and TOML files (among others) are formatted with [dprint](https://github.com/dprint/dprint). Unformatted code will fail the CI, so it is suggested that you run these tools locally. + +For rustfmt: ```sh rustup component add rustfmt cargo fmt ``` +For dprint: + +```sh +cargo install dprint +dprint fmt +``` + +Editor plugins/functionality may help you run these automatically so that you don't accidentally create a PR that fails. + ## Testing Testing is critical to making sure starship works as intended on systems big and small. Starship interfaces with many applications and system APIs when generating the prompt, so there's a lot of room for bugs to slip in. @@ -233,10 +244,10 @@ writing new modules low, starship provides a lot of functionality for a module, which requires quite a few things be done. These are listed here to help everyone remember what they are. Don't worry: most of them are quite simple! -- [ ] Add a section to `docs/config/README.md` describing the module, and +- [ ] Add a section to `docs/config/README.md` describing the module, and its configuration options/variables (more documentation is often appropriate--this is a bare minimum). -- [ ] Add the variable to the appropriate location in the "Default Prompt +- [ ] Add the variable to the appropriate location in the "Default Prompt Format" section of the documentation - [ ] Add an appropriate choice of options to each preset in `docs/presets/README.md` - [ ] Create configs structs/traits in `src/configs/.rs` and add the @@ -250,4 +261,4 @@ everyone remember what they are. Don't worry: most of them are quite simple! Finally, you should make sure to write your module's code in `src/modules` and add any commands that need to be mocked when testing in `src/utils.rs`. -Command output can also be mocked in test by using `ModuleRenderer::cmd`. \ No newline at end of file +Command output can also be mocked in test by using `ModuleRenderer::cmd`. diff --git a/Cargo.toml b/Cargo.toml index 05eb8ab2a..9e9b2b930 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,21 +1,21 @@ [package] name = "starship" version = "1.2.1" -edition = "2021" authors = ["Starship Contributors"] -homepage = "https://starship.rs" -documentation = "https://starship.rs/guide/" -repository = "https://github.com/starship/starship" -readme = "README.md" -license = "ISC" -keywords = ["prompt", "shell", "bash", "fish", "zsh"] -categories = ["command-line-utilities"] build = "build.rs" +categories = ["command-line-utilities"] +documentation = "https://starship.rs/guide/" +edition = "2021" +homepage = "https://starship.rs" +# Keep `/` in front of `README.md` to exclude localized readmes +include = ["src/**/*", "build.rs", "Cross.toml", "LICENSE", "README.md"] +keywords = ["prompt", "shell", "bash", "fish", "zsh"] +license = "ISC" +readme = "README.md" +repository = "https://github.com/starship/starship" description = """ The minimal, blazing-fast, and infinitely customizable prompt for any shell! ☄🌌️ """ -# Keep `/` in front of `README.md` to exclude localized readmes -include = ["src/**/*", "build.rs", "Cross.toml", "LICENSE", "README.md"] [badges] is-it-maintained-issue-resolution = { repository = "starship/starship" } @@ -27,61 +27,55 @@ default = ["battery"] battery = ["starship-battery"] [dependencies] +ansi_term = "0.12.1" +byte-unit = "4.0.13" +chrono = "0.4.19" clap = { version = "3.0.10", features = ["derive", "cargo", "unicode"] } clap_complete = "3.0.4" -ansi_term = "0.12.1" directories-next = "2.0.0" +gethostname = "0.2.2" git2 = { version = "0.13.25", default-features = false } -toml = { version = "0.5.8", features = ["preserve_order"] } -rust-ini = "0.17.0" -serde_json = "1.0.75" -rayon = "1.5.1" +indexmap = { version = "1.8.0", features = ["serde"] } log = { version = "0.4.14", features = ["std"] } +notify-rust = { version = "4.5.5", optional = true } +once_cell = "1.9.0" +open = "2.0.2" +os_info = "3.1.0" +path-slash = "0.1.4" +pest = "2.1.3" +pest_derive = "2.1.0" +quick-xml = "0.22.0" +rand = "0.8.4" +rayon = "1.5.1" +regex = "1.5.4" +rust-ini = "0.17.0" +semver = "1.0.4" +serde = { version = "1.0.133", features = ["derive"] } +serde_json = "1.0.75" +sha-1 = "0.10.0" +shadow-rs = "0.8.1" # battery is optional (on by default) because the crate doesn't currently build for Termux # see: https://github.com/svartalf/rust-battery/issues/33 starship-battery = { version = "0.7.9", optional = true } -path-slash = "0.1.4" -unicode-segmentation = "1.8.0" -gethostname = "0.2.2" -once_cell = "1.9.0" -chrono = "0.4.19" -sys-info = "0.9.1" -byte-unit = "4.0.13" starship_module_config_derive = { version = "0.2.1", path = "starship_module_config_derive" } -yaml-rust = "0.4.5" -pest = "2.1.3" -pest_derive = "2.1.0" -regex = "1.5.4" -os_info = "3.1.0" -urlencoding = "2.1.0" -open = "2.0.2" -unicode-width = "0.1.9" -terminal_size = "0.1.17" -quick-xml = "0.22.0" -rand = "0.8.4" -serde = { version = "1.0.133", features = ["derive"] } -indexmap = { version ="1.8.0", features = ["serde"] } -notify-rust = { version = "4.5.5", optional = true } -semver = "1.0.4" -which = "4.2.2" -shadow-rs = "0.8.1" -versions = "4.0.0" strsim = "0.10.0" -sha-1 = "0.10.0" +sys-info = "0.9.1" +terminal_size = "0.1.17" +toml = { version = "0.5.8", features = ["preserve_order"] } toml_edit = "0.13.0" +unicode-segmentation = "1.8.0" +unicode-width = "0.1.9" +urlencoding = "2.1.0" +versions = "4.0.0" +which = "4.2.2" +yaml-rust = "0.4.5" process_control = { version = "3.2.1", features = ["crossbeam-channel"] } shell-words = "1.0.0" [target.'cfg(windows)'.dependencies] -winapi = { version = "0.3.9", features = [ - "winuser", - "securitybaseapi", - "processthreadsapi", - "handleapi", - "impl-default", -] } +winapi = { version = "0.3.9", features = ["winuser", "securitybaseapi", "processthreadsapi", "handleapi", "impl-default"] } [target.'cfg(not(windows))'.dependencies] nix = "0.23.1" @@ -90,8 +84,8 @@ nix = "0.23.1" shadow-rs = "0.8.1" [dev-dependencies] -tempfile = "3.2.0" mockall = "0.11" +tempfile = "3.2.0" [profile.release] codegen-units = 1 diff --git a/README.md b/README.md index 63f2e15d8..5f8f302d9 100644 --- a/README.md +++ b/README.md @@ -328,9 +328,9 @@ Add the following to the end of your Nushell configuration (find it by running ` ```toml startup = [ - "mkdir ~/.cache/starship", - "starship init nu | save ~/.cache/starship/init.nu", - "source ~/.cache/starship/init.nu" + "mkdir ~/.cache/starship", + "starship init nu | save ~/.cache/starship/init.nu", + "source ~/.cache/starship/init.nu", ] prompt = "starship_prompt" ``` diff --git a/clippy.toml b/clippy.toml index 26551a251..394d9b4c1 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1,6 +1,6 @@ disallowed-methods = [ - # std::process::Command::new may inadvertly run executables from the current working directory - "std::process::Command::new", - # Setting environment variables can cause issues with non-rust code - "std::env::set_var" + # std::process::Command::new may inadvertly run executables from the current working directory + "std::process::Command::new", + # Setting environment variables can cause issues with non-rust code + "std::env::set_var", ] diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index cddbd3bd0..0dfc5e9c3 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,342 +1,352 @@ module.exports = { - locales: { - "/": { - lang: "en-US", - title: "Starship", - description: "The minimal, blazing-fast, and infinitely customizable prompt for any shell!" - }, - "/de-DE/": { - lang: "de-DE", - title: "Starship", - description: "Minimale, super schnelle und unendlich anpassbare Prompt für jede Shell!" - }, - "/es-ES/": { - lang: "es-ES", - title: "Starship", - description: "¡El prompt minimalista, ultrarápido e infinitamente personalizable para cualquier intérprete de comandos!" - }, - "/fr-FR/": { - lang: "fr-FR", - title: "Starship", - description: "L'invite minimaliste, ultra-rapide et personnalisable à l'infini pour n'importe quel shell !" - }, - "/id-ID/": { - lang: "id-ID", - title: "Starship", - description: "Prompt yang minimal, super cepat, dan dapat disesuaikan tanpa batas untuk shell apa pun!" - }, - "/it-IT/": { - lang: "it-IT", - title: "Starship", - description: "Il prompt minimalista, super veloce e infinitamente personalizzabile per qualsiasi shell!" - }, - "/ja-JP/": { - lang: "ja-JP", - title: "Starship", - description: "シェル用の最小限の、非常に高速で、無限にカスタマイズ可能なプロンプトです!" - }, - "/pt-BR/": { - lang: "pt-BR", - title: "Starship", - description: "O prompt minimalista, extremamente rápido e infinitamente personalizável para qualquer shell!" - }, - "/ru-RU/": { - lang: "ru-RU", - title: "Starship", - description: "Минималистичная, быстрая и бесконечно настраиваемая командная строка для любой оболочки!" - }, - "/vi-VN/": { - lang: "vi-VN", - title: "Starship", - description: "Nhỏ gọn, cực nhanh, và khả năng tuỳ chỉnh vô hạn prompt cho bất kì shell nào!" - }, - "/zh-CN/": { - lang: "zh-CN", - title: "Starship", - description: "轻量级、反应迅速,可定制的高颜值终端!" - }, - "/zh-TW/": { - lang: "zh-TW", - title: "Starship", - description: "適合任何 shell 的最小、極速、無限客製化的提示字元!" - } - }, - // prettier-ignore - head: [ - ["link", { rel: "icon", href: "/icon.png" }], - ["meta", { property: "og:title", content: "Starship: Cross-Shell Prompt" }], - ["meta", { property: "og:description", content: "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."}], - ["meta", { property: "og:type", content: "website" }], - ["meta", { property: "og:url", content: "https://starship.rs/" }], - ["meta", { property: "og:image", content: "https://starship.rs/icon.png" }], - ["meta", { name: "twitter:card", content: "summary"}], - ["meta", { name: "twitter:title", content: "Starship: Cross-Shell Prompt"}], - ["meta", { name: "twitter:description", content: "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."}], - ["meta", { name: "twitter:image", content: "https://starship.rs/icon.png"}], - ["meta", { name: "twitter:alt", content: "Starship: Cross-Shell Prompt"}], - ], - theme: "default-prefers-color-scheme", - themeConfig: { - logo: "/icon.png", - // the GitHub repo path - repo: "starship/starship", - // the label linking to the repo - repoLabel: "GitHub", - // if your docs are not at the root of the repo: - docsDir: "docs", - // defaults to false, set to true to enable - editLinks: true, - // enables Algolia DocSearch - algolia: { - apiKey: "44118471f56286dcda7db941a043370d", - indexName: "starship", - appId: "M3XUO3SQOR" - }, locales: { - "/": { - // text for the language dropdown - selectText: "Languages", - // label for this locale in the language dropdown - label: "English", - // Custom text for edit link. Defaults to "Edit this page" - editLinkText: "Edit this page on GitHub", - // Custom navbar values - nav: [{ text: "Configuration", link: "/config/" }], - // Custom sidebar values - sidebar: [ - "/", - ["/guide/", "Guide"], - ["/installing/", "Advanced Installation"], - ["/config/", "Configuration"], - ["/advanced-config/", "Advanced Configuration"], - ["/faq/", "Frequently Asked Questions"], - ["/presets/", "Presets"], - ["/migrating-to-0.45.0/", "Migrating to v0.45.0"] - ] - }, - "/de-DE/": { - // text for the language dropdown - selectText: "Sprachen", - // label for this locale in the language dropdown - label: "Deutsch", - // Custom text for edit link. Defaults to "Edit this page" - editLinkText: "Bearbeite diese Seite auf GitHub", - // Custom navbar values - nav: [{ text: "Konfiguration", link: "/config/" }], - // Custom sidebar values - sidebar: [ - "/de-DE/", - ["/de-DE/guide/", "Anleitung"], - ["/de-DE/config/", "Konfiguration"], - ["/de-DE/advanced-config/", "Erweiterte Konfiguration"], - ["/de-DE/faq/", "Häufig gestellte Fragen"], - ["/de-DE/presets/", "Konfigurations-Beispiele"] - ] - }, - "/es-ES/": { - // text for the language dropdown - selectText: "Idiomas", - // label for this locale in the language dropdown - label: "Español", - // Custom text for edit link. Defaults to "Edit this page" - editLinkText: "Edita esta página en GitHub", - // Custom navbar values - nav: [{ text: "Configuración", link: "/es-ES/config/" }], - // Custom sidebar values - sidebar: [ - "/es-ES/", - ["/es-ES/guide/", "Guía"], - ["/es-ES/config/", "Configuración"], - ["/es-ES/advanced-config/", "Configuración Avanzada"], - ["/es-ES/faq/", "Preguntas frecuentes"], - ["/es-ES/presets/", "Ajustes predeterminados"] - ] - }, - "/fr-FR/": { - // text for the language dropdown - selectText: "Langues", - // label for this locale in the language dropdown - label: "Français", - // Custom text for edit link. Defaults to "Edit this page" - editLinkText: "Éditez cette page sur GitHub", - // Custom navbar values - nav: [{ text: "Configuration", link: "/fr-FR/config/" }], - // Custom sidebar values - sidebar: [ - "/fr-FR/", - ["/fr-FR/guide/", "Guide"], - ["/fr-FR/config/", "Configuration"], - ["/fr-FR/advanced-config/", "Configuration avancée"], - ["/fr-FR/faq/", "Foire aux questions"], - ["/fr-FR/presets/", "Paramètres par défaut"] - ] - }, - "/id-ID/": { - // text for the language dropdown - selectText: "Languages", - // label for this locale in the language dropdown - label: "Bahasa Indonesia", - // Custom text for edit link. Defaults to "Edit this page" - editLinkText: "Sunting halaman ini di Github", - // Custom navbar values - nav: [{ text: "Konfigurasi", link: "/id-ID/config/" }], - // Custom sidebar values - sidebar: [ - "/id-ID/", - ["/id-ID/guide/", "Petunjuk"], - ["/id-ID/config/", "Konfigurasi"], - ["/id-ID/advanced-config/", "Konfigurasi Lanjutan"], - ["/id-ID/faq/", "Pertanyaan Umum"], - ["/id-ID/presets/", "Prasetel"] - ] - }, - "/it-IT/": { - // text for the language dropdown - selectText: "Languages", - // label for this locale in the language dropdown - label: "Italiano", - // Custom text for edit link. Defaults to "Edit this page" - editLinkText: "Modifica questa pagina in Github", - // Custom navbar values - nav: [{ text: "Configuration", link: "/it-IT/config/" }], - // Custom sidebar values - sidebar: [ - "/it-IT/", - ["/it-IT/guide/", "Guide"], - ["/it-IT/config/", "Configurazione"], - ["/it-IT/advanced-config/", "Configurazione Avanzata"], - ["/it-IT/faq/", "FAQ"], - ["/it-IT/presets/", "Preset"] - ] - }, - "/ja-JP/": { - // text for the language dropdown - selectText: "言語", - // label for this locale in the language dropdown - label: "日本語", - // Custom text for edit link. Defaults to "Edit this page" - editLinkText: "GitHub で編集する", - // Custom navbar values - nav: [{ text: "設定", link: "/ja-JP/config/" }], - // Custom sidebar values - sidebar: [ - "/ja-JP/", - ["/ja-JP/guide/", "ガイド"], - ["/ja-JP/config/", "設定"], - ["/ja-JP/advanced-config/", "高度な設定"], - ["/ja-JP/faq/", "FAQ"], - ["/ja-JP/presets/", "準備するもの"], - ["/ja-JP/migrating-to-0.45.0/", "v0.45への移行"] - ] - }, - "/pt-BR/": { - // text for the language dropdown - selectText: "Languages", - // label for this locale in the language dropdown - label: "Português do Brasil", - // Custom text for edit link. Defaults to "Edit this page" - editLinkText: "Edite esta página no Github", - // Custom navbar values - nav: [{ text: "Configuração", link: "/pt-BR/config/" }], - // Custom sidebar values - sidebar: [ - "/pt-BR/", - ["/pt-BR/guide/", "Guia"], - ["/pt-BR/config/", "Configuração"], - ["/pt-BR/advanced-config/", "Configuração avançada"], - ["/pt-BR/faq/", "Perguntas frequentes"], - ["/pt-BR/presets/", "Predefinições"] - ] - }, - "/ru-RU/": { - // text for the language dropdown - selectText: "Языки", - // label for this locale in the language dropdown - label: "Русский", - // Custom text for edit link. Defaults to "Edit this page" - editLinkText: "Редактировать эту страницу на GitHub", - // Custom navbar values - nav: [{ text: "Настройка", link: "/ru-RU/config/" }], - // Custom sidebar values - sidebar: [ - "/ru-RU/", - ["/ru-RU/guide/", "Руководство"], - ["/ru-RU/config/", "Настройка"], - ["/ru-RU/advanced-config/", "Расширенная Настройка"], - ["/ru-RU/faq/", "Часто Задаваемые Вопросы"], - ["/ru-RU/presets/", "Предустановки"] - ] - }, - "/vi-VN/": { - // text for the language dropdown - selectText: "Ngôn ngữ", - // label for this locale in the language dropdown - label: "Tiếng Việt", - // Custom text for edit link. Defaults to "Edit this page" - editLinkText: "Chỉnh sửa trang này trên GitHub", - // Custom navbar values - nav: [{ text: "Cấu hình", link: "/vi-VN/config/" }], - // Custom sidebar values - sidebar: [ - "/vi-VN/", - ["/vi-VN/guide/", "Hướng dẫn"], - ["/vi-VN/config/", "Cấu hình"], - ["/vi-VN/advanced-config/", "Cấu hình nâng cao"], - ["/vi-VN/faq/", "Các hỏi thường gặp"], - ["/vi-VN/presets/", "Mẫu thiết lập"] - ] - } + "/": { + lang: "en-US", + title: "Starship", + description: "The minimal, blazing-fast, and infinitely customizable prompt for any shell!", + }, + "/de-DE/": { + lang: "de-DE", + title: "Starship", + description: "Minimale, super schnelle und unendlich anpassbare Prompt für jede Shell!", + }, + "/es-ES/": { + lang: "es-ES", + title: "Starship", + description: + "¡El prompt minimalista, ultrarápido e infinitamente personalizable para cualquier intérprete de comandos!", + }, + "/fr-FR/": { + lang: "fr-FR", + title: "Starship", + description: "L'invite minimaliste, ultra-rapide et personnalisable à l'infini pour n'importe quel shell !", + }, + "/id-ID/": { + lang: "id-ID", + title: "Starship", + description: "Prompt yang minimal, super cepat, dan dapat disesuaikan tanpa batas untuk shell apa pun!", + }, + "/it-IT/": { + lang: "it-IT", + title: "Starship", + description: "Il prompt minimalista, super veloce e infinitamente personalizzabile per qualsiasi shell!", + }, + "/ja-JP/": { + lang: "ja-JP", + title: "Starship", + description: "シェル用の最小限の、非常に高速で、無限にカスタマイズ可能なプロンプトです!", + }, + "/pt-BR/": { + lang: "pt-BR", + title: "Starship", + description: + "O prompt minimalista, extremamente rápido e infinitamente personalizável para qualquer shell!", + }, + "/ru-RU/": { + lang: "ru-RU", + title: "Starship", + description: "Минималистичная, быстрая и бесконечно настраиваемая командная строка для любой оболочки!", + }, + "/vi-VN/": { + lang: "vi-VN", + title: "Starship", + description: "Nhỏ gọn, cực nhanh, và khả năng tuỳ chỉnh vô hạn prompt cho bất kì shell nào!", + }, + "/zh-CN/": { + lang: "zh-CN", + title: "Starship", + description: "轻量级、反应迅速,可定制的高颜值终端!", + }, + "/zh-TW/": { + lang: "zh-TW", + title: "Starship", + description: "適合任何 shell 的最小、極速、無限客製化的提示字元!", + }, }, - "/zh-TW/": { - // text for the language dropdown - selectText: "語言", - // label for this locale in the language dropdown - label: "繁體中文", - // Custom text for edit link. Defaults to "Edit this page" - editLinkText: "在 GitHub 上修改此頁面", - // Custom navbar values - nav: [{ text: "設定", link: "/zh-TW/config/" }], - // Custom sidebar values - sidebar: [ - "/zh-TW/", - ["/zh-TW/guide/", "指引"], - ["/zh-TW/config/", "設定"], - ["/zh-TW/advanced-config/", "進階設定"] - ] + // prettier-ignore + head: [ + ["link", { rel: "icon", href: "/icon.png" }], + ["meta", { property: "og:title", content: "Starship: Cross-Shell Prompt" }], + ["meta", { + property: "og:description", + content: + "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.", + }], + ["meta", { property: "og:type", content: "website" }], + ["meta", { property: "og:url", content: "https://starship.rs/" }], + ["meta", { property: "og:image", content: "https://starship.rs/icon.png" }], + ["meta", { name: "twitter:card", content: "summary" }], + ["meta", { name: "twitter:title", content: "Starship: Cross-Shell Prompt" }], + ["meta", { + name: "twitter:description", + content: + "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.", + }], + ["meta", { name: "twitter:image", content: "https://starship.rs/icon.png" }], + ["meta", { name: "twitter:alt", content: "Starship: Cross-Shell Prompt" }], + ], + theme: "default-prefers-color-scheme", + themeConfig: { + logo: "/icon.png", + // the GitHub repo path + repo: "starship/starship", + // the label linking to the repo + repoLabel: "GitHub", + // if your docs are not at the root of the repo: + docsDir: "docs", + // defaults to false, set to true to enable + editLinks: true, + // enables Algolia DocSearch + algolia: { + apiKey: "44118471f56286dcda7db941a043370d", + indexName: "starship", + appId: "M3XUO3SQOR", + }, + locales: { + "/": { + // text for the language dropdown + selectText: "Languages", + // label for this locale in the language dropdown + label: "English", + // Custom text for edit link. Defaults to "Edit this page" + editLinkText: "Edit this page on GitHub", + // Custom navbar values + nav: [{ text: "Configuration", link: "/config/" }], + // Custom sidebar values + sidebar: [ + "/", + ["/guide/", "Guide"], + ["/installing/", "Advanced Installation"], + ["/config/", "Configuration"], + ["/advanced-config/", "Advanced Configuration"], + ["/faq/", "Frequently Asked Questions"], + ["/presets/", "Presets"], + ["/migrating-to-0.45.0/", "Migrating to v0.45.0"], + ], + }, + "/de-DE/": { + // text for the language dropdown + selectText: "Sprachen", + // label for this locale in the language dropdown + label: "Deutsch", + // Custom text for edit link. Defaults to "Edit this page" + editLinkText: "Bearbeite diese Seite auf GitHub", + // Custom navbar values + nav: [{ text: "Konfiguration", link: "/config/" }], + // Custom sidebar values + sidebar: [ + "/de-DE/", + ["/de-DE/guide/", "Anleitung"], + ["/de-DE/config/", "Konfiguration"], + ["/de-DE/advanced-config/", "Erweiterte Konfiguration"], + ["/de-DE/faq/", "Häufig gestellte Fragen"], + ["/de-DE/presets/", "Konfigurations-Beispiele"], + ], + }, + "/es-ES/": { + // text for the language dropdown + selectText: "Idiomas", + // label for this locale in the language dropdown + label: "Español", + // Custom text for edit link. Defaults to "Edit this page" + editLinkText: "Edita esta página en GitHub", + // Custom navbar values + nav: [{ text: "Configuración", link: "/es-ES/config/" }], + // Custom sidebar values + sidebar: [ + "/es-ES/", + ["/es-ES/guide/", "Guía"], + ["/es-ES/config/", "Configuración"], + ["/es-ES/advanced-config/", "Configuración Avanzada"], + ["/es-ES/faq/", "Preguntas frecuentes"], + ["/es-ES/presets/", "Ajustes predeterminados"], + ], + }, + "/fr-FR/": { + // text for the language dropdown + selectText: "Langues", + // label for this locale in the language dropdown + label: "Français", + // Custom text for edit link. Defaults to "Edit this page" + editLinkText: "Éditez cette page sur GitHub", + // Custom navbar values + nav: [{ text: "Configuration", link: "/fr-FR/config/" }], + // Custom sidebar values + sidebar: [ + "/fr-FR/", + ["/fr-FR/guide/", "Guide"], + ["/fr-FR/config/", "Configuration"], + ["/fr-FR/advanced-config/", "Configuration avancée"], + ["/fr-FR/faq/", "Foire aux questions"], + ["/fr-FR/presets/", "Paramètres par défaut"], + ], + }, + "/id-ID/": { + // text for the language dropdown + selectText: "Languages", + // label for this locale in the language dropdown + label: "Bahasa Indonesia", + // Custom text for edit link. Defaults to "Edit this page" + editLinkText: "Sunting halaman ini di Github", + // Custom navbar values + nav: [{ text: "Konfigurasi", link: "/id-ID/config/" }], + // Custom sidebar values + sidebar: [ + "/id-ID/", + ["/id-ID/guide/", "Petunjuk"], + ["/id-ID/config/", "Konfigurasi"], + ["/id-ID/advanced-config/", "Konfigurasi Lanjutan"], + ["/id-ID/faq/", "Pertanyaan Umum"], + ["/id-ID/presets/", "Prasetel"], + ], + }, + "/it-IT/": { + // text for the language dropdown + selectText: "Languages", + // label for this locale in the language dropdown + label: "Italiano", + // Custom text for edit link. Defaults to "Edit this page" + editLinkText: "Modifica questa pagina in Github", + // Custom navbar values + nav: [{ text: "Configuration", link: "/it-IT/config/" }], + // Custom sidebar values + sidebar: [ + "/it-IT/", + ["/it-IT/guide/", "Guide"], + ["/it-IT/config/", "Configurazione"], + ["/it-IT/advanced-config/", "Configurazione Avanzata"], + ["/it-IT/faq/", "FAQ"], + ["/it-IT/presets/", "Preset"], + ], + }, + "/ja-JP/": { + // text for the language dropdown + selectText: "言語", + // label for this locale in the language dropdown + label: "日本語", + // Custom text for edit link. Defaults to "Edit this page" + editLinkText: "GitHub で編集する", + // Custom navbar values + nav: [{ text: "設定", link: "/ja-JP/config/" }], + // Custom sidebar values + sidebar: [ + "/ja-JP/", + ["/ja-JP/guide/", "ガイド"], + ["/ja-JP/config/", "設定"], + ["/ja-JP/advanced-config/", "高度な設定"], + ["/ja-JP/faq/", "FAQ"], + ["/ja-JP/presets/", "準備するもの"], + ["/ja-JP/migrating-to-0.45.0/", "v0.45への移行"], + ], + }, + "/pt-BR/": { + // text for the language dropdown + selectText: "Languages", + // label for this locale in the language dropdown + label: "Português do Brasil", + // Custom text for edit link. Defaults to "Edit this page" + editLinkText: "Edite esta página no Github", + // Custom navbar values + nav: [{ text: "Configuração", link: "/pt-BR/config/" }], + // Custom sidebar values + sidebar: [ + "/pt-BR/", + ["/pt-BR/guide/", "Guia"], + ["/pt-BR/config/", "Configuração"], + ["/pt-BR/advanced-config/", "Configuração avançada"], + ["/pt-BR/faq/", "Perguntas frequentes"], + ["/pt-BR/presets/", "Predefinições"], + ], + }, + "/ru-RU/": { + // text for the language dropdown + selectText: "Языки", + // label for this locale in the language dropdown + label: "Русский", + // Custom text for edit link. Defaults to "Edit this page" + editLinkText: "Редактировать эту страницу на GitHub", + // Custom navbar values + nav: [{ text: "Настройка", link: "/ru-RU/config/" }], + // Custom sidebar values + sidebar: [ + "/ru-RU/", + ["/ru-RU/guide/", "Руководство"], + ["/ru-RU/config/", "Настройка"], + ["/ru-RU/advanced-config/", "Расширенная Настройка"], + ["/ru-RU/faq/", "Часто Задаваемые Вопросы"], + ["/ru-RU/presets/", "Предустановки"], + ], + }, + "/vi-VN/": { + // text for the language dropdown + selectText: "Ngôn ngữ", + // label for this locale in the language dropdown + label: "Tiếng Việt", + // Custom text for edit link. Defaults to "Edit this page" + editLinkText: "Chỉnh sửa trang này trên GitHub", + // Custom navbar values + nav: [{ text: "Cấu hình", link: "/vi-VN/config/" }], + // Custom sidebar values + sidebar: [ + "/vi-VN/", + ["/vi-VN/guide/", "Hướng dẫn"], + ["/vi-VN/config/", "Cấu hình"], + ["/vi-VN/advanced-config/", "Cấu hình nâng cao"], + ["/vi-VN/faq/", "Các hỏi thường gặp"], + ["/vi-VN/presets/", "Mẫu thiết lập"], + ], + }, + }, + "/zh-TW/": { + // text for the language dropdown + selectText: "語言", + // label for this locale in the language dropdown + label: "繁體中文", + // Custom text for edit link. Defaults to "Edit this page" + editLinkText: "在 GitHub 上修改此頁面", + // Custom navbar values + nav: [{ text: "設定", link: "/zh-TW/config/" }], + // Custom sidebar values + sidebar: [ + "/zh-TW/", + ["/zh-TW/guide/", "指引"], + ["/zh-TW/config/", "設定"], + ["/zh-TW/advanced-config/", "進階設定"], + ], + }, + "/zh-CN/": { + // text for the language dropdown + selectText: "语言", + // label for this locale in the language dropdown + label: "简体中文", + // Custom text for edit link. Defaults to "Edit this page" + editLinkText: "在 GitHub 上修改此页", + // Custom navbar values + nav: [{ text: "配置", link: "/zh-CN/config/" }], + // Custom sidebar values + sidebar: [ + "/zh-CN/", + ["/zh-CN/guide/", "指南"], + ["/zh-CN/config/", "配置"], + ["/zh-CN/advanced-config/", "高级配置"], + ["/zh-CN/faq/", "常见问题"], + ["/zh-CN/presets/", "社区配置分享"], + ], + }, }, - "/zh-CN/": { - // text for the language dropdown - selectText: "语言", - // label for this locale in the language dropdown - label: "简体中文", - // Custom text for edit link. Defaults to "Edit this page" - editLinkText: "在 GitHub 上修改此页", - // Custom navbar values - nav: [{ text: "配置", link: "/zh-CN/config/" }], - // Custom sidebar values - sidebar: [ - "/zh-CN/", - ["/zh-CN/guide/", "指南"], - ["/zh-CN/config/", "配置"], - ["/zh-CN/advanced-config/", "高级配置"], - ["/zh-CN/faq/", "常见问题"], - ["/zh-CN/presets/", "社区配置分享"] - ] - } - }, - plugins: [ - [ - "@vuepress/google-analytics", - { - ga: "UA-71160903-4" - } + plugins: [ + [ + "@vuepress/google-analytics", + { + ga: "UA-71160903-4", + }, + ], + [ + "sitemap", + { + hostname: "https://starship.rs", + }, + ], + ["vuepress-plugin-code-copy", true], ], - [ - "sitemap", - { - hostname: "https://starship.rs" - } - ], - ['vuepress-plugin-code-copy', true] - ] }; diff --git a/docs/README.md b/docs/README.md index 9ef8d66d0..ab227d603 100644 --- a/docs/README.md +++ b/docs/README.md @@ -142,9 +142,9 @@ description: Starship is the minimal, blazing fast, and extremely customizable p ```toml startup = [ - "mkdir ~/.cache/starship", - "starship init nu | save ~/.cache/starship/init.nu", - "source ~/.cache/starship/init.nu" + "mkdir ~/.cache/starship", + "starship init nu | save ~/.cache/starship/init.nu", + "source ~/.cache/starship/init.nu", ] prompt = "starship_prompt" ``` diff --git a/docs/advanced-config/README.md b/docs/advanced-config/README.md index ea239ff3d..e26bdec86 100644 --- a/docs/advanced-config/README.md +++ b/docs/advanced-config/README.md @@ -62,7 +62,7 @@ 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! + 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. @@ -193,9 +193,9 @@ Note: `continuation_prompt` should be set to a literal string without any variab Note: Continuation prompts are only available in the following shells: - - `bash` - - `zsh` - - `PowerShell` +- `bash` +- `zsh` +- `PowerShell` ### Example @@ -210,15 +210,15 @@ continuation_prompt = "▶▶" 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` - - `bg:` - - `fg:` - - `` - - `none` +- `bold` +- `italic` +- `underline` +- `dimmed` +- `inverted` +- `bg:` +- `fg:` +- `` +- `none` where `` is a color specifier (discussed below). `fg:` and `` 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. @@ -226,11 +226,11 @@ The `none` token overrides all other tokens in a string if it is not part of a ` A color specifier can be one of the following: - - 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). +- 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). If multiple colors are specified for foreground/background, the last one in the string will take priority. diff --git a/docs/config/README.md b/docs/config/README.md index e9bd3e6cd..85e345ca0 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -13,8 +13,8 @@ All configuration for starship is done in this [TOML](https://github.com/toml-la add_newline = true # Replace the "❯" symbol in the prompt with "➜" -[character] # The name of the module we are configuring is "character" -success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green" +[character] # The name of the module we are configuring is "character" +success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green" # Disable the package module, hiding it from the prompt completely [package] @@ -66,7 +66,7 @@ os.setenv('STARSHIP_CACHE', 'C:\\Users\\user\\AppData\\Local\\Temp') **Variable**: Smaller sub-components that contain information provided by the module. For example, the "version" variable in the "nodejs" module contains the current version of Node.js. -By convention, most modules have a prefix of default terminal color (e.g. `via ` in "nodejs") and an empty space as a suffix. +By convention, most modules have a prefix of default terminal color (e.g. `via` in "nodejs") and an empty space as a suffix. ### Format Strings @@ -97,7 +97,7 @@ In the second part, which is enclosed in a `()`, is a [style string](#style-stri For example: - `[on](red bold)` will print a string `on` with bold text colored red. -- `[⌘ $version](bold green)` will print a symbol `⌘ ` followed by the content of variable `version`, with bold text colored green. +- `[⌘ $version](bold green)` will print a symbol `⌘` followed by the content of variable `version`, with bold text colored green. - `[a [b](red) c](green)` will print `a b c` with `b` red, and `a` and `c` green. #### Style Strings @@ -121,7 +121,7 @@ For example: - `(@$region)` will show nothing if the variable `region` is `None` or empty string, otherwise `@` followed by the value of region. - `(some text)` will always show nothing since there are no variables wrapped in the braces. -- When `$all` is a shortcut for `\[$a$b\] `, `($all)` will show nothing only if `$a` and `$b` are both `None`. +- When `$all` is a shortcut for `\[$a$b\]`, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. #### Special characters @@ -155,14 +155,13 @@ This is the list of prompt-wide configuration options. ### Options -| Option | Default | Description | -| ----------------- | ------------------------------- | ---------------------------------------------------------------- | -| `format` | [link](#default-prompt-format) | Configure the format of the prompt. | -| `right_format` | `""` | See [Enable Right Prompt](/advanced-config/#enable-right-prompt) | -| `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). | -| `command_timeout` | `500` | Timeout for commands executed by starship (in milliseconds). | -| `add_newline` | `true` | Inserts blank line between shell prompts. | - +| Option | Default | Description | +| ----------------- | ------------------------------ | ---------------------------------------------------------------- | +| `format` | [link](#default-prompt-format) | Configure the format of the prompt. | +| `right_format` | `""` | See [Enable Right Prompt](/advanced-config/#enable-right-prompt) | +| `scan_timeout` | `30` | Timeout for starship to scan files (in milliseconds). | +| `command_timeout` | `500` | Timeout for commands executed by starship (in milliseconds). | +| `add_newline` | `true` | Inserts blank line between shell prompts. | ### Example @@ -264,7 +263,7 @@ modules you explicitly add to the format will not be duplicated. Eg. ```toml # Move the directory to the second line -format="$all$directory$character" +format = "$all$directory$character" ``` ## AWS @@ -290,7 +289,7 @@ date is read from the `AWSUME_EXPIRATION` env var. | Option | Default | Description | | ------------------- | ---------------------------------------------------------------- | ----------------------------------------------------------------- | | `format` | `'on [$symbol($profile )(\($region\) )(\[$duration\])]($style)'` | The format for the module. | -| `symbol` | `"☁️ "` | The symbol used before displaying the current AWS profile. | +| `symbol` | `"☁️ "` | The symbol used before displaying the current AWS profile. | | `region_aliases` | | Table of region aliases to display in addition to the AWS name. | | `style` | `"bold yellow"` | The style for the module. | | `expiration_symbol` | `X` | The symbol displayed when the temporary credentials have expired. | @@ -306,7 +305,7 @@ date is read from the `AWSUME_EXPIRATION` env var. | 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 +*: This variable can only be used as a part of a style string ### Examples @@ -355,12 +354,12 @@ The `azure` module shows the current Azure Subscription. This is based on showin ### Options -| Variable | Default | Description | -| ----------------- | ---------------------------------------- | ------------------------------------------ | -| `format` | `"on [$symbol($subscription)]($style) "` | The format for the Azure module to render. | -| `symbol` | `"ﴃ "` | The symbol used in the format. | -| `style` | `"blue bold"` | The style used in the format. | -| `disabled` | `true` | Disables the `azure` module. | +| Variable | Default | Description | +| ---------- | ---------------------------------------- | ------------------------------------------ | +| `format` | `"on [$symbol($subscription)]($style) "` | The format for the Azure module to render. | +| `symbol` | `"ﴃ "` | The symbol used in the format. | +| `style` | `"blue bold"` | The style used in the format. | +| `disabled` | `true` | Disables the `azure` module. | ### Example @@ -420,27 +419,26 @@ The default value for the `charging_symbol` and `discharging_symbol` option is r The `display` option is an array of the following table. -| Option | Default | Description | -| -------------------- | ---------- | ----------------------------------------------- | -| `threshold` | `10` | The upper bound for the display option. | -| `style` | `bold red` | The style used if the display option is in use. | -| `charging_symbol` | `-` | Optional symbol displayed if display option is in use, defaults to battery's `charging_symbol` option. | +| Option | Default | Description | +| -------------------- | ---------- | --------------------------------------------------------------------------------------------------------- | +| `threshold` | `10` | The upper bound for the display option. | +| `style` | `bold red` | The style used if the display option is in use. | +| `charging_symbol` | `-` | Optional symbol displayed if display option is in use, defaults to battery's `charging_symbol` option. | | `discharging_symbol` | `-` | Optional symbol displayed if display option is in use, defaults to battery's `discharging_symbol` option. | #### Example ```toml -[[battery.display]] # "bold red" style and discharging_symbol when capacity is between 0% and 10% +[[battery.display]] # "bold red" style and discharging_symbol when capacity is between 0% and 10% threshold = 10 style = "bold red" -[[battery.display]] # "bold yellow" style and 💦 symbol when capacity is between 10% and 30% +[[battery.display]] # "bold yellow" style and 💦 symbol when capacity is between 10% and 30% threshold = 30 style = "bold yellow" discharging_symbol = "💦" # when capacity is over 30%, the battery indicator will not be displayed - ``` ## Character @@ -526,16 +524,16 @@ the module will be activated if any of the following conditions are met: ### Options -| Option | Default | Description | -| ------------------- | -------------------------------------- | ------------------------------------------------------------------------ | -| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch`| -| `symbol` | `"△ "` | The symbol used before the version of cmake. | -| `detect_extensions` | `[]` | Which extensions should trigger this module | -| `detect_files` | `["CMakeLists.txt", "CMakeCache.txt"]` | Which filenames should trigger this module | -| `detect_folders` | `[]` | Which folders should trigger this module | -| `style` | `"bold blue"` | The style for the module. | -| `disabled` | `false` | Disables the `cmake` module. | +| Option | Default | Description | +| ------------------- | -------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"△ "` | The symbol used before the version of cmake. | +| `detect_extensions` | `[]` | Which extensions should trigger this module | +| `detect_files` | `["CMakeLists.txt", "CMakeCache.txt"]` | Which filenames should trigger this module | +| `detect_folders` | `[]` | Which folders should trigger this module | +| `style` | `"bold blue"` | The style for the module. | +| `disabled` | `false` | Disables the `cmake` module. | ### Variables @@ -545,7 +543,7 @@ the module will be activated if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ## COBOL / GNUCOBOL @@ -557,26 +555,26 @@ By default, the module will be shown if any of the following conditions are met: ### Options -| Option | Default | Description | -| ------------------- | ------------------------------------ | ------------------------------------------------------------------------ | -| `symbol` | `"⚙️ "` | The symbol used before displaying the version of COBOL. | -| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch`| -| `style` | `"bold blue"` | The style for the module. | -| `detect_extensions` | `["cbl", "cob", "CBL", "COB"]` | Which extensions should trigger this module. | -| `detect_files` | `[]` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this module. | -| `disabled` | `false` | Disables the `cobol` module. | +| Option | Default | Description | +| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- | +| `symbol` | `"⚙️ "` | The symbol used before displaying the version of COBOL. | +| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `style` | `"bold blue"` | The style for the module. | +| `detect_extensions` | `["cbl", "cob", "CBL", "COB"]` | Which extensions should trigger this module. | +| `detect_files` | `[]` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this module. | +| `disabled` | `false` | Disables the `cobol` module. | ### Variables -| Variable | Example | Description | -| -------- | --------- | ------------------------------------ | -| version | `v3.1.2.0`| The version of `cobol` | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| Variable | Example | Description | +| -------- | ---------- | ------------------------------------ | +| version | `v3.1.2.0` | The version of `cobol` | +| 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 +*: This variable can only be used as a part of a style string ## Command Duration @@ -598,15 +596,15 @@ running `eval $(starship init $0)`, and then proceed as normal. ### Options -| Option | Default | Description | -| ------------------- | ----------------------------- | ---------------------------------------------------------- | -| `min_time` | `2_000` | Shortest duration to show time for (in milliseconds). | -| `show_milliseconds` | `false` | Show milliseconds in addition to seconds for the duration. | -| `format` | `"took [$duration]($style) "` | The format for the module. | -| `style` | `"bold yellow"` | The style for the module. | -| `disabled` | `false` | Disables the `cmd_duration` module. | -| `show_notifications`| `false` | Show desktop notifications when command completes. | -| `min_time_to_notify`| `45_000` | Shortest duration for notification (in milliseconds). | +| Option | Default | Description | +| -------------------- | ----------------------------- | ---------------------------------------------------------- | +| `min_time` | `2_000` | Shortest duration to show time for (in milliseconds). | +| `show_milliseconds` | `false` | Show milliseconds in addition to seconds for the duration. | +| `format` | `"took [$duration]($style) "` | The format for the module. | +| `style` | `"bold yellow"` | The style for the module. | +| `disabled` | `false` | Disables the `cmd_duration` module. | +| `show_notifications` | `false` | Show desktop notifications when command completes. | +| `min_time_to_notify` | `45_000` | Shortest duration for notification (in milliseconds). | ::: tip @@ -622,7 +620,7 @@ supports notifications by running `STARSHIP_LOG=debug starship module cmd_durati | duration | `16m40s` | The time it took to execute the command | | style\* | | Mirrors the value of option `style` | -\*: This variable can only be used as a part of a style string +*: This variable can only be used as a part of a style string ### Example @@ -663,7 +661,7 @@ This does not suppress conda's own prompt modifier, you may want to run `conda c | 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 +*: This variable can only be used as a part of a style string ### Example @@ -684,16 +682,16 @@ By default the module will be shown if any of the following conditions are met: ### Options -| Option | Default | Description | -| ------------------- | ------------------------------------ | ------------------------------------------------------------------------ | -| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. | -| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch`| -| `style` | `"bold red"` | The style for the module. | -| `detect_extensions` | `["cr"]` | Which extensions should trigger this module. | -| `detect_files` | `["shard.yml"]` | Which filenames should trigger this module. | -| `detect_folders` | `[]` | Which folders should trigger this module. | -| `disabled` | `false` | Disables the `crystal` module. | +| Option | Default | Description | +| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- | +| `symbol` | `"🔮 "` | The symbol used before displaying the version of crystal. | +| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `style` | `"bold red"` | The style for the module. | +| `detect_extensions` | `["cr"]` | Which extensions should trigger this module. | +| `detect_files` | `["shard.yml"]` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this module. | +| `disabled` | `false` | Disables the `crystal` module. | ### Variables @@ -703,7 +701,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -725,16 +723,16 @@ By default the module will be shown if any of the following conditions are met: ### Options -| Option | Default | Description | -| ------------------- | ------------------------------------------------- | ------------------------------------------------------------------------ | -| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch`| -| `symbol` | `"🎯 "` | A format string representing the symbol of Dart | -| `detect_extensions` | `["dart"]` | Which extensions should trigger this module. | -| `detect_files` | `["pubspec.yaml", "pubspec.yml", "pubspec.lock"]` | Which filenames should trigger this module. | -| `detect_folders` | `[".dart_tool"]` | Which folders should trigger this module. | -| `style` | `"bold blue"` | The style for the module. | -| `disabled` | `false` | Disables the `dart` module. | +| Option | Default | Description | +| ------------------- | ------------------------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🎯 "` | A format string representing the symbol of Dart | +| `detect_extensions` | `["dart"]` | Which extensions should trigger this module. | +| `detect_files` | `["pubspec.yaml", "pubspec.yml", "pubspec.lock"]` | Which filenames should trigger this module. | +| `detect_folders` | `[".dart_tool"]` | Which folders should trigger this module. | +| `style` | `"bold blue"` | The style for the module. | +| `disabled` | `false` | Disables the `dart` module. | ### Variables @@ -744,7 +742,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -759,6 +757,7 @@ format = "via [🔰 $version](bold red) " The `deno` module shows you your currently installed version of [Deno](https://deno.land/). By default the module will be shown if any of the following conditions are met: + - The current directory contains a `deno.json`, `deno.jsonc`, `mod.ts`, `mod.js`, `deps.ts` or `deps.js` file ### Options @@ -767,7 +766,7 @@ By default the module will be shown if any of the following conditions are met: | ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- | | `format` | `"via [$symbol($version )]($style)"` | The format for the module. | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | +| `symbol` | `"🦕 "` | A format string representing the symbol of Deno | | `detect_extensions` | `[]` | Which extensions should trigger this module. | | `detect_files` | `["deno.json", "deno.jsonc", "mod.ts", "mod.js", "deps.ts", "deps.js"]` | Which filenames should trigger this module. | | `detect_folders` | `[]` | Which folders should trigger this module. | @@ -807,19 +806,19 @@ it would have been `nixpkgs/pkgs`. ### Options -| Option | Default | Description | -| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------- | -| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | -| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | -| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | -| `style` | `"bold cyan"` | The style for the module. | -| `disabled` | `false` | Disables the `directory` module. | -| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | -| `read_only_style` | `"red"` | The style for the read only symbol. | -| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | -| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false.| -| `home_symbol` | `"~"` | The symbol indicating home directory. | -| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) | +| Option | Default | Description | +| ------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. | +| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. | +| `format` | `"[$path]($style)[$read_only]($read_only_style) "` | The format for the module. | +| `style` | `"bold cyan"` | The style for the module. | +| `disabled` | `false` | Disables the `directory` module. | +| `read_only` | `"🔒"` | The symbol indicating current directory is read only. | +| `read_only_style` | `"red"` | The style for the read only symbol. | +| `truncation_symbol` | `""` | The symbol to prefix to truncated paths. eg: "…/" | +| `repo_root_style` | `None` | The style for the root of the git repo when `truncate_to_repo` option is set to false. | +| `home_symbol` | `"~"` | The symbol indicating home directory. | +| `use_os_path_sep` | `true` | Use the OS specific path seperator instead of always using `/` (e.g. `\` on Windows) |
This module has a few advanced configuration options that control how the directory is displayed. @@ -854,7 +853,7 @@ a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/ | path | `"D:/Projects"` | The current directory path | | style\* | `"black bold dimmed"` | Mirrors the value of option `style` | -\*: This variable can only be used as a part of a style string +*: This variable can only be used as a part of a style string ### Example @@ -879,7 +878,7 @@ the context in use). | Option | Default | Description | | ------------------- | ------------------------------------------------------------- | --------------------------------------------------------------------------------- | | `format` | `"via [$symbol$context]($style) "` | The format for the module. | -| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context. | +| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context. | | `only_with_files` | `true` | Only show when there's a match | | `detect_extensions` | `[]` | Which extensions should trigger this module (needs `only_with_files` to be true). | | `detect_files` | `["docker-compose.yml", "docker-compose.yaml", "Dockerfile"]` | Which filenames should trigger this module (needs `only_with_files` to be true). | @@ -895,7 +894,7 @@ the context in use). | 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 +*: This variable can only be used as a part of a style string ### Example @@ -939,11 +938,11 @@ when there is a csproj file in the current directory. | Option | Default | Description | | ------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )(🎯 $tfm )]($style)"` | The format for the module. | +| `format` | `"via [$symbol($version )(🎯 $tfm )]($style)"` | The format for the module. | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | | `symbol` | `".NET "` | The symbol used before displaying the version of dotnet. | | `heuristic` | `true` | Use faster version detection to keep starship snappy. | -| `detect_extensions` | `["csproj", "fsproj", "xproj"]` | Which extensions should trigger this module. | +| `detect_extensions` | `["csproj", "fsproj", "xproj"]` | Which extensions should trigger this module. | | `detect_files` | `["global.json", "project.json", "Directory.Build.props", "Directory.Build.targets", "Packages.props"]` | Which filenames should trigger this module. | | `detect_folders` | `[]` | Which folders should trigger this modules. | | `style` | `"bold blue"` | The style for the module. | @@ -958,7 +957,7 @@ when there is a csproj file in the current directory. | 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 +*: This variable can only be used as a part of a style string ### Example @@ -984,7 +983,7 @@ By default the module will be shown if any of the following conditions are met: | ------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------- | | `format` | `'via [$symbol($version \(OTP $otp_version\) )]($style)'` | The format for the module elixir. | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. | +| `symbol` | `"💧 "` | The symbol used before displaying the version of Elixir/Erlang. | | `detect_extensions` | `[]` | Which extensions should trigger this module. | | `detect_files` | `["mix.exs"]` | Which filenames should trigger this module. | | `detect_folders` | `[]` | Which folders should trigger this modules. | @@ -1000,7 +999,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -1043,7 +1042,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -1062,18 +1061,19 @@ The module will be shown only if any of the following conditions are met: - The `variable` configuration option matches an existing environment variable - The `variable` configuration option is not defined, but the `default` configuration option is - ::: tip Multiple environmental variables can be displayed by using a `.`. (see example) If the `variable` configuration option is not set, the module will display value of variable under the name of text after the `.` character. Example: following configuration will display value of USER environment variable + ```toml # ~/.config/starship.toml [env_var.USER] default = "unknown user" ``` + ::: ### Options @@ -1094,7 +1094,7 @@ default = "unknown user" | symbol | | Mirrors the value of option `symbol` | | style\* | `black bold dimmed` | Mirrors the value of option `style` | -\*: This variable can only be used as a part of a style string +*: This variable can only be used as a part of a style string ### Example @@ -1107,6 +1107,7 @@ default = "unknown shell" ``` Displaying multiple environmental variables: + ```toml # ~/.config/starship.toml @@ -1146,7 +1147,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -1165,17 +1166,17 @@ other modules. ### Options -| Option | Default | Description | -| ---------- | -------------- | -------------------------------------- | -| `symbol` | `"."` | The symbol used to fill the line. | -| `style` | `"bold black"` | The style for the module. | -| `disabled` | `false` | Disables the `fill` module | +| Option | Default | Description | +| ---------- | -------------- | --------------------------------- | +| `symbol` | `"."` | The symbol used to fill the line. | +| `style` | `"bold black"` | The style for the module. | +| `disabled` | `false` | Disables the `fill` module | ### Example ```toml # ~/.config/starship.toml -format="AA $fill BB $fill CC" +format = "AA $fill BB $fill CC" [fill] symbol = "-" @@ -1186,7 +1187,6 @@ Produces a prompt that looks like: ``` AA -------------------------------------------- BB -------------------------------------------- CC - ``` ## Google Cloud (`gcloud`) @@ -1199,7 +1199,7 @@ This is based on the `~/.config/gcloud/active_config` file and the `~/.config/gc | Option | Default | Description | | ---------------- | -------------------------------------------------------- | --------------------------------------------------------------- | | `format` | `'on [$symbol$account(@$domain)(\($region\))]($style) '` | The format for the module. | -| `symbol` | `"☁️ "` | The symbol used before displaying the current GCP profile. | +| `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. | @@ -1216,7 +1216,7 @@ This is based on the `~/.config/gcloud/active_config` file and the `~/.config/gc | 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 +*: This variable can only be used as a part of a style string ### Examples @@ -1270,15 +1270,15 @@ The `git_branch` module shows the active branch of the repo in your current dire ### Variables -| Variable | Example | Description | -| ---------------- | -------- | ------------------------------------------------------------------------------------------------------ | -| branch | `master` | The current branch name, falls back to `HEAD` if there's no current branch (e.g. git detached `HEAD`). | -| remote_name | `origin` | The remote name. | -| remote_branch | `master` | The name of the branch tracked on `remote_name`. | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| Variable | Example | Description | +| ------------- | -------- | ------------------------------------------------------------------------------------------------------ | +| branch | `master` | The current branch name, falls back to `HEAD` if there's no current branch (e.g. git detached `HEAD`). | +| remote_name | `origin` | The remote name. | +| remote_branch | `master` | The name of the branch tracked on `remote_name`. | +| 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 +*: This variable can only be used as a part of a style string ### Example @@ -1297,15 +1297,15 @@ The `git_commit` module shows the current commit hash and also the tag (if any) ### Options -| Option | Default | Description | -| -------------------- | ---------------------------------------------- | ------------------------------------------------------- | -| `commit_hash_length` | `7` | The length of the displayed git commit hash. | +| Option | Default | Description | +| -------------------- | ------------------------------ | ------------------------------------------------------- | +| `commit_hash_length` | `7` | The length of the displayed git commit hash. | | `format` | `"[\\($hash$tag\\)]($style) "` | The format for the module. | -| `style` | `"bold green"` | The style for the module. | -| `only_detached` | `true` | Only show git commit hash when in detached `HEAD` state | -| `tag_disabled` | `true` | Disables showing tag info in `git_commit` module. | -| `tag_symbol` | `" 🏷 "` | Tag symbol prefixing the info shown | -| `disabled` | `false` | Disables the `git_commit` module. | +| `style` | `"bold green"` | The style for the module. | +| `only_detached` | `true` | Only show git commit hash when in detached `HEAD` state | +| `tag_disabled` | `true` | Disables showing tag info in `git_commit` module. | +| `tag_symbol` | `" 🏷 "` | Tag symbol prefixing the info shown | +| `disabled` | `false` | Disables the `git_commit` module. | ### Variables @@ -1314,7 +1314,7 @@ The `git_commit` module shows the current commit hash and also the tag (if any) | hash | `b703eb3` | The current git commit hash | | style\* | | Mirrors the value of option `style` | -\*: This variable can only be used as a part of a style string +*: This variable can only be used as a part of a style string ### Example @@ -1357,7 +1357,7 @@ that information will be shown too. | progress_total | `2` | The total operation progress | | style\* | | Mirrors the value of option `style` | -\*: This variable can only be used as a part of a style string +*: This variable can only be used as a part of a style string ### Example @@ -1383,24 +1383,24 @@ To enable it, set `disabled` to `false` in your configuration file. ### Options -| Option | Default | Description | -| ------------------------- | -------------------------------------------------------------------- | --------------------------------------- | -| `added_style` | `"bold green"` | The style for the added count. | -| `deleted_style` | `"bold red"` | The style for the deleted count. | -| `only_nonzero_diffs` | `true` | Render status only for changed items. | -| `format` | `'([+$added]($added_style) )([-$deleted]($deleted_style) )'` | The format for the module. | -| `disabled` | `true` | Disables the `git_metrics` module. | +| Option | Default | Description | +| -------------------- | ------------------------------------------------------------ | ------------------------------------- | +| `added_style` | `"bold green"` | The style for the added count. | +| `deleted_style` | `"bold red"` | The style for the deleted count. | +| `only_nonzero_diffs` | `true` | Render status only for changed items. | +| `format` | `'([+$added]($added_style) )([-$deleted]($deleted_style) )'` | The format for the module. | +| `disabled` | `true` | Disables the `git_metrics` module. | ### Variables -| Variable | Example | Description | -| ---------------- | ---------- | ----------------------------------- | -| added | `1` | The current number of added lines | -| deleted | `2` | The current number of deleted lines | -| added_style\* | | Mirrors the value of option `added_style` | -| deleted_style\* | | Mirrors the value of option `deleted_style` | +| Variable | Example | Description | +| --------------- | ------- | ------------------------------------------- | +| added | `1` | The current number of added lines | +| deleted | `2` | The current number of deleted lines | +| added_style\* | | Mirrors the value of option `added_style` | +| deleted_style\* | | Mirrors the value of option `deleted_style` | -\*: This variable can only be used as a part of a style string +*: This variable can only be used as a part of a style string ### Example @@ -1441,20 +1441,20 @@ current directory. The following variables can be used in `format`: -| Variable | Description | -| -------------- | ----------------------------------------------------------------------------------------------------------- | -| `all_status` | Shortcut for`$conflicted$stashed$deleted$renamed$modified$staged$untracked` | +| Variable | Description | +| -------------- | ------------------------------------------------------------------------------------------------------------- | +| `all_status` | Shortcut for`$conflicted$stashed$deleted$renamed$modified$staged$untracked` | | `ahead_behind` | Displays `diverged`, `ahead`, `behind` or `up_to_date` 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. | -| style\* | Mirrors the value of option `style` | +| `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. | +| style\* | Mirrors the value of option `style` | -\*: This variable can only be used as a part of a style string +*: This variable can only be used as a part of a style string The following variables can be used in `diverged`: @@ -1534,7 +1534,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -1574,7 +1574,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -1601,12 +1601,12 @@ The `hostname` module shows the system hostname. ### Variables -| Variable | Example | Description | -| -------- | ---------- | ------------------------------------ | -| hostname | `computer` | The hostname of the computer | -| style\* | | Mirrors the value of option `style` | +| Variable | Example | Description | +| -------- | ---------- | ----------------------------------- | +| hostname | `computer` | The hostname of the computer | +| style\* | | Mirrors the value of option `style` | -\*: This variable can only be used as a part of a style string +*: This variable can only be used as a part of a style string ### Example @@ -1615,7 +1615,7 @@ The `hostname` module shows the system hostname. [hostname] ssh_only = false -format = "on [$hostname](bold red) " +format = "on [$hostname](bold red) " trim_at = ".companyname.com" disabled = false ``` @@ -1637,7 +1637,7 @@ By default the module will be shown if any of the following conditions are met: | `detect_extensions` | `["java", "class", "gradle", "jar", "cljs", "cljc"]` | Which extensions should trigger this module. | | `detect_files` | `["pom.xml", "build.gradle.kts", "build.sbt", ".java-version", ".deps.edn", "project.clj", "build.boot"]` | Which filenames should trigger this module. | | `detect_folders` | `[]` | Which folders should trigger this modules. | -| `symbol` | `"☕ "` | A format string representing the symbol of Java | +| `symbol` | `"☕ "` | A format string representing the symbol of Java | | `style` | `"red dimmed"` | The style for the module. | | `disabled` | `false` | Disables the `java` module. | @@ -1649,7 +1649,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -1668,7 +1668,7 @@ The module will show the number of jobs running if there are at least 2 jobs, or more than the `number_threshold` config value, if it exists. The module will show a symbol if there is at least 1 job, or more than the `symbol_threshold` config value, if it exists. You can set both values -to 0 in order to *always* show the symbol and number of jobs, even if there are +to 0 in order to _always_ show the symbol and number of jobs, even if there are 0 jobs running. The default functionality is: @@ -1694,16 +1694,16 @@ then the module will also show when there are 0 jobs running. ### Options -| Option | Default | Description | -| ----------- | ----------------------------- | ------------------------------------------------ | -| `threshold`\* | `1` | Show number of jobs if exceeded. | -| `symbol_threshold` | `1` | Show `symbol` if the job count is at least `symbol_threshold`. | -| `number_threshold` | `2` | Show the number of jobs if the job count is at least `number_threshold`. | -| `format` | `"[$symbol$number]($style) "` | The format for the module. | -| `symbol` | `"✦"` | The string used to represent the `symbol` variable. | -| `style` | `"bold blue"` | The style for the module. | -| `disabled` | `false` | Disables the `jobs` module. | -\*: This option is deprecated, please use the `number_threshold` and `symbol_threshold` options instead. +| Option | Default | Description | +| ------------------------------------------------------------------------------------------------------- | ----------------------------- | ------------------------------------------------------------------------ | +| `threshold`* | `1` | Show number of jobs if exceeded. | +| `symbol_threshold` | `1` | Show `symbol` if the job count is at least `symbol_threshold`. | +| `number_threshold` | `2` | Show the number of jobs if the job count is at least `number_threshold`. | +| `format` | `"[$symbol$number]($style) "` | The format for the module. | +| `symbol` | `"✦"` | The string used to represent the `symbol` variable. | +| `style` | `"bold blue"` | The style for the module. | +| `disabled` | `false` | Disables the `jobs` module. | +| *: This option is deprecated, please use the `number_threshold` and `symbol_threshold` options instead. | | | ### Variables @@ -1713,7 +1713,7 @@ then the module will also show when there are 0 jobs running. | 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 +*: This variable can only be used as a part of a style string ### Example @@ -1756,7 +1756,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -1796,7 +1796,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -1831,13 +1831,13 @@ To enable it, set `disabled` to `false` in your configuration file. ### Options -| Option | Default | Description | -| ----------------------- | -------------------------------------------------- | --------------------------------------------------------------------- | -| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. | -| `format` | `'[$symbol$context( \($namespace\))]($style) in '` | The format for the module. | -| `style` | `"cyan bold"` | The style for the module. | -| `context_aliases` | | Table of context aliases to display. | -| `disabled` | `true` | Disables the `kubernetes` module. | +| Option | Default | Description | +| ----------------- | -------------------------------------------------- | --------------------------------------------------------------------- | +| `symbol` | `"☸ "` | A format string representing the symbol displayed before the Cluster. | +| `format` | `'[$symbol$context( \($namespace\))]($style) in '` | The format for the module. | +| `style` | `"cyan bold"` | The style for the module. | +| `context_aliases` | | Table of context aliases to display. | +| `disabled` | `true` | Disables the `kubernetes` module. | ### Variables @@ -1848,7 +1848,7 @@ To enable it, set `disabled` to `false` in your configuration 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 +*: This variable can only be used as a part of a style string ### Example @@ -1919,27 +1919,27 @@ By default the module will be shown if any of the following conditions are met: ### Options -| Option | Default | Description | -| ------------------- | ------------------------------------ | ----------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🌙 "` | A format string representing the symbol of Lua. | -| `detect_extensions` | `["lua"]` | Which extensions should trigger this module. | -| `detect_files` | `[".lua-version"]` | Which filenames should trigger this module. | -| `detect_folders` | `["lua"]` | Which folders should trigger this module. | -| `style` | `"bold blue"` | The style for the module. | -| `lua_binary` | `"lua"` | Configures the lua binary that Starship executes when getting the version. | -| `disabled` | `false` | Disables the `lua` module. | +| Option | Default | Description | +| ------------------- | ------------------------------------ | -------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"🌙 "` | A format string representing the symbol of Lua. | +| `detect_extensions` | `["lua"]` | Which extensions should trigger this module. | +| `detect_files` | `[".lua-version"]` | Which filenames should trigger this module. | +| `detect_folders` | `["lua"]` | Which folders should trigger this module. | +| `style` | `"bold blue"` | The style for the module. | +| `lua_binary` | `"lua"` | Configures the lua binary that Starship executes when getting the version. | +| `disabled` | `false` | Disables the `lua` module. | ### Variables -| Variable | Example | Description | -| -------- | --------- | ------------------------------------ | -| version | `v5.4.0` | The version of `lua` | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| Variable | Example | Description | +| -------- | -------- | ------------------------------------ | +| version | `v5.4.0` | The version of `lua` | +| 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 +*: This variable can only be used as a part of a style string ### Example @@ -1969,7 +1969,7 @@ To enable it, set `disabled` to `false` in your configuration file. | ----------- | ---------------------------------------------- | -------------------------------------------------------- | | `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. | | `format` | `"via $symbol [${ram}( \| ${swap})]($style) "` | The format for the module. | -| `symbol` | `"🐏"` | The symbol used before displaying the memory usage. | +| `symbol` | `"🐏"` | The symbol used before displaying the memory usage. | | `style` | `"bold dimmed white"` | The style for the module. | | `disabled` | `true` | Disables the `memory_usage` module. | @@ -1981,11 +1981,11 @@ To enable it, set `disabled` to `false` in your configuration file. | 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` | +| 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 +*: 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 ### Example @@ -2022,7 +2022,7 @@ The `hg_branch` module shows the active branch of the repo in your current direc | 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 +*: This variable can only be used as a part of a style string ### Example @@ -2066,7 +2066,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -2088,7 +2088,7 @@ The module will be shown when inside a nix-shell environment. | 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. | @@ -2103,7 +2103,7 @@ The module will be shown when inside a nix-shell environment. | 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 +*: This variable can only be used as a part of a style string ### Example @@ -2151,7 +2151,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -2199,7 +2199,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -2219,23 +2219,23 @@ to fetch the current project in use. ### Options -| Option | Default | Description | -| ---------------- | ------------------------------------------------ | --------------------------------------------------------------- | -| `format` | `"on [$symbol$cloud(\\($project\\))]($style) "` | The format for the module. | -| `symbol` | `"☁️ "` | The symbol used before displaying the current OpenStack cloud. | -| `style` | `"bold yellow"` | The style for the module. | -| `disabled` | `false` | Disables the `openstack` module. | +| Option | Default | Description | +| ---------- | ----------------------------------------------- | -------------------------------------------------------------- | +| `format` | `"on [$symbol$cloud(\\($project\\))]($style) "` | The format for the module. | +| `symbol` | `"☁️ "` | The symbol used before displaying the current OpenStack cloud. | +| `style` | `"bold yellow"` | The style for the module. | +| `disabled` | `false` | Disables the `openstack` module. | ### Variables -| Variable | Example | Description | -| -------- | ---------- | ------------------------------------ | -| cloud | `corp` | The current OpenStack cloud | -| project | `dev` | The current OpenStack project | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| Variable | Example | Description | +| -------- | ------- | ------------------------------------ | +| cloud | `corp` | The current OpenStack cloud | +| project | `dev` | The current OpenStack project | +| 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 +*: This variable can only be used as a part of a style string ### Example @@ -2279,14 +2279,14 @@ package, and shows its current version. The module currently supports `npm`, `ni ### Options -| Option | Default | Description | -| ----------------- | ---------------------------------- | ------------------------------------------------------------------------ | -| `format` | `"is [$symbol$version]($style) "` | The format for the module. | -| `symbol` | `"📦 "` | The symbol used before displaying the version the package. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch`| -| `style` | `"bold 208"` | The style for the module. | -| `display_private` | `false` | Enable displaying version for packages marked as private. | -| `disabled` | `false` | Disables the `package` module. | +| Option | Default | Description | +| ----------------- | --------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"is [$symbol$version]($style) "` | The format for the module. | +| `symbol` | `"📦 "` | The symbol used before displaying the version the package. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `style` | `"bold 208"` | The style for the module. | +| `display_private` | `false` | Enable displaying version for packages marked as private. | +| `disabled` | `false` | Disables the `package` module. | ### Variables @@ -2296,7 +2296,7 @@ package, and shows its current version. The module currently supports `npm`, `ni | 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 +*: This variable can only be used as a part of a style string ### Example @@ -2324,7 +2324,7 @@ By default the module will be shown if any of the following conditions are met: | ------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | | `format` | `"via [$symbol($version )]($style)"` | The format string for the module. | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl | +| `symbol` | `"🐪 "` | The symbol used before displaying the version of Perl | | `detect_extensions` | `["pl", "pm", "pod"]` | Which extensions should trigger this module. | | `detect_files` | `["Makefile.PL", "Build.PL", "cpanfile", "cpanfile.snapshot", "META.json", "META.yml", ".perl-version"]` | Which filenames should trigger this module. | | `detect_folders` | `[]` | Which folders should trigger this module. | @@ -2363,7 +2363,7 @@ By default the module will be shown if any of the following conditions are met: | ------------------- | ------------------------------------ | ------------------------------------------------------------------------- | | `format` | `"via [$symbol($version )]($style)"` | The format for the module. | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. | +| `symbol` | `"🐘 "` | The symbol used before displaying the version of PHP. | | `detect_extensions` | `["php"]` | Which extensions should trigger this module. | | `detect_files` | `["composer.json", ".php-version"]` | Which filenames should trigger this module. | | `detect_folders` | `[]` | Which folders should trigger this module. | @@ -2378,7 +2378,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -2407,13 +2407,13 @@ By default the module will be shown if any of the following conditions are met: ### Options -| Option | Default | Description | -| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- | -| `format` | `"via [$symbol$stack]($style) "` | The format string for the module. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `" "` | A format string shown before the Pulumi stack. | -| `style` | `"bold 5"` | The style for the module. | -| `disabled` | `false` | Disables the `pulumi` module. | +| Option | Default | Description | +| ---------------- | -------------------------------- | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol$stack]($style) "` | The format string for the module. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `" "` | A format string shown before the Pulumi stack. | +| `style` | `"bold 5"` | The style for the module. | +| `disabled` | `false` | Disables the `pulumi` module. | ### Variables @@ -2424,7 +2424,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -2444,7 +2444,6 @@ format = "[🛥 ($version )$stack]($style) " [pulumi] symbol = "🛥 " format = "[$symbol$stack]($style) " - ``` ## PureScript @@ -2476,7 +2475,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -2513,11 +2512,11 @@ By default the module will be shown if any of the following conditions are met: | -------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- | | `format` | `'via [${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style)'` | The format for the module. | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🐍 "` | A format string representing the symbol of Python | +| `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 | -| `python_binary` | `["python", "python3", "python2"]` | Configures the python binaries that Starship should executes when getting the version. | +| `pyenv_prefix` | `pyenv` | Prefix before pyenv version display, only used if pyenv is used | +| `python_binary` | `["python", "python3", "python2"]` | Configures the python binaries that Starship should executes when getting the version. | | `detect_extensions` | `["py"]` | Which extensions should trigger this module | | `detect_files` | `[".python-version", "Pipfile", "__init__.py", "pyproject.toml", "requirements.txt", "setup.py", "tox.ini"]` | Which filenames should trigger this module | | `detect_folders` | `[]` | Which folders should trigger this module | @@ -2546,7 +2545,7 @@ Python version 2, see example below. | Variable | Example | Description | | ------------ | --------------- | ------------------------------------------ | | version | `"v3.8.1"` | The version of `python` | -| symbol | `"🐍 "` | Mirrors the value of option `symbol` | +| 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 | @@ -2603,16 +2602,16 @@ any of the following conditions are met: ### Options -| Option | Default | Description | -|---------------------|--------------------------------------|-----------------------------------------------| -| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch`| -| `symbol` | `"📐"` | A format string representing the symbol of R. | -| `style` | `"blue bold"` | The style for the module. | -| `detect_extensions` | `["R", "Rd", "Rmd", "Rproj", "Rsx"]` | Which extensions should trigger this module | -| `detect_files` | `[".Rprofile"]` | Which filenames should trigger this module | -| `detect_folders` | `[".Rproj.user"]` | Which folders should trigger this module | -| `disabled` | `false` | Disables the `r` module. | +| Option | Default | Description | +| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `"📐"` | A format string representing the symbol of R. | +| `style` | `"blue bold"` | The style for the module. | +| `detect_extensions` | `["R", "Rd", "Rmd", "Rproj", "Rsx"]` | Which extensions should trigger this module | +| `detect_files` | `[".Rprofile"]` | Which filenames should trigger this module | +| `detect_folders` | `[".Rproj.user"]` | Which folders should trigger this module | +| `disabled` | `false` | Disables the `r` module. | ### Variables @@ -2644,7 +2643,7 @@ The module will be shown if any of the following conditions are met: | ------------------- | ------------------------------------ | ------------------------------------------------------------------------- | | `format` | `"via [$symbol($version )]($style)"` | The format for the module. | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🔺 "` | A format string representing the symbol of Red. | +| `symbol` | `"🔺 "` | A format string representing the symbol of Red. | | `detect_extensions` | `["red"]` | Which extensions should trigger this module. | | `detect_files` | `[]` | Which filenames should trigger this module. | | `detect_folders` | `[]` | Which folders should trigger this module. | @@ -2659,7 +2658,7 @@ The module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -2688,7 +2687,7 @@ Starship gets the current Ruby version by running `ruby -v`. | ------------------- | ------------------------------------ | ------------------------------------------------------------------------- | | `format` | `"via [$symbol($version )]($style)"` | The format for the module. | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"💎 "` | A format string representing the symbol of Ruby. | +| `symbol` | `"💎 "` | A format string representing the symbol of Ruby. | | `detect_extensions` | `["rb"]` | Which extensions should trigger this module. | | `detect_files` | `["Gemfile", ".ruby-version"]` | Which filenames should trigger this module. | | `detect_folders` | `[]` | Which folders should trigger this module. | @@ -2704,7 +2703,7 @@ Starship gets the current Ruby version by running `ruby -v`. | 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 +*: This variable can only be used as a part of a style string ### Example @@ -2729,7 +2728,7 @@ The module will be shown if any of the following conditions are met: | ------------------- | ------------------------------------ | ------------------------------------------------------------------------- | | `format` | `"via [$symbol($version )]($style)"` | The format for the module. | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"🦀 "` | A format string representing the symbol of Rust | +| `symbol` | `"🦀 "` | A format string representing the symbol of Rust | | `detect_extensions` | `["rs"]` | Which extensions should trigger this module. | | `detect_files` | `["Cargo.toml"]` | Which filenames should trigger this module. | | `detect_folders` | `[]` | Which folders should trigger this module. | @@ -2744,7 +2743,7 @@ The module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -2779,13 +2778,13 @@ By default the module will be shown if any of the following conditions are met: ### Variables -| Variable | Example | Description | -| -------- | -----------| ------------------------------------ | -| version | `2.13.5` | The version of `scala` | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| Variable | Example | Description | +| -------- | -------- | ------------------------------------ | +| version | `2.13.5` | The version of `scala` | +| 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 +*: This variable can only be used as a part of a style string ### Example @@ -2828,12 +2827,12 @@ To enable it, set `disabled` to `false` in your configuration file. ### Variables -| Variable | Default | Description | -| ----------- | ------- | ---------------------------------------------------------- | -| indicator | | Mirrors the value of `indicator` for currently used shell. | -| style\* | | Mirrors the value of option `style`. | +| Variable | Default | Description | +| --------- | ------- | ---------------------------------------------------------- | +| indicator | | Mirrors the value of `indicator` for currently used shell. | +| style\* | | Mirrors the value of option `style`. | -\*: This variable can only be used as a part of a style string +*: This variable can only be used as a part of a style string ### Examples @@ -2859,7 +2858,7 @@ set to a number and meets or exceeds the specified threshold. | ----------- | ---------------------------- | ------------------------------------------------------------- | | `threshold` | `2` | Display threshold. | | `format` | `"[$symbol$shlvl]($style) "` | The format for the module. | -| `symbol` | `"↕️ "` | The symbol used to represent the `SHLVL`. | +| `symbol` | `"↕️ "` | The symbol used to represent the `SHLVL`. | | `repeat` | `false` | Causes `symbol` to be repeated by the current `SHLVL` amount. | | `style` | `"bold yellow"` | The style for the module. | | `disabled` | `true` | Disables the `shlvl` module. | @@ -2872,7 +2871,7 @@ set to a number and meets or exceeds the specified threshold. | 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 +*: This variable can only be used as a part of a style string ### Example @@ -2907,7 +2906,7 @@ and `$SINGULARITY_NAME` is set. | 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 +*: This variable can only be used as a part of a style string ### Example @@ -2936,44 +2935,43 @@ This module is not supported on nu shell. ### Options -| Option | Default | Description | -| ------------------------- | ----------------------------- | ------------------------------------------------------ | -| `format` | `"[$symbol$status]($style) "` | The format of the module | -| `symbol` | `"✖"` | The symbol displayed on program error | -| `success_symbol` | `"✔️"` | The symbol displayed on program success | -| `not_executable_symbol` | `"🚫"` | The symbol displayed when file isn't executable | -| `not_found_symbol` | `"🔍"` | The symbol displayed when the command can't be found | -| `sigint_symbol` | `"🧱"` | The symbol displayed on SIGINT (Ctrl + c) | -| `signal_symbol` | `"⚡"` | The symbol displayed on any signal | -| `style` | `"bold red"` | The style for the module. | -| `recognize_signal_code` | `true` | Enable signal mapping from exit code | -| `map_symbol` | `false` | Enable symbols mapping from exit code | -| `pipestatus` | `false` | Enable pipestatus reporting | -| `pipestatus_separator` | `|` | The symbol that separate in pipe program exit codes | -| `pipestatus_format` | `\\[$pipestatus\\] => [$symbol$common_meaning$signal_name$maybe_int]($style)` | The format of the module when the command is a pipeline | -| `disabled` | `true` | Disables the `status` module. | +| Option | Default | Description | +| ----------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------- | +| `format` | `"[$symbol$status]($style) "` | The format of the module | +| `symbol` | `"✖"` | The symbol displayed on program error | +| `success_symbol` | `"✔️"` | The symbol displayed on program success | +| `not_executable_symbol` | `"🚫"` | The symbol displayed when file isn't executable | +| `not_found_symbol` | `"🔍"` | The symbol displayed when the command can't be found | +| `sigint_symbol` | `"🧱"` | The symbol displayed on SIGINT (Ctrl + c) | +| `signal_symbol` | `"⚡"` | The symbol displayed on any signal | +| `style` | `"bold red"` | The style for the module. | +| `recognize_signal_code` | `true` | Enable signal mapping from exit code | +| `map_symbol` | `false` | Enable symbols mapping from exit code | +| `pipestatus` | `false` | Enable pipestatus reporting | +| `pipestatus_separator` | ` | ` | +| `pipestatus_format` | `\\[$pipestatus\\] => [$symbol$common_meaning$signal_name$maybe_int]($style)` | The format of the module when the command is a pipeline | +| `disabled` | `true` | Disables the `status` module. | ### Variables -| Variable | Example | Description | -| ----------------------- | ------- | ----------------------------------------------------------------------- | -| status | `127` | The exit code of the last command | -| hex_status | `0x7F` | The exit code of the last command in hex | -| int | `127` | The exit code of the last command | -| common_meaning | `ERROR` | Meaning of the code if not a signal | -| signal_number | `9` | Signal number corresponding to the exit code, only if signalled | -| signal_name | `KILL` | Name of the signal corresponding to the exit code, only if signalled | -| maybe_int | `7` | Contains the exit code number when no meaning has been found | -| pipestatus | | Rendering of in pipeline programs's exit codes, this is only available in pipestatus_format | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| Variable | Example | Description | +| -------------- | ------- | ------------------------------------------------------------------------------------------- | +| status | `127` | The exit code of the last command | +| hex_status | `0x7F` | The exit code of the last command in hex | +| int | `127` | The exit code of the last command | +| common_meaning | `ERROR` | Meaning of the code if not a signal | +| signal_number | `9` | Signal number corresponding to the exit code, only if signalled | +| signal_name | `KILL` | Name of the signal corresponding to the exit code, only if signalled | +| maybe_int | `7` | Contains the exit code number when no meaning has been found | +| pipestatus | | Rendering of in pipeline programs's exit codes, this is only available in pipestatus_format | +| 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 +*: This variable can only be used as a part of a style string ### Example ```toml - # ~/.config/starship.toml [status] @@ -2982,7 +2980,6 @@ symbol = "🔴" format = '[\[$symbol $common_meaning$signal_name$maybe_int\]]($style) ' map_symbol = true disabled = false - ``` ## Sudo @@ -2999,27 +2996,26 @@ To enable it, set `disabled` to `false` in your configuration file. ### Options -| Option | Default | Description | -| -------------- | ----------------------- | ------------------------------------------------------------ | -| `format` | `[as $symbol]($style)"` | The format of the module | -| `symbol` | `"🧙 "` | The symbol displayed when credentials are cached | -| `style` | `"bold blue"` | The style for the module. | -| `allow_windows`| `false` | Since windows has no default sudo, default is disabled. | -| `disabled` | `true` | Disables the `sudo` module. | +| Option | Default | Description | +| --------------- | ----------------------- | ------------------------------------------------------- | +| `format` | `[as $symbol]($style)"` | The format of the module | +| `symbol` | `"🧙 "` | The symbol displayed when credentials are cached | +| `style` | `"bold blue"` | The style for the module. | +| `allow_windows` | `false` | Since windows has no default sudo, default is disabled. | +| `disabled` | `true` | Disables the `sudo` module. | ### Variables -| Variable | Example | Description | -| --------- | ------- | ------------------------------------ | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| Variable | Example | Description | +| -------- | ------- | ------------------------------------ | +| 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 +*: This variable can only be used as a part of a style string ### Example ```toml - # ~/.config/starship.toml [sudo] @@ -3066,7 +3062,7 @@ The module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -3099,7 +3095,7 @@ By default the module will be shown if any of the following conditions are met: | ------------------- | ------------------------------------ | ------------------------------------------------------------------------- | | `format` | `"via [$symbol$workspace]($style) "` | The format string for the module. | | `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `"💠"` | A format string shown before the terraform workspace. | +| `symbol` | `"💠"` | A format string shown before the terraform workspace. | | `detect_extensions` | `["tf", "tfplan", "tfstate"]` | Which extensions should trigger this module. | | `detect_files` | `[]` | Which filenames should trigger this module. | | `detect_folders` | `[".terraform"]` | Which folders should trigger this module. | @@ -3115,7 +3111,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -3171,7 +3167,7 @@ Manually setting `time_format` will override the `use_12hr` setting. | time | `13:08:10` | The current time. | | style\* | | Mirrors the value of option `style` | -\*: This variable can only be used as a part of a style string +*: This variable can only be used as a part of a style string ### Example @@ -3262,7 +3258,7 @@ By default the module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -3277,6 +3273,7 @@ format = "via [⍱ $version](bold white) " The `vlang` module shows you your currently installed version of [V](https://vlang.io/). By default the module will be shown if any of the following conditions are met: + - The current directory contains a file with `.v` extension - The current directory contains a `v.mod`, `vpkg.json` or `.vpkg-lock.json` file @@ -3295,11 +3292,11 @@ By default the module will be shown if any of the following conditions are met: ### Variables -| Variable | Example | Description | -| -------- | -------- | ------------------------------------ | -| version | `v0.2` | The version of `v` | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| Variable | Example | Description | +| -------- | ------- | ------------------------------------ | +| version | `v0.2` | The version of `v` | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | ### Example @@ -3316,22 +3313,22 @@ The module will be shown only if a repository is currently in use. ### Options -| Option | Default | Description | -| ---------- | -------------------------------- | ------------------------------------------------------- | -| `symbol` | | The symbol used before displaying the repository name. | -| `style` | `"bold yellow"` | The style for the module. | -| `format` | `"vcsh [$symbol$repo]($style) "` | The format for the module. | -| `disabled` | `false` | Disables the `vcsh` module. | +| Option | Default | Description | +| ---------- | -------------------------------- | ------------------------------------------------------ | +| `symbol` | | The symbol used before displaying the repository name. | +| `style` | `"bold yellow"` | The style for the module. | +| `format` | `"vcsh [$symbol$repo]($style) "` | The format for the module. | +| `disabled` | `false` | Disables the `vcsh` module. | ### Variables -| Variable | Example | Description | -| -------- | ------------------------------------------- | ------------------------------------- | -| repo | `dotfiles` if in a VCSH repo named dotfiles | The active repository name | -| symbol | | Mirrors the value of option `symbol` | -| style\* | `black bold dimmed` | Mirrors the value of option `style` | +| Variable | Example | Description | +| -------- | ------------------------------------------- | ------------------------------------ | +| repo | `dotfiles` if in a VCSH repo named dotfiles | The active repository name | +| symbol | | Mirrors the value of option `symbol` | +| style\* | `black bold dimmed` | Mirrors the value of option `style` | -\*: This variable can only be used as a part of a style string +*: This variable can only be used as a part of a style string ### Example @@ -3370,7 +3367,7 @@ The module will be shown if any of the following conditions are met: | 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 +*: This variable can only be used as a part of a style string ### Example @@ -3429,19 +3426,19 @@ Format strings can also contain shell specific prompt sequences, e.g. ### Options -| Option | Default | Description | -| ------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `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` | `""` | 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. | -| `symbol` | `""` | The symbol used before displaying the command output. | -| `style` | `"bold green"` | The style for the module. | -| `format` | `"[$symbol($output )]($style)"` | The format for the module. | -| `disabled` | `false` | Disables this `custom` module. | +| Option | Default | Description | +| ------------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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` | `""` | 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. | +| `symbol` | `""` | The symbol used before displaying the command output. | +| `style` | `"bold green"` | The style for the module. | +| `format` | `"[$symbol($output )]($style)"` | The format for the module. | +| `disabled` | `false` | Disables this `custom` module. | | `os` | | Operating System name on which the module will be shown (unix, linux, macos, windows, ... ) [See possible values](https://doc.rust-lang.org/std/env/consts/constant.OS.html). | ### Variables @@ -3452,7 +3449,7 @@ Format strings can also contain shell specific prompt sequences, e.g. | 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 +*: This variable can only be used as a part of a style string #### Custom command shell @@ -3502,13 +3499,13 @@ with shell details and starship configuration if you hit such scenario. # ~/.config/starship.toml [custom.foo] -command = "echo foo" # shows output of command -files = ["foo"] # can specify filters but wildcards are not supported +command = "echo foo" # shows output of command +files = ["foo"] # can specify filters but wildcards are not supported when = """ test "$HOME" == "$PWD" """ format = " transcending [$output]($style)" [custom.time] command = "time /T" -extensions = ["pst"] # filters *.pst files +extensions = ["pst"] # filters *.pst files shell = ["pwsh.exe", "-NoProfile", "-Command", "-"] ``` diff --git a/docs/faq/README.md b/docs/faq/README.md index 94eb28373..00fcb359d 100644 --- a/docs/faq/README.md +++ b/docs/faq/README.md @@ -63,8 +63,7 @@ prompt, for example the version of a program or the current git status. To make sure starship doesn't hang while trying to execute these commands we set a time limit, if a command takes longer than this limit starship will stop the execution of the command and output the above warning, this is expected -behaviour. This time limit is configurable using the [`command_timeout` -key](/config/#prompt) so if you want you can increase the time limit. You can +behaviour. This time limit is configurable using the [`command_timeout`key](/config/#prompt) so if you want you can increase the time limit. You can also follow the debugging steps below to see which command is being slow and see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to `error` to hide these warnings. diff --git a/docs/installing/README.md b/docs/installing/README.md index bc28af421..017894f07 100644 --- a/docs/installing/README.md +++ b/docs/installing/README.md @@ -17,7 +17,7 @@ out! ### Prerequisites -Head over to the [Chocolatey installation page](https://chocolatey.org/install) and follow the instructions to install Chocolatey. +Head over to the [Chocolatey installation page](https://chocolatey.org/install) and follow the instructions to install Chocolatey. ### Installation diff --git a/docs/migrating-to-0.45.0/README.md b/docs/migrating-to-0.45.0/README.md index 8af694483..89029a6e8 100644 --- a/docs/migrating-to-0.45.0/README.md +++ b/docs/migrating-to-0.45.0/README.md @@ -109,7 +109,7 @@ To configure the prompt to use the older `use_symbol_for_status = true` configur error_symbol = "[✖](bold red)" ``` -*Note:* The `character` element automatically adds a space after, so unlike the other `format` strings, we specifically do not add one in the above examples. +_Note:_ The `character` element automatically adds a space after, so unlike the other `format` strings, we specifically do not add one in the above examples. #### Command Duration diff --git a/starship_module_config_derive/Cargo.toml b/starship_module_config_derive/Cargo.toml index 736dc8416..caf5ac42b 100644 --- a/starship_module_config_derive/Cargo.toml +++ b/starship_module_config_derive/Cargo.toml @@ -1,19 +1,19 @@ [package] name = "starship_module_config_derive" version = "0.2.1" -edition = "2021" authors = ["Matan Kushner "] -homepage = "https://starship.rs" -documentation = "https://starship.rs/guide/" -repository = "https://github.com/starship/starship" -readme = "README.md" -license = "ISC" -keywords = ["prompt", "shell", "bash", "fish", "zsh"] categories = ["command-line-utilities"] +documentation = "https://starship.rs/guide/" +edition = "2021" +homepage = "https://starship.rs" +include = ["src/**/*", "LICENSE", "README.md"] +keywords = ["prompt", "shell", "bash", "fish", "zsh"] +license = "ISC" +readme = "README.md" +repository = "https://github.com/starship/starship" description = """ The minimal, blazing-fast, and infinitely customizable prompt for any shell! ☄🌌️ """ -include = ["src/**/*", "LICENSE", "README.md"] [lib] name = "starship_module_config_derive"