Last active
December 11, 2021 08:16
-
-
Save AirManH/41a77f61eca53fef3d77dacf1683fd18 to your computer and use it in GitHub Desktop.
Revisions
-
AirManH revised this gist
Dec 11, 2021 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,3 +36,4 @@ See also [[https://vim.fandom.com/wiki/Search_and_replace][this fandom vim wiki =\1= is the first backreference, =\2= is the second backreference, =\0= is the text matched by the entire pattern. - =\<= and =\>= to match the beginning and the end of a word. -
AirManH revised this gist
Dec 2, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ * vim and regex cheatsheet ** Search and Replace -
AirManH revised this gist
Dec 2, 2020 . 1 changed file with 7 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,11 +23,16 @@ See also [[https://vim.fandom.com/wiki/Search_and_replace][this fandom vim wiki *** Other - *Reuse* the matched pattern: 1. =:s/f/&/= =&= is the text that matches the search pattern. Example: =:s/[a-z]/&1/g=, add a =1= after each characte 2. =:s/\(a\)/\1/= =\(a\)= makes a backreference to =a=. =\1= is the first backreference, =\2= is the second backreference, =\0= is the text matched by the entire pattern. -
AirManH revised this gist
Dec 2, 2020 . 1 changed file with 9 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,6 +22,12 @@ See also [[https://vim.fandom.com/wiki/Search_and_replace][this fandom vim wiki *** Other - *Reuse* the matched pattern: 1. =:s/f/&/= =&= is the text that matches the search pattern Example: =:s/[a-z]/&1/g=, add a =1= after each characte 2. =:s/\(a\)/\1/= =\(a\)= makes a *backreference* to =a=. =\1= is the first backreference, =\2= is the second backreference, =\0= is the text matched by the entire pattern. -
AirManH revised this gist
Nov 20, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ * Cheatsheet about vim and regex ** Search and Replace -
AirManH created this gist
Nov 20, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ * Cheatsheat about vim and regex ** Search and Replace See also [[https://vim.fandom.com/wiki/Search_and_replace][this fandom vim wiki page]]. *** Basic: - =:s/find/replace/=, only search in current line, and replace the first matched pattern *** Search in a certain range - Default: only in current line - In all lines: =:%s/f/r/= - In selected *line*: =:'<,'>s/f/r/= - In selected *characters*: =:`<,`>s/f/r/= *** Repeat - Default: only first matched in given range - match every one: =:s/f/r/g= *** Other - *Reuse* the matched pattern: =:s/f/&/= =&= is the text that matches the search pattern Example: =:s/[a-z]/&1/g=, add a =1= after each character