简体   繁体   English

使用reshaper在Visual Studio 2010 C#中缩进行或选定区域或整个文档

[英]indent line or selected region or whole document in visual studio 2010 C# with resharper

It seems like none of the settings for indentation are working for me. 似乎没有任何缩进设置对我有用。 Tried CTRl-K,Ctrl-F Ctrk-K,Ctrl-D Ctrl-I 尝试过CTRl-K,Ctrl-F Ctrk-K,Ctrl-D Ctrl-I

I don't want to move to the beginning of the line for every indent using tab. 我不想使用选项卡将每个缩进都移至行首。 Is there a set of commands that will work in my visual studio C# 2010 with Resharper, that will accomplish indenting line, selected region or whole document? 是否可以使用Resharper在我的Visual Studio C#2010中使用一组命令来完成缩进行,选定区域或整个文档?

thanks 谢谢

You can format the selection with Ctrl+E, F and the whole document with Ctrl+E, D . 您可以使用Ctrl+E, F格式化选择内容Ctrl+E, F并使用Ctrl+E, D格式化整个文档。

Doing this should tidy up any missing/incorrect indents you may have. 这样做可以整理您可能缺少的所有缩进/错误缩进。

Edit 编辑

You can find these in Visual Studio by going to Edit -> Advanced. 您可以在Visual Studio中找到这些,方法是进入“编辑”->“高级”。 Format Document and Format Selection should be the first two items in the list. 格式文档和格式选择应该是列表中的前两项。

使用Resharper,正确的命令是Ctrl + Alt + F(代码清除),您可以使用该命令执行许多清除操作,包括缩进选择或文档

Change the background color to another color other than the page background (I used silver on a white main background) and it will give it that indented feel that you are looking for. 将背景色更改为页面背景以外的另一种颜色(我在白色主背景上使用了银色),这会给您带来所需的缩进感。

Options > Environment > Fonts and Colors > Display Items: Preprocessor Keyword and then change the item background dropdown. Options > Environment > Fonts and Colors >显示项目: Preprocessor Keyword ,然后更改item background下拉菜单。

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

相关问题 在Visual Studio中快速评论/ *选择C#代码* /(不是//整行) - Quickly commenting /* selected C# code */ in Visual Studio (not the // whole line) Visual Studio 2010:使用ReSharper代码分析后执行C#项目时出错 - Visual Studio 2010 : Error when executing the C# Project after code-analyzing with ReSharper Visual Studio C#自动缩进选择 - Visual Studio c# auto indent selection Visual Studio/ReSharper 代码格式 - C# - Visual Studio/ReSharper code formatting - C# 使用Visual Studio 2010从命令行构建C#解决方案 - Building C# solutions from command line with Visual Studio 2010 用于在Visual Studio C中展开所选折叠块/区域的快捷键# - Shortcut key to expand the selected collapsed block/region in Visual Studio C# Nunit 2.6 + Resharper 7 + NCrunch + visual studio 2010 - Nunit 2.6 + Resharper 7 +NCrunch + visual studio 2010 在 Visual Studio 2010 中使用 Resharper 6 自动完成初始化程序 - Autocompleting initializer with Resharper 6 in Visual Studio 2010 Visual Studio 2010 + resharper 括号缩进问题 - Visual studio 2010 + resharper bracket indentation problem C#代码生成(Visual Studio模板或Resharper插件) - C# code generation (visual studio template or resharper addin)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM