在Visual Studio中的环境,缩进样式设置? [英] Setting in Visual Studio where indent style is set?

查看:301
本文介绍了在Visual Studio中的环境,缩进样式设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个问题

Q1:

我看了一下各种编码缩进风格的像奥尔曼,K&安培;:R等

I have read about various coding indent styles like Allman, K&R etc.

我想知道的是在VS(2010),所有这些都可以设置设置?

What i want to know is where is the setting in VS(2010) where all these can be set?

Q2:

当我preSS 按Ctrl + K 按Ctrl + D 后,对方。它纠正格式就像那里有2位的B / W的话它减少了他们的。

When I press Ctrl + K and Ctrl + D after each other. It corrects formatting like where there are 2 spaces b/w words it reduces them to one.

同样是存在的,去除2 C $ CS?

Similarly is there any shortcuts that removes extra emptylines between 2 lines of codes?

我的情况是,我得到了code,其中额外的输入是pressed 2线code之间。如何删除呢?

My situation is that I was given a code where extra enter were pressed between 2 lines of code. How can i remove it?

推荐答案

Q1。在工具 - >选项 - >文本编辑器 - > C# - > Formatting->缩进 更改设置根据您的需要。
同时检查 Formatting->新行。

Q1. Under Tools->Options->Text Editor->C#->Formatting->Indentation change the settings as per your need.
Also check Formatting->New Lines.

Q2。有很多方法可以删除空行
第一个解决方案:
1.按Ctrl + H(快速替换) 2.选中使用普通防爆pressions 3.在查找指定^ $ \ N 4.在替换框中删除一切。 5.单击全部替换 所有的空行将会被删除。 :) ^手段行首 线$手段结束

第二个解决方案:
检查VS加载项如 ReSharper的或的 codeMaid 由它来完成code格式

Q2. There are many ways to remove blank lines
1st Solution:
1. Click Ctrl+H (quick replace) 2. Tick "Use Regular Expressions" 3. In Find specify "^$\n" 4. In Replace box delete everything. 5. Click "Replace All" All Blank lines will be deleted. :) ^ Means Beginning of line $ Means End of line

2nd Solution:
Check the VS addins like resharper or CodeMaid which does the code formatting

这篇关于在Visual Studio中的环境,缩进样式设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆