Sync Block Edit Sync Block Edit

The free Sync Block Edit extension lets you easily update duplicate blocks of text in multiple files from Visual Studio 2012, 2013, 2015 and 2017. It performs multiline search and replace in Visual Studio with you only pointing what changes to propagate.

It is undesirable, but often necessary to have duplicate blocks of text in multiple files. For example, Google Analytics tracking code in html files or copyright notices in code files. When you need to update this text, sometime you can do it with a simple search and replace. But when you want to make sure no other text is changed or when you want to add or remove lines, multiline search and replace is necessary. Sync Block Edit hides all the complexity of writing multiline find and replace patterns from you.

If your text is already enclosed with distinct begin and end signature lines, just make your changes in one of the files, select the block and click the Sync Update Block button from the Sync Block Edit toolbar:

Update Text dialog in Visual Studio 2012

In the Update Text dialog, begin and end lines are automatically filled. You select which files you want to update (target) and click Update. (Keeping files open lets you undo the changes, as usual.) In all files the text between the begin and end lines will be replaced with the selected text from the active document.

If your block in not yet enclosed, it is recommended to add distinct begin and end signature lines before modification. Select the block in one of the files and click the Sync Create Block button from the Sync Block Edit toolbar:

Create Block dialog in Visual Studio 2012

In the Create Block dialog enter begin and end lines. Select which files you want to update and click Create. In all files this text block will be enclosed with the begin and end lines. After that you can update the block as described above.

Known issues with Visual Studio find and replace related to Sync Block Edit:
Find and Replace dialog regex replacement can't escape a "$" symbol
All Open Documents Option in Find/Repace Dialog Does not work for SQL documents (Database Projects)

Sync Block Edit v1.3 - January 30, 2017. Download Now

 

Organize Visual Studio tabs with Tabs Studio add-in