2022-04-11 23:50:44 +00:00
|
|
|
mod keymap_file;
|
2023-05-10 01:14:42 +00:00
|
|
|
mod settings_file;
|
|
|
|
mod settings_store;
|
2022-04-11 22:22:18 +00:00
|
|
|
|
2023-06-06 18:46:46 +00:00
|
|
|
use rust_embed::RustEmbed;
|
|
|
|
use std::{borrow::Cow, str};
|
|
|
|
use util::asset_str;
|
|
|
|
|
|
|
|
pub use keymap_file::KeymapFile;
|
2023-05-10 01:14:42 +00:00
|
|
|
pub use settings_file::*;
|
2023-05-10 17:25:49 +00:00
|
|
|
pub use settings_store::{Setting, SettingsJsonSchemaParams, SettingsStore};
|
2022-04-11 23:50:44 +00:00
|
|
|
|
2023-06-06 18:46:46 +00:00
|
|
|
#[derive(RustEmbed)]
|
|
|
|
#[folder = "../../assets"]
|
|
|
|
#[include = "settings/*"]
|
|
|
|
#[include = "keymaps/*"]
|
|
|
|
#[exclude = "*.DS_Store"]
|
|
|
|
pub struct SettingsAssets;
|
2023-05-03 02:56:45 +00:00
|
|
|
|
2023-06-06 01:09:42 +00:00
|
|
|
pub fn default_settings() -> Cow<'static, str> {
|
2023-06-06 18:46:46 +00:00
|
|
|
asset_str::<SettingsAssets>("settings/default.json")
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn default_keymap() -> Cow<'static, str> {
|
|
|
|
asset_str::<SettingsAssets>("keymaps/default.json")
|
2023-06-06 01:09:42 +00:00
|
|
|
}
|
|
|
|
|
2023-06-06 18:46:46 +00:00
|
|
|
pub fn vim_keymap() -> Cow<'static, str> {
|
|
|
|
asset_str::<SettingsAssets>("keymaps/vim.json")
|
2023-06-06 01:09:42 +00:00
|
|
|
}
|
|
|
|
|
2023-06-06 18:46:46 +00:00
|
|
|
pub fn initial_user_settings_content() -> Cow<'static, str> {
|
|
|
|
asset_str::<SettingsAssets>("settings/initial_user_settings.json")
|
2023-06-06 01:09:42 +00:00
|
|
|
}
|
|
|
|
|
2023-06-06 18:46:46 +00:00
|
|
|
pub fn initial_local_settings_content() -> Cow<'static, str> {
|
|
|
|
asset_str::<SettingsAssets>("settings/initial_local_settings.json")
|
2023-02-25 00:43:34 +00:00
|
|
|
}
|