Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio changing the way Ctrl-K-D works

In Visual Studio (I'm using 2012), is there any way of editing the way that Ctrl-K-D combinations handles its Auto-Formatting?

I don't mean changing what these key combinations do, I mean extending the way the auto-formatting is done.

The way it handles tabbing, etc are fine, I'm more concerned with white-space.

We're using a plugin that makes it easy to align variable properties, making them easy to read. Like so:

var test            = 'whatever',
    another         = 'this one',
    alignedProperly = 'yay';

Seems nitt-picky yes, but in really large Object literals it's so helpful to be able to read them!

Has anyone found where the rules for auto-formatting are located, and if they can be edited/changed? (Can't find them anywhere in the options!)

like image 621
Mark Pieszak - Trilon.io Avatar asked Mar 07 '13 20:03

Mark Pieszak - Trilon.io


1 Answers

Are you looking for:

Tools > Options > Text Editor > C# > Formatting > Spacing > Set other spacing options > Ignore space in declaration statements

This is in VS 2010, but i guess 2012 should be somewhat similar.

like image 96
publicgk Avatar answered Sep 21 '22 17:09

publicgk