From 3e3b231ee7b2889d0b4afa3b4db0af938a186a3d Mon Sep 17 00:00:00 2001 From: Mate Soos Date: Mon, 9 Feb 2026 23:22:41 +0100 Subject: [PATCH] Allow "e"button UPdate Update --- sqlit/core/keymap.py | 5 +++-- sqlit/domains/query/state/query_normal.py | 1 + sqlit/domains/query/ui/mixins/query_editing_cursor.py | 4 ++++ sqlit/domains/shell/state/machine.py | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sqlit/core/keymap.py b/sqlit/core/keymap.py index fb2ef92..0eba273 100644 --- a/sqlit/core/keymap.py +++ b/sqlit/core/keymap.py @@ -187,7 +187,7 @@ def get_action_keys(self) -> list[ActionKeyDef]: def _build_leader_commands(self) -> list[LeaderCommandDef]: return [ # View - LeaderCommandDef("e", "toggle_explorer", "Toggle Explorer", "View"), + LeaderCommandDef("E", "toggle_explorer", "Toggle Explorer", "View"), LeaderCommandDef("f", "toggle_fullscreen", "Toggle Maximize", "View"), # Connection LeaderCommandDef("c", "show_connection_picker", "Connect", "Connection"), @@ -370,8 +370,9 @@ def _build_action_keys(self) -> list[ActionKeyDef]: ActionKeyDef("escape", "exit_insert_mode", "query_insert"), ActionKeyDef("ctrl+enter", "execute_query_insert", "query_insert"), ActionKeyDef("tab", "autocomplete_accept", "query_insert"), + ActionKeyDef("e", "cursor_word_end", "query_normal"), # Navigation - ActionKeyDef("e", "focus_explorer", "navigation"), + ActionKeyDef("E", "focus_explorer", "navigation"), ActionKeyDef("q", "focus_query", "navigation"), ActionKeyDef("r", "focus_results", "navigation"), # Query (autocomplete) diff --git a/sqlit/domains/query/state/query_normal.py b/sqlit/domains/query/state/query_normal.py index a43febf..91e8b2b 100644 --- a/sqlit/domains/query/state/query_normal.py +++ b/sqlit/domains/query/state/query_normal.py @@ -29,6 +29,7 @@ def _setup_actions(self) -> None: self.allows("cursor_down", help="Move cursor down") self.allows("cursor_word_forward", help="Move to next word") self.allows("cursor_WORD_forward", help="Move to next WORD") + self.allows("cursor_word_end", help="Move to word end") self.allows("cursor_word_back", help="Move to previous word") self.allows("cursor_WORD_back", help="Move to previous WORD") self.allows("cursor_line_start", help="Move to line start") diff --git a/sqlit/domains/query/ui/mixins/query_editing_cursor.py b/sqlit/domains/query/ui/mixins/query_editing_cursor.py index 05a252d..782cd5b 100644 --- a/sqlit/domains/query/ui/mixins/query_editing_cursor.py +++ b/sqlit/domains/query/ui/mixins/query_editing_cursor.py @@ -99,6 +99,10 @@ def action_cursor_WORD_forward(self: QueryMixinHost) -> None: """Move cursor to next WORD (W).""" self._move_with_motion("W") + def action_cursor_word_end(self: QueryMixinHost) -> None: + """Move cursor to end of word (e).""" + self._move_with_motion("e") + def action_cursor_word_back(self: QueryMixinHost) -> None: """Move cursor to previous word (b).""" self._move_with_motion("b") diff --git a/sqlit/domains/shell/state/machine.py b/sqlit/domains/shell/state/machine.py index e9f4e4b..c40ba9e 100644 --- a/sqlit/domains/shell/state/machine.py +++ b/sqlit/domains/shell/state/machine.py @@ -164,7 +164,7 @@ def binding(key: str, desc: str, indent: int = 4) -> str: # NAVIGATION # ═══════════════════════════════════════════════════════════════════ lines.append(section("NAVIGATION")) - lines.append(binding("e", "Focus Explorer pane")) + lines.append(binding("E", "Focus Explorer pane")) lines.append(binding("q", "Focus Query pane")) lines.append(binding("r", "Focus Results pane")) lines.append(binding(leader_key, "Open command menu")) @@ -223,6 +223,7 @@ def binding(key: str, desc: str, indent: int = 4) -> str: lines.append(subsection("Vim Motions:")) lines.append(binding("h/j/k/l", "Cursor left/down/up/right")) lines.append(binding("w/W", "Word forward")) + lines.append(binding("e", "Word end")) lines.append(binding("b/B", "Word backward")) lines.append(binding("0/$", "Line start/end")) lines.append(binding("gg/G", "File start/end"))