Notepad++ Secrets: Editing Multiple Source Files

© 2012, Martin Rinehart

Right now there are over a dozen pages in the programmer's editor Notepad++ corner of this website, each with a heading that says "Notepad++ Supplemental Documentation: ..." Who wrote that? "Supplemental Documentation"? Ugh.

Yes, we've documented some of the less obvious parts of Notepad++ so "supplemental documentation" is a correct description. Sir Paul is a bass player, too. But we could say more! How about, "Features You Might Not Know"? No, too long. "Helpful Hints"? That's better, but not quite. We settled on "Secrets", as you've already seen.

It might just have stayed "Supplemental Documentation " except that Notepad++ made it dead simple to edit all the files at once. Here's what we did.

Find / Replace? Find in Files!

Choosing to Find-in-Files with Notepad++.

Specify the Change

Specifying a multi-file edit.

In Multiple Files, Carefully!

Specifying the files to edit.

Specifying that the case must match, and that you want whole words only both avoid inadvertent matches. (You change "dog" to "Fido", but you don't replace "dogma" with "Fidoma".)

Specifying that the change applies "In all sub-folders" selects the files you want. (This assumes that you have a well-organized set of folders. Your mania for neatness will reward you here!)

Let's Do It!

Edit the files.

Last Chance to Change Your Mind

One more chance before it gets done.

Final Thoughts

Backup before you Find in Files! Murphy's Law has not been repealed. And click the "Replace" (or "Find") tab after you "Find in Files" or your next Replace could be one you didn't plan.

We've found occasions to combine "Find in Files" with a regex "Search Mode". That can easily save you an hour of individual edits. This is powerful stuff. If you can grab a partner, this is a good place for pair programming. If you trash an otherwise ready-to-go set of files with a stupid Find in Files, do not blame your partner. Restore from backup and try again. (If you didn't back up, do not blame your partner. Look in the mirror.)


Feedback: MartinRinehart at gmail dot com.

# # #