feat(env): add NEOVIDE_CONFIG env var (#3010)
Some checks failed
Lint Website / Lint website (push) Has been cancelled
Build and Publish Website / Build Website (push) Has been cancelled
Build and Publish Website / Generate Sitemap (push) Has been cancelled
Build and Publish Website / Publish Website (push) Has been cancelled

* feat(env): add NEOVIDE_CONFIG env var

* docs(env): feature the NEOVIDE_CONFIG environment variable

---------

Co-authored-by: Artur Manuel <balkenix@outlook.com>
This commit is contained in:
Artur Manuel 2025-03-09 13:24:33 +00:00 committed by GitHub
parent b39f9b85b8
commit bad180d511
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 3 deletions

View file

@ -28,9 +28,15 @@ fn neovide_config_dir() -> PathBuf {
}
pub fn config_path() -> PathBuf {
let mut config_path = neovide_config_dir();
config_path.push(CONFIG_FILE);
config_path
env::var("NEOVIDE_CONFIG")
.ok()
.map(PathBuf::from)
.filter(|path| path.exists() && path.is_file())
.unwrap_or_else(|| {
let mut path = neovide_config_dir();
path.push(CONFIG_FILE);
path
})
}
#[derive(Debug, Deserialize, Default, Clone)]

View file

@ -20,6 +20,10 @@ There are two types of settings:
| macOS | `$XDG_CONFIG_HOME/neovide/config.toml` or `$HOME/.config/neovide/config.toml` | `/Users/Alice/Library/Application Support/neovide/config.toml` |
| Windows | `{FOLDERID_RoamingAppData}/neovide/config.toml` | `C:\Users\Alice\AppData\Roaming/neovide/config.toml` |
You may use a different location by modifying the `$NEOVIDE_CONFIG` environment variable to be
a full path to a `config.toml` file (doesn't explicitly have to be called `config.toml`
however.)
## Available settings
Settings currently available in the config file with default values: