pub struct AppSettings {Show 18 fields
pub config_version: u32,
pub workspace_config: Option<WorkspaceConfig>,
pub theme: String,
pub cache_dir: PathBuf,
pub history_dir: PathBuf,
pub key_bindings: KeyBindings,
pub autosave_interval_secs: u64,
pub leader_timeout_ms: u64,
pub leader: LeaderConfig,
pub use_nerd_fonts: bool,
pub editor_backend: EditorBackendSetting,
pub nvim_path: Option<PathBuf>,
pub default_sort_field: SortFieldSetting,
pub default_sort_order: SortOrderSetting,
pub journal_sort_field: SortFieldSetting,
pub journal_sort_order: SortOrderSetting,
pub group_directories: bool,
pub config_file: Option<PathBuf>,
/* private fields */
}Fields§
§config_version: u32§workspace_config: Option<WorkspaceConfig>§theme: String§cache_dir: PathBufAs written in the config file — may be relative, may start with ~.
history_dir: PathBufAs written in the config file — see Self::cache_dir.
key_bindings: KeyBindings§autosave_interval_secs: u64§leader_timeout_ms: u64Hesitation timeout (ms) before the which-key overlay reveals itself during a pending leader sequence. Sequences typed faster never wait.
leader: LeaderConfigLeader-tree customization: [leader.bind] sequence→action-id
overrides and [leader.labels] group captions. Applied over the
built-in tree.
use_nerd_fonts: bool§editor_backend: EditorBackendSetting§nvim_path: Option<PathBuf>§default_sort_field: SortFieldSetting§default_sort_order: SortOrderSetting§journal_sort_field: SortFieldSetting§journal_sort_order: SortOrderSetting§group_directories: bool§config_file: Option<PathBuf>Custom config file path. None means use the default location.
Not serialized — it’s a runtime-only override.
Implementations§
Source§impl AppSettings
impl AppSettings
Sourcepub fn default_workspace_suggestion() -> Option<PathBuf>
pub fn default_workspace_suggestion() -> Option<PathBuf>
Suggested directory for a first workspace (~/kimun-notes). None
when the home directory cannot be determined.
Sourcepub fn leader_tree(&self) -> LeaderNode
pub fn leader_tree(&self) -> LeaderNode
The leader tree with this config’s [leader] overrides applied — the
ONE constructor every surface (engine, which-key, cheatsheet, palette)
must use, so they can never disagree.
Source§impl AppSettings
impl AppSettings
pub fn theme_list(&self) -> Vec<Theme>
Sourcepub fn update_check(&self) -> bool
pub fn update_check(&self) -> bool
Whether the startup update check is enabled. Lives in GlobalConfig;
defaults to on when no workspace config exists yet. Single source for
the four read sites (startup, preferences, onboarding).
Sourcepub fn mouse(&self) -> bool
pub fn mouse(&self) -> bool
Whether kimün captures the mouse for in-app use; defaults on when no workspace config exists yet. Read at startup (main.rs) and in preferences.
pub fn save_to_disk(&self) -> Result<(), SettingsError>
pub fn load_from_disk() -> Result<Self, SettingsError>
pub fn load_from_file(path: PathBuf) -> Result<Self, SettingsError>
Sourcepub fn set_workspace_path(&mut self, name: &str, workspace_path: PathBuf)
pub fn set_workspace_path(&mut self, name: &str, workspace_path: PathBuf)
Points the selected workspace entry at workspace_path, flagging a
reindex when that actually changes where its notes are.
name is the entry to repoint; a name with no entry is a no-op.
Sourcepub fn clear_workspace(&mut self)
pub fn clear_workspace(&mut self)
Removes the active workspace entry so the user is prompted to choose a new one.
Only the currently active entry is removed; other workspace entries are
preserved. After this call, workspace_config remains Some but
get_current_workspace() returns None.
Deliberately leaves the index and history on disk: the caller for this
is a vault the app could not open (a case conflict it wants fixed), and
the user is expected to re-add the same workspace once they have. See
crate::settings::delete_artifacts for the deletion that goes with an
intentional “remove this workspace”.
Sourcepub fn resolve_workspace_path(&self) -> Option<SystemPath>
pub fn resolve_workspace_path(&self) -> Option<SystemPath>
Resolve the active workspace’s path. Returns None if no workspace is
configured.
pub fn set_theme(&mut self, theme: String)
pub fn report_indexed(&mut self)
pub fn needs_indexing(&self) -> bool
pub fn add_path_history(&mut self, note_path: &VaultPath)
pub fn current_workspace_name(&self) -> Option<String>
Sourcepub fn cache_dir_resolved(&self) -> &SystemPath
pub fn cache_dir_resolved(&self) -> &SystemPath
The directory workspace cache files live in.
Sourcepub fn history_dir_resolved(&self) -> &SystemPath
pub fn history_dir_resolved(&self) -> &SystemPath
The directory workspace history files live in.
Sourcepub fn index_for(&self, workspace_name: &str) -> IndexFile
pub fn index_for(&self, workspace_name: &str) -> IndexFile
The named workspace’s index file.
Returns the artifact, not a path: what the file is called, and that it
carries -wal/-shm siblings, is IndexFile’s business. Caller
must have already validated workspace_name via
kimun_core::nfs::filename::validate_filename.
Sourcepub fn history_for(&self, workspace_name: &str) -> HistoryFile
pub fn history_for(&self, workspace_name: &str) -> HistoryFile
The named workspace’s history file — the artifact, not a path, for the
same reason as Self::index_for. Caller must have already validated
workspace_name.
Sourcepub fn workspace_artifacts(
&self,
workspace_name: &str,
) -> (IndexFile, HistoryFile)
pub fn workspace_artifacts( &self, workspace_name: &str, ) -> (IndexFile, HistoryFile)
Everything on disk that belongs to the named workspace.
Must be read before the entry is dropped from workspace_config:
both file names come from its file_key, so removing the entry first
strands them under a name nothing can map back to a workspace. Pure and
cheap, so the caller can take these, release the settings lock, and do
the deleting outside it — see delete_artifacts.
Sourcepub fn current_last_paths(&self) -> Vec<VaultPath>
pub fn current_last_paths(&self) -> Vec<VaultPath>
Returns the last-visited paths for the current workspace.
Sourcepub fn yank_combos(&self) -> Vec<KeyCombo>
pub fn yank_combos(&self) -> Vec<KeyCombo>
The chords bound to ActionShortcuts::YankRow, for handing to a
SearchList so a rebinding
reaches the list surfaces. Empty when the user unbound it.
Sourcepub fn effective_theme_name(&self) -> String
pub fn effective_theme_name(&self) -> String
Name of the theme the app is effectively using: the configured name, or the default theme’s name when none is configured. Single owner of the empty-name fallback rule — use this instead of re-deriving it.
Trait Implementations§
Source§impl Clone for AppSettings
impl Clone for AppSettings
Source§fn clone(&self) -> AppSettings
fn clone(&self) -> AppSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AppSettings
impl Debug for AppSettings
Source§impl Default for AppSettings
impl Default for AppSettings
Source§impl<'de> Deserialize<'de> for AppSettings
impl<'de> Deserialize<'de> for AppSettings
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for AppSettings
impl PartialEq for AppSettings
Source§impl Serialize for AppSettings
impl Serialize for AppSettings
impl StructuralPartialEq for AppSettings
Auto Trait Implementations§
impl Freeze for AppSettings
impl RefUnwindSafe for AppSettings
impl Send for AppSettings
impl Sync for AppSettings
impl Unpin for AppSettings
impl UnsafeUnpin for AppSettings
impl UnwindSafe for AppSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more