简体   繁体   English

更改VS2010文本格式

[英]Changing VS2010 text formatting

I am looking for ac# formatting which will do(like in Eclipse): 我正在寻找将要做的ac#格式化(就像在Eclipse中一样):

f(){
}

instead of 代替

f()
{
}

I have checked tools->options formatting but could not find it. 我检查了工具 - >选项格式,但找不到它。

Tools -> Options 
    -> Text Editor 
        -> C# 
            -> Formatting 
                -> New Lines 
                    -> New line options for braces 
                        -> Place open brace on new line for ....

There are a few options in there, I'm guessing you're likely wanting to disable most of those. 那里有几个选项,我猜你可能想要禁用大部分选项。 But specifically in this case I believe is for Place open brace on new line for control blocks . 但特别是在这种情况下,我认为是Place open brace on new line for control blocks

In addition, check out the other options for C# in and around there. 另外,请查看C#及其周围的其他选项。 It's pretty extensive and most likely you'll be able to achieve whatever combination of style you desire. 它非常广泛,很有可能你将能够实现你想要的任何风格组合。

Just follow this: Option -> Text Editor -> C# -> Formatting -> New Lines 只需按照:选项 - >文本编辑器 - > C# - >格式化 - >新行

Uncheck all the "New lines option for braces" 取消选中所有“大括号的新行选项”

在此输入图像描述

“工具”>“选项”>“文本编辑器”>“C#”>“格式设置”>“新行”>将“打开括号”放在控制块的新行上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM