Do you know of an editor plugin that does this reliably? I’ve tried a few in vim that end up being more trouble than they’re worth.
The hurestics can get tricky, especially when different file types have different kinds of indentation (got Makefiles in your otherwise two-space indented project?) or in projects that include vendored dependencies.
I dont know of such a plugin. But Im working on a editor that doesn't allow you to edit indentation.
The trickiest part is for the editor to know which parts of the file it should touch when you for example insert a code block bracket. And should the diff in SCM now include the whole block, or just the lines where you inserted { and }. And also languages like Python where white space matters.