Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sqlit/core/keymap.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ def _build_action_keys(self) -> list[ActionKeyDef]:
ActionKeyDef("W", "cursor_WORD_forward", "query_normal"),
ActionKeyDef("b", "cursor_word_back", "query_normal"),
ActionKeyDef("B", "cursor_WORD_back", "query_normal"),
# Unbound by default — users can bind in their keymap.json
# (typically "e"/"E"), but they must also rebind whatever
# `focus_explorer` action is currently using those keys.
ActionKeyDef("", "cursor_word_end", "query_normal"),
ActionKeyDef("", "cursor_WORD_end", "query_normal"),
ActionKeyDef("0", "cursor_line_start", "query_normal"),
ActionKeyDef("circumflex_accent", "cursor_first_non_blank", "query_normal"),
ActionKeyDef("dollar_sign", "cursor_line_end", "query_normal"),
Expand Down
2 changes: 2 additions & 0 deletions sqlit/domains/query/state/query_normal.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def _setup_actions(self) -> None:
self.allows("cursor_WORD_forward", help="Move to next WORD")
self.allows("cursor_word_back", help="Move to previous word")
self.allows("cursor_WORD_back", help="Move to previous WORD")
self.allows("cursor_word_end", help="Move to end of word")
self.allows("cursor_WORD_end", help="Move to end of WORD")
self.allows("cursor_first_non_blank", help="Move to first non-blank")
self.allows("cursor_line_start", help="Move to line start")
self.allows("cursor_line_end", help="Move to line end")
Expand Down
8 changes: 8 additions & 0 deletions sqlit/domains/query/ui/mixins/query_editing_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ def action_cursor_WORD_back(self: QueryMixinHost) -> None:
"""Move cursor to previous WORD (B)."""
self._move_with_motion("B")

def action_cursor_word_end(self: QueryMixinHost) -> None:
"""Move cursor to end of word (e). Unbound by default."""
self._move_with_motion("e")

def action_cursor_WORD_end(self: QueryMixinHost) -> None:
"""Move cursor to end of WORD (E). Unbound by default."""
self._move_with_motion("E")

def action_cursor_first_non_blank(self: QueryMixinHost) -> None:
"""Move cursor to first non-whitespace character (^)."""
self._move_with_motion("^")
Expand Down
Loading