From 53916fc3f7dcbefd90e3d0340a2a8f32bf331d1d Mon Sep 17 00:00:00 2001 From: Federico Igne Date: Sun, 28 Jan 2024 01:22:52 +0100 Subject: feat: add plain search functionality (with history) --- lib/command.ml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'lib/command.ml') diff --git a/lib/command.ml b/lib/command.ml index 9ab36f6..ac1dbf1 100644 --- a/lib/command.ml +++ b/lib/command.ml @@ -14,6 +14,8 @@ type operation = | Paste_after | Erase_before | Erase_after + | Search + | Search_rev type scope = Line | To_bol | To_eol | Down | Left | Right | Up @@ -70,7 +72,18 @@ let to_scope = function let is_simple_movement k = List.mem ~equal:Poly.equal simple_movements k let instant_operation = - [ Key 'C'; Key 'D'; Key 'Y'; Key 'J'; Key 'P'; Key 'X'; Key 'p'; Key 'x' ] + [ + Key 'C'; + Key 'D'; + Key 'Y'; + Key 'J'; + Key 'n'; + Key 'N'; + Key 'P'; + Key 'X'; + Key 'p'; + Key 'x'; + ] let chord_operation = [ Key 'c'; Key 'd'; Key 'y' ] @@ -79,6 +92,8 @@ let to_op = function | Key 'c' | Key 'C' -> Change | Key 'd' | Key 'D' -> Delete | Key 'y' | Key 'Y' -> Yank + | Key 'n' -> Search + | Key 'N' -> Search_rev | Key 'p' -> Paste_after | Key 'P' -> Paste_before | Key 'x' -> Erase_after -- cgit v1.2.3