1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-06-05 22:06:03 +02:00

vim: simplify substitution in whole file

This commit is contained in:
Max Strübing 2017-10-19 14:38:46 +02:00
parent 9ec0ab7445
commit 37fa82919b

View file

@ -23,9 +23,9 @@
`<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: