diff options
Diffstat (limited to 'helix-core/src/lib.rs')
-rw-r--r-- | helix-core/src/lib.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/helix-core/src/lib.rs b/helix-core/src/lib.rs index b3ce3c47..dda9863b 100644 --- a/helix-core/src/lib.rs +++ b/helix-core/src/lib.rs @@ -44,6 +44,13 @@ pub(crate) fn find_first_non_whitespace_char(text: RopeSlice, line_num: usize) - None } +pub fn config_dir() -> std::path::PathBuf { + // TODO: allow env var override + let xdg_dirs = + xdg::BaseDirectories::with_prefix("helix").expect("Unable to find XDG directories!"); + xdg_dirs.get_config_home() +} + pub use ropey::{Rope, RopeSlice}; pub use tendril::StrTendril as Tendril; |