From dc00b6ceea2d04b6a0e58c09dc2d65d0a8aadb51 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Thu, 6 Nov 2025 03:36:19 +0100 Subject: [PATCH] fix vim search --- writing/vim/{search.md => subs.md} | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) rename writing/vim/{search.md => subs.md} (69%) diff --git a/writing/vim/search.md b/writing/vim/subs.md similarity index 69% rename from writing/vim/search.md rename to writing/vim/subs.md index 386ac2d..f5614f2 100644 --- a/writing/vim/search.md +++ b/writing/vim/subs.md @@ -1,6 +1,6 @@ --- -title: "vim search" -tags: [ "vim", "search" ] +title: "find and replace" +tags: [ "vim", "search", "replace", "find" ] requires: [ "vim basics" ] --- Search for the next and or previous occurrence of the word under your cursor with `*` and `#`. @@ -9,7 +9,11 @@ Search and replace the first 'one' found with 'two': `:%s/one/two/` -Same, but replace 'one' globally: +Run the last substitution globally: + +`g&` + +Same, but just replace 'one' globally: `:%s/one/two/g`