1

So, I'm trying to create my own code formatting since the way Visual Studio auto-formats doesn't work exactly how I want. I was able to get the exact code format I wanted using UniversalIndentGUI. However, I don't know how to (or if there's a way to) integrate my format with Visual Studio.

For now, I can copy a file from Visual Studio into UniversalIndentGUI and then select "Live Preview" and then copy it back into Visual Studio.

I feel like there's a better way to do this. Ideally, I'd be able to select "format" in Visual Studio and have it automatically format my code the way I want it to.

Is there any way I can do this? Is there at least a better way than copying my code into UniversalIndentGUI and then back into Visual Studio?

Casey Patton
  • 4,021
  • 9
  • 41
  • 54

1 Answers1

1

Visual Studio has some code formatting options, and a button to do it, but I don't know if there are plugins to control how that happens.

I do know that UniversalIndentGUI can produce a script to format all files in a directory (with a given extension), and Visual Studio can notice modified files and reload. Creating your formatting rules, exporting a script, then occasionally running that (as a task in VS, through a plugin, or manually) will be a functional workaround.

ssube
  • 47,010
  • 7
  • 103
  • 140
  • thanks for the advice. Could you explain running the script as a task in Visual Studio a little bit more? I'm not sure what that means. – Casey Patton Sep 01 '11 at 23:56
  • I'm not totally sure how you *should* do it, but I've seen things like doxygen set up as the build command for an empty project. If you provide the formatting script with the right command line options, you should be able to do that same thing, and just "build" the project to run it. – ssube Sep 02 '11 at 00:17