Add Vim character find and till motions (#40785)

## What changed

- Add line-local `f`, `F`, `t`, and `T` motions to Vim normal mode.
- Support the motions with `c`, `d`, and `y`, including dot-repeat for changes.
- Expose separate configurable normal-mode and operator-motion bindings, while preserving existing custom keymaps that use the new defaults.
- Keep character targeting aligned to extended grapheme boundaries and skip embedded composer elements.

## Testing

- Cover forward and backward motion and operator ranges, missing and adjacent targets, cancellation, dot-repeat, custom bindings, shifted terminal key events, grapheme clusters, and embedded elements.

GitOrigin-RevId: 2610cf9a13538d9ae9b890c01417ca25316c1d60
This commit is contained in:
Benjamin Carlsson
2026-08-26 04:18:49 +00:00
committed by copyberry
parent 25a6e316c8
commit 98ee29c7cd
16 changed files with 703 additions and 13 deletions
+8
View File
@@ -285,6 +285,10 @@ define_runtime_action_bindings! {
move_word_end,
move_line_start,
move_line_end,
find_forward,
find_backward,
till_forward,
till_backward,
delete_char,
replace_char,
repeat_last_change,
@@ -310,6 +314,10 @@ define_runtime_action_bindings! {
motion_word_end,
motion_line_start,
motion_line_end,
motion_find_forward,
motion_find_backward,
motion_till_forward,
motion_till_backward,
select_inner_text_object,
select_around_text_object,
cancel,
+1 -1
View File
@@ -25,7 +25,7 @@ use crossterm::event::KeyModifiers;
use std::time::Duration;
use tokio::time::Instant;
const FIRST_DISPATCH_FUNCTION_KEY: u8 = 128;
const FIRST_DISPATCH_FUNCTION_KEY: u8 = codex_config::types::MAX_FUNCTION_KEY + 1;
const LAST_DISPATCH_FUNCTION_KEY: u8 = u8::MAX;
const LIST_RESERVED_BINDINGS: &[(&str, KeyBinding)] = &[
("cancel", ctrl(KeyCode::Char('c'))),