use crate::types::KeyBinding;
fn kb(key: &str, action: &str) -> KeyBinding {
KeyBinding {
key: key.to_string(),
action: action.to_string(),
}
}
#[cfg(target_os = "macos")]
pub fn layer_chords() -> Vec<KeyBinding> {
vec![
kb("F5", "reload_config"),
kb("F12", "open_settings"),
kb("CmdOrCtrl+F", "toggle_search"),
kb("CmdOrCtrl+I", "toggle_ai_inspector"),
kb("Shift+PageUp", "scroll_up_page"),
kb("Shift+PageDown", "scroll_down_page"),
kb("Shift+Home", "scroll_to_top"),
kb("Shift+End", "scroll_to_bottom"),
kb("Cmd+Shift+Up", "scroll_to_previous_mark"),
kb("Cmd+Shift+Down", "scroll_to_next_mark"),
kb("Cmd+Up", "scroll_to_previous_mark"),
kb("Cmd+Down", "scroll_to_next_mark"),
kb("Ctrl+L", "clear_screen"),
kb("Ctrl+Comma", "cycle_cursor_style"),
kb("Ctrl+Tab", "next_tab"),
kb("Ctrl+Shift+Tab", "prev_tab"),
kb("CmdOrCtrl+Plus", "increase_font_size"),
kb("CmdOrCtrl+Shift+_", "decrease_font_size"),
]
}
#[cfg(not(target_os = "macos"))]
pub fn layer_chords() -> Vec<KeyBinding> {
vec![
kb("F5", "reload_config"),
kb("F12", "open_settings"),
kb("Ctrl+Shift+F", "toggle_search"),
kb("Ctrl+Shift+I", "toggle_ai_inspector"),
kb("Shift+PageUp", "scroll_up_page"),
kb("Shift+PageDown", "scroll_down_page"),
kb("Shift+Home", "scroll_to_top"),
kb("Shift+End", "scroll_to_bottom"),
kb("Super+Up", "scroll_to_previous_mark"),
kb("Super+Down", "scroll_to_next_mark"),
kb("Ctrl+L", "clear_screen"),
kb("Ctrl+Comma", "cycle_cursor_style"),
kb("Ctrl+Tab", "next_tab"),
kb("Ctrl+Shift+Tab", "prev_tab"),
kb("Ctrl+Shift+Plus", "increase_font_size"),
kb("Ctrl+Shift+_", "decrease_font_size"),
]
}