From e47bfbabb9b7d6af12a29db9413a6ec03fba174b Mon Sep 17 00:00:00 2001 From: Andrew Pantuso Date: Sun, 17 Dec 2023 02:22:29 -0500 Subject: feat(direnv): add new direnv module (#5157) --- docs/config/README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'docs') diff --git a/docs/config/README.md b/docs/config/README.md index 25b52b0d9..046ad01d4 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -337,6 +337,7 @@ $aws\ $gcloud\ $openstack\ $azure\ +$direnv\ $env_var\ $crystal\ $custom\ @@ -1208,6 +1209,47 @@ truncation_length = 8 truncation_symbol = '…/' ``` +## Direnv + +The `direnv` module shows the status of the current rc file if one is present. The status includes the path to the rc file, whether it is loaded, and whether it has been allowed by `direnv`. + +### Options + +| Option | Default | Description | +| ------------------- | -------------------------------------- | ----------------------------------------------------- | +| `format` | `'[$symbol$loaded/$allowed]($style) '` | The format for the module. | +| `symbol` | `'direnv '` | The symbol used before displaying the direnv context. | +| `style` | `'bold orange'` | The style for the module. | +| `disabled` | `true` | Disables the `direnv` module. | +| `detect_extensions` | `[]` | Which extensions should trigger this module. | +| `detect_files` | `['.envrc']` | Which filenames should trigger this module. | +| `detect_folders` | `[]` | Which folders should trigger this module. | +| `allowed_msg` | `'allowed'` | The message displayed when an rc file is allowed. | +| `denied_msg` | `'denied'` | The message displayed when an rc file is denied. | +| `loaded_msg` | `'loaded'` | The message displayed when an rc file is loaded. | +| `unloaded_msg` | `'not loaded'` | The message displayed when an rc file is not loaded. | + +### Variables + +| Variable | Example | Description | +| -------- | ------------------- | --------------------------------------- | +| loaded | `loaded` | Whether the current rc file is loaded. | +| allowed | `denied` | Whether the current rc file is allowed. | +| rc_path | `/home/test/.envrc` | The current rc file path. | +| symbol | | Mirrors the value of option `symbol`. | +| style\* | `red bold` | Mirrors the value of option `style`. | + +*: This variable can only be used as a part of a style string + +### Example + +```toml +# ~/.config/starship.toml + +[direnv] +disabled = false +``` + ## Docker Context The `docker_context` module shows the currently active -- cgit v1.2.3