0

Is it possible to integrate Artistic Style with Visual Studio 2010? It does a much better job of fixing mangled code indenting and styling than the include visual studio code formatter. Ideally a hotkey or something to apply it to the current file. I know how to apply it by hand but there must be a plugin or something available to help to do it automatically.

Kyle
  • 63
  • 6

3 Answers3

1

You can add external tools to the IDE. See the Tools menu. You can have Artistic Style format an entire file for you. It is a bit brittle, because you have to save the file before you run the external command.

You can bind a key stroke to the external command. Look at Tools.ExternalCommandN (where N is 1 to 24) in Tools -> Customize -> Keyboard.

Jörgen Sigvardsson
  • 4,839
  • 3
  • 28
  • 51
1

Visual Studio supports external tools: http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k%28VS.EXTERNALTOOLS%29&rd=true

Configuring it with $(ItemPath) as Arguments works just fine. You can add other options in front of it like that: -A12 $(ItemPath).

Patrick
  • 3,790
  • 1
  • 16
  • 12
0

There's now an "AStyle Extension" plugin for Visual Studio 2010/2012 that you can download and install via the built-in Visual Studio extension manager (Tools -> Extensions and Updates). It includes a configuration dialog that lets you control all the options.

There's more information on this plugin here:

http://visualstudiogallery.msdn.microsoft.com/2f3f04cd-2866-4e47-a671-d1cc9cc3fb02

Chris Kline
  • 2,249
  • 26
  • 32