From d099db4ff5c856a07e2f694244624ca8e3b4b531 Mon Sep 17 00:00:00 2001 From: az5112 Date: Sun, 4 Dec 2022 14:18:03 +0100 Subject: [PATCH] Add a hint about interactive replace --- VIMTOKAK | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/VIMTOKAK b/VIMTOKAK index d2395e5e..3f2ea955 100644 --- a/VIMTOKAK +++ b/VIMTOKAK @@ -26,17 +26,26 @@ copy a line: global replace: * vim: :%s/word/replacement - * kak: %swordcreplacement + * kak: %swordcreplacement, Explanation: '%' selects the entire buffer, 's' opens a prompt for a regex, validates the regex and replaces the selection with one per match (hence all occurences of "word" are selected). 'c' deletes -the selection contents and enters insert mode where "replacement" is typed, -and goes back to normal mode. +the selection contents and enters insert mode where "replacement" is +typed, and goes back to normal mode. The final ',' gets rid of +multiple cursors. Note that the Kakoune version is one key less, and is not a special feature per se, but just a nice way Kakoune features work together. +global interactive replace: + * vim: :%s/word/replacement/gc + and then keep pressing 'y' to accept the change or 'n' to reject. + * kak: /wordcreplacement + and then press 'n' to search for the next occurence and either '.' + to redo the last insert operation (that is replace 'word' with + 'replacement') or 'n' to go to the next match. + replace in current curly brace block: * vim: viB:s/word/replacement * kak: Bswordcreplacement