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`