Visual Studio changing the way Ctrl-K-D works

强颜欢笑 提交于 2019-12-12 08:23:32

问题


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!)


回答1:


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.




回答2:


In VS 2017:

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



来源:https://stackoverflow.com/questions/15281099/visual-studio-changing-the-way-ctrl-k-d-works

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!