feat(preset): Add No Empty Icons preset (#4518)

* feat(preset): Add No Empty Icons preset

When toolset files are identified by the Starship module, the default format displays the toolset icon, and additional information.

When the toolset executables are not available, the additional information (like version number) is missing. Only the toolset icon is displayed.

The No Empty Icons preset changes the format configuration to not show the toolset icons if the variables are empty - presumably because the toolset is not installed or found.

Closes #3070
Related #3248

* Remove non-version-related modules from preset

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>

* Add new module opa to preset

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>

* Drop unnecessary inner conditional from format

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>

* Remove commit_hash_length setting from preset

* Remove undesired modules

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
This commit is contained in:
Jan Klass 2022-11-06 22:39:04 +01:00 committed by GitHub
parent 3109943822
commit 1a3d51fe76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 138 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,115 @@
[buf]
format = '(with [$symbol$version ]($style))'
[bun]
format = '(via [$symbol($version )]($style))'
[c]
format = '(via [$symbol($version(-$name) )]($style))'
[cmake]
format = '(via [$symbol($version )]($style))'
[cobol]
format = '(via [$symbol($version )]($style))'
[crystal]
format = '(via [$symbol($version )]($style))'
[daml]
format = '(via [$symbol($version )]($style))'
[dart]
format = '(via [$symbol($version )]($style))'
[deno]
format = '(via [$symbol($version )]($style))'
[dotnet]
format = '(via [$symbol($version )(🎯 $tfm )]($style))'
[elixir]
format = '(via [$symbol($version \(OTP $otp_version\) )]($style))'
[elm]
format = '(via [$symbol($version )]($style))'
[erlang]
format = '(via [$symbol($version )]($style))'
[golang]
format = '(via [$symbol($version )]($style))'
[haskell]
format = '(via [$symbol($version )]($style))'
[helm]
format = '(via [$symbol($version )]($style))'
[java]
format = '(via [$symbol($version )]($style))'
[julia]
format = '(via [$symbol($version )]($style))'
[kotlin]
format = '(via [$symbol($version )]($style))'
[lua]
format = '(via [$symbol($version )]($style))'
[nim]
format = '(via [$symbol($version )]($style))'
[nodejs]
format = '(via [$symbol($version )]($style))'
[ocaml]
format = '(via [$symbol($version )(\($switch_indicator$switch_name\) )]($style))'
[opa]
format = '(via [$symbo($version ]($style))"'
[package]
format = '(is [$symbol$version]($style) )'
[perl]
format = '(via [$symbol($version )]($style))'
[php]
format = '(via [$symbol($version )]($style))'
[purescript]
format = '(via [$symbol($version )]($style))'
[python]
format = '(via [${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style))'
[raku]
format = '(via [$symbol($version-$vm_version )]($style))'
[red]
format = '(via [$symbol($version )]($style))'
[rlang]
format = '(via [$symbol($version )]($style))'
[ruby]
format = '(via [$symbol($version )]($style))'
[rust]
format = '(via [$symbol($version )]($style))'
[scala]
format = '(via [$symbol($version )]($style))'
[swift]
format = '(via [$symbol($version )]($style))'
[vagrant]
format = '(via [$symbol($version )]($style))'
[vlang]
format = '(via [$symbol($version )]($style))'
[zig]
format = '(via [$symbol($version )]($style))'

View File

@ -42,6 +42,12 @@ This preset hides the version of language runtimes. If you work in containers or
[![Screenshot of Hide Runtime Versions preset](/presets/img/no-runtime-versions.png "Click to view No Runtime Versions preset")](./no-runtimes)
## [No Empty Icons](./no-empty-icons.md)
This preset does not show icons if the toolset is not found.
[![Screenshot of No Empty Icons preset](/presets/img/no-empty-icons.png "Click to view No Runtime Versions preset")](./no-empty-icons.md)
## [Pure Prompt](./pure-preset.md)
This preset emulates the look and behavior of [Pure](https://github.com/sindresorhus/pure).

View File

@ -0,0 +1,17 @@
[Return to Presets](./README.md#no-empty-icons)
# No Empty Icons Preset
If toolset files are identified the toolset icon is displayed. If the toolset is not found to determine its version number, it is not displayed. This preset changes the behavior to display the icon only if the toolset information can be determined.
![Screenshot of No Empty Icons preset](/presets/img/no-empty-icons.png)
### Configuration
```sh
starship preset no-empty-icons > ~/.config/starship.toml
```
[Click to download TOML](/presets/toml/no-empty-icons.toml)
<<< @/.vuepress/public/presets/toml/no-empty-icons.toml