Starship Prompt Builder

Ocaml module

Shows the currently installed version of OCaml

When it appears

It renders when Starship detects the matching context and its configured conditions are met.

Preview

Rendered from the starting configuration in a representative simulated environment.

starship — preview
via 🐫 v1.2.3 (1) 

Starting configuration

[ocaml]
format = "via [$symbol($version )(\\($switch_indicator$switch_name\\) )]($style)"
symbol = "🐫 "
style = "bold yellow"
Open in the builder

The configuration is compressed into the URL fragment and stays in your browser.

Key options

formatstring
The format string for the module.
version_formatstring
The version format. Available vars are raw, major, minor, & patch
global_switch_indicatorstring
The format string used to represent global OPAM switch.
local_switch_indicatorstring
The format string used to represent local OPAM switch.
symbolstring
The symbol used before displaying the version of OCaml.
stylestring
The style for the module.
disabledboolean
Disables the ocaml module.
detect_extensionsarray
Which extensions should trigger this module.
detect_filesarray
Which filenames should trigger this module.
detect_foldersarray
Which folders should trigger this module.

Format variables

$style
Mirrors the value of option style
$switch_indicator
Mirrors the value of indicator for currently active OPAM switch
$switch_name
The active OPAM switch
$symbol
Mirrors the value of option symbol
$version
The version of ocaml

Common adjustments

  • Tune the detection options if this module appears in the wrong projects or misses the right ones.
  • Edit format to reorder its variables or make surrounding text conditional.
  • Adjust its style options to fit the palette used by the rest of the prompt.