Editor to match brackets when constructing queries

Can you give a suggestion for a text editor that will help match brackets? Ideally, I want to construct queries over multiple lines in the editor, but then copy-paste it as a single line when pasting it into the mongo shell.