feat(tui): add Emacs keymap profile with runtime switching
- Introduce built‑in Emacs keymap (`keymap_emacs.toml`) alongside existing Vim layout. - Add `ui.keymap_profile` and `ui.keymap_path` configuration options; persist profile changes via `:keymap` command. - Expose `KeymapProfile` enum (Vim, Emacs, Custom) and integrate it throughout state, UI rendering, and help overlay. - Extend command registry with `keymap.set_vim` and `keymap.set_emacs` to allow profile switching. - Update help overlay, command specs, and README to reflect new keybindings and profile commands. - Adjust `Keymap::load` to honor preferred profile, custom paths, and fallback logic.
This commit is contained in:
@@ -1584,6 +1584,8 @@ pub struct UiSettings {
|
||||
pub show_timestamps: bool,
|
||||
#[serde(default = "UiSettings::default_icon_mode")]
|
||||
pub icon_mode: IconMode,
|
||||
#[serde(default = "UiSettings::default_keymap_profile")]
|
||||
pub keymap_profile: Option<String>,
|
||||
#[serde(default)]
|
||||
pub keymap_path: Option<String>,
|
||||
}
|
||||
@@ -1654,6 +1656,10 @@ impl UiSettings {
|
||||
IconMode::Auto
|
||||
}
|
||||
|
||||
fn default_keymap_profile() -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
fn deserialize_role_label_mode<'de, D>(
|
||||
deserializer: D,
|
||||
) -> std::result::Result<RoleLabelDisplay, D::Error>
|
||||
@@ -1723,6 +1729,7 @@ impl Default for UiSettings {
|
||||
render_markdown: Self::default_render_markdown(),
|
||||
show_timestamps: Self::default_show_timestamps(),
|
||||
icon_mode: Self::default_icon_mode(),
|
||||
keymap_profile: Self::default_keymap_profile(),
|
||||
keymap_path: None,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user