mirror of
https://github.com/neovide/neovide.git
synced 2026-09-10 07:16:25 -04:00
feat(env): add NEOVIDE_CONFIG env var (#3010)
Some checks failed
Some checks failed
* 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:
parent
b39f9b85b8
commit
bad180d511
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue