Skip to content

Instantly share code, notes, and snippets.

@Guitsmstr
Created November 28, 2021 17:07
Show Gist options
  • Save Guitsmstr/720a38aebff591597d2a8bba115ecd11 to your computer and use it in GitHub Desktop.
Save Guitsmstr/720a38aebff591597d2a8bba115ecd11 to your computer and use it in GitHub Desktop.
replace coincidences vim #vim #replace

Replace All:

:%s/foo/bar/g

Find each occurrence of 'foo' (in all lines), and replace it with 'bar'.

For specific lines:

:6,10s/foo/bar/g

Change each 'foo' to 'bar' for all lines from line 6 to line 10 inclusive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment