Skip to content

Latest commit

 

History

History
43 lines (25 loc) · 1.16 KB

README.md

File metadata and controls

43 lines (25 loc) · 1.16 KB

The Cdo plugin is now deprecated. Vim 8 adds almost identical native :cdo and :ldo commands, with additional functionality.


Cdo

Example: Find every instance of foo in the working directory and replace it with bar.

:grep foo
:Cdo s/foo/bar/c | update

Commands

:Cdo [command]

    Runs the same command over every entry in the quickfix list.

:Ldo [command]

    Runs the same command over every entry in the location list.

:Cdo/c [command]

    Just like |:Cdo|, but asks for confirmation before changing each file.

:Ldo/c [command]

    Just like |:Ldo|, but asks for confirmation before changing each file.

Setup

In order for :Cdo to function, you must add the following line to your .vimrc file:

set hidden

Set hidden allows the buffers to stay open while :Cdo makes changes to each file in the list.

Credits

Cdo was written by Peter Jaros (@peeja), with contributions from Danielle Sucher (@DanielleSucher).