mirror of https://github.com/CrimsonTome/tldr.git
vim: simplify substitution in whole file
parent
9ec0ab7445
commit
37fa82919b
|
@ -23,9 +23,9 @@
|
||||||
|
|
||||||
`<Esc>/{{search_pattern}}<Enter>`
|
`<Esc>/{{search_pattern}}<Enter>`
|
||||||
|
|
||||||
- Perform a regex substitution in the whole file (from the start, `1`, to the end, `$`):
|
- Perform a regex substitution in the whole file (from the start to the end(% holds the file name)):
|
||||||
|
|
||||||
`<Esc>:1,$s/{{pattern}}/{{replacement}}/g<Enter>`
|
`<Esc>:%/{{pattern}}/{{replacement}}/g<Enter>`
|
||||||
|
|
||||||
- Save (write) the file, and quit:
|
- Save (write) the file, and quit:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue