From 26205a2ac5e21053bd94a0925efcfca44c6f549b Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sun, 24 May 2026 03:37:41 +0300 Subject: feat: make navigate movement keybinds configurable refs #193 --- src/ui/keybind_help.rs | 20 ++++++++++++++++++-- src/ui/menus.rs | 11 ++++++++++- 2 files changed, 28 insertions(+), 3 deletions(-) (limited to 'src/ui') diff --git a/src/ui/keybind_help.rs b/src/ui/keybind_help.rs index c1f0fa74..21f4baed 100644 --- a/src/ui/keybind_help.rs +++ b/src/ui/keybind_help.rs @@ -69,8 +69,24 @@ pub(super) fn keybind_help_groups( "navigation", vec![ ("esc".to_string(), "back"), - ("↑ / ↓".to_string(), "workspace list"), - ("h j k l / arrows".to_string(), "move focus"), + ( + format!( + "{} / {}", + keybind_label(&kb.navigate.workspace_up), + keybind_label(&kb.navigate.workspace_down) + ), + "workspace list", + ), + ( + format!( + "{} / {} / {} / {} / left / right", + keybind_label(&kb.navigate.pane_left), + keybind_label(&kb.navigate.pane_down), + keybind_label(&kb.navigate.pane_up), + keybind_label(&kb.navigate.pane_right) + ), + "move focus", + ), ("tab / shift+tab".to_string(), "cycle pane"), ("enter".to_string(), "open workspace"), ("1..9".to_string(), "switch workspace"), diff --git a/src/ui/menus.rs b/src/ui/menus.rs index c37d08d6..b711358e 100644 --- a/src/ui/menus.rs +++ b/src/ui/menus.rs @@ -15,6 +15,10 @@ fn prefix_rhs_label(bindings: &crate::config::ActionKeybinds) -> String { .unwrap_or_else(|| "unset".to_string()) } +fn keybind_label(bindings: &crate::config::ActionKeybinds) -> String { + bindings.label().unwrap_or_else(|| "unset".to_string()) +} + fn render_bottom_bar(frame: &mut Frame, area: Rect, line: Line<'_>, bg: ratatui::style::Color) { frame.render_widget(Clear, area); let buf = frame.buffer_mut(); @@ -78,12 +82,17 @@ pub(super) fn render_navigate_overlay(app: &AppState, frame: &mut Frame, area: R let settings = prefix_rhs_label(&kb.settings); let goto = prefix_rhs_label(&kb.goto); let detach = prefix_rhs_label(&kb.detach); + let workspace_nav = format!( + "{} / {}", + keybind_label(&kb.navigate.workspace_up), + keybind_label(&kb.navigate.workspace_down) + ); let line = Line::from(vec![ Span::styled(" NAVIGATE ", mode_style), Span::raw(" "), Span::styled("esc", key), Span::styled(" back ", dim), - Span::styled("↑↓", key), + Span::styled(workspace_nav, key), Span::styled(" ws ", dim), Span::styled("⇥", key), Span::styled(" pane ", dim), -- cgit v1.2.3