Add Vim search motions to the composer (#41586)

## What changed

- Add draft-local forward and backward literal search with `/` and `?`, plus
  wrapped repeat navigation with `n` and `N`.
- Support search motions after delete, change, and yank operators, while keeping
  queries separate from the draft and skipping atomic elements and partial
  grapheme matches.
- Render and edit the query in the composer footer, highlight matches, and add
  configurable `tui.keymap.vim_search` bindings to the keymap picker and schema.

## Testing

- Cover navigation, wrapping, operator composition, repeat behavior, Unicode
  graphemes, atomic elements, query editing, paste handling, and rendering.

GitOrigin-RevId: 087b080ff8fd74e48456c6b899c07ea5eed38e0c
This commit is contained in:
Benjamin Carlsson authored and copyberry committed 2026-08-30 00:42:00 +00:00
1 parent b8c86376a2
commit 63d213884d
27 files changed
+745 -42

No files matched your search

+58
View File
@@ -3926,6 +3926,12 @@
"select_inner_text_object": null,
"yank_line": null
},
"vim_search": {
"backward": null,
"forward": null,
"next": null,
"previous": null
},
"vim_text_object": {
"backtick": null,
"big_word": null,
@@ -4754,6 +4760,19 @@
"yank_line": null
}
},
"vim_search": {
"allOf": [
{
"$ref": "#/definitions/TuiVimSearchKeymap"
}
],
"default": {
"backward": null,
"forward": null,
"next": null,
"previous": null
}
},
"vim_text_object": {
"allOf": [
{
@@ -5405,6 +5424,45 @@
},
"type": "object"
},
"TuiVimSearchKeymap": {
"additionalProperties": false,
"description": "Search motions shared by Vim normal and operator-pending input.",
"properties": {
"backward": {
"allOf": [
{
"$ref": "#/definitions/KeybindingsSpec"
}
],
"description": "Search backward in the active buffer (`?`)."
},
"forward": {
"allOf": [
{
"$ref": "#/definitions/KeybindingsSpec"
}
],
"description": "Search forward in the active buffer (`/`)."
},
"next": {
"allOf": [
{
"$ref": "#/definitions/KeybindingsSpec"
}
],
"description": "Repeat the accepted search (`n`)."
},
"previous": {
"allOf": [
{
"$ref": "#/definitions/KeybindingsSpec"
}
],
"description": "Repeat in the opposite direction (`N`)."
}
},
"type": "object"
},
"TuiVimTextObjectKeymap": {
"additionalProperties": false,
"description": "Vim text-object keybindings for modal editing inside text areas.",