Skip to content

Instantly share code, notes, and snippets.

@Integralist
Last active September 4, 2025 05:56
Show Gist options
  • Select an option

  • Save Integralist/8d01300efcd2006c69e8b9492c0eada8 to your computer and use it in GitHub Desktop.

Select an option

Save Integralist/8d01300efcd2006c69e8b9492c0eada8 to your computer and use it in GitHub Desktop.
Vim: search and replace content using native vim cdo and cfdo commands #vim #replace #macro #quickfix
@juanramirezc2
Copy link

Awesome notes πŸ‘ Now I understand the difference between cdo and cfdo.
Thank you

@miltonkowalewski
Copy link

πŸ‘

@HarimbolaSantatra
Copy link

Thanks!

@morzel85
Copy link

morzel85 commented Oct 31, 2024

Just mind that if you want to really change all instances (in case there's many in a line) you might need a /g flag (depending on gdefault option). So run: :cfdo %s/foo/bar/g

@krehwell
Copy link

krehwell commented Jan 9, 2025

2025 and still the best explanation! πŸ‘

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