pub struct ConfigPaths;Expand description
Configuration path utilities.
Uses reovim-arch::dirs for platform-agnostic path resolution.
Follows XDG Base Directory Specification on Unix.
§Environment Variable Overrides
All paths can be overridden via environment variables for worktree isolation and testing:
| Variable | Overrides | Purpose |
|---|---|---|
REOVIM_CONFIG_DIR | config_dir() | User config (modules.toml, profiles) |
REOVIM_DATA_DIR | data_dir() | Runtime data (.so modules, lock files, logs) |
REOVIM_CACHE_DIR | cache_dir() | Cache (derived from data if unset) |
Resolution order: $REOVIM_*_DIR > XDG/platform default.
Implementations§
Source§impl ConfigPaths
impl ConfigPaths
Sourcepub fn config_dir() -> Result<PathBuf, ConfigError>
pub fn config_dir() -> Result<PathBuf, ConfigError>
Get the reovim config directory.
Resolution: $REOVIM_CONFIG_DIR > $XDG_CONFIG_HOME/reovim > ~/.config/reovim
§Errors
Returns ConfigError::PathError if the config directory cannot be determined
and no env override is set.
Sourcepub fn data_dir() -> Result<PathBuf, ConfigError>
pub fn data_dir() -> Result<PathBuf, ConfigError>
Get the reovim data directory.
Resolution: $REOVIM_DATA_DIR > $XDG_DATA_HOME/reovim > ~/.local/share/reovim
§Errors
Returns ConfigError::PathError if the data directory cannot be determined
and no env override is set.
Sourcepub fn cache_dir() -> Result<PathBuf, ConfigError>
pub fn cache_dir() -> Result<PathBuf, ConfigError>
Get the reovim cache directory.
Resolution: $REOVIM_CACHE_DIR > $XDG_CACHE_HOME/reovim > ~/.cache/reovim
§Errors
Returns ConfigError::PathError if the cache directory cannot be determined
and no env override is set.
Sourcepub fn config_file() -> Result<PathBuf, ConfigError>
pub fn config_file() -> Result<PathBuf, ConfigError>
Get the path to the main config file.
Returns {config_dir}/config.toml
§Errors
Returns ConfigError::PathError if the config directory cannot be determined.
Sourcepub fn profiles_dir() -> Result<PathBuf, ConfigError>
pub fn profiles_dir() -> Result<PathBuf, ConfigError>
Get the profiles directory.
Returns {config_dir}/profiles/
§Errors
Returns ConfigError::PathError if the config directory cannot be determined.