格式code快捷键的Visual Studio? [英] Format code shortcut for Visual Studio?

查看:251
本文介绍了格式code快捷键的Visual Studio?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Eclipse中有一个快捷键<大骨节病>控制 + <大骨节病>移 + <大骨节病>˚F的重新缩进code和修复注释和空行。是否有Visual Studio 2010的一个等效?

In eclipse there is a shortcut Ctrl+Shift+F that re-indents code and fixes comments and blank lines. Is there an equivalent for Visual Studio 2010?

推荐答案

Visual Studio中的C#键绑定

要回答的具体问题,在C#中,你很可能会使用C#键盘映射方案,这将在默认情况下使用这些热键是:

To answer the specific question, in C# you are likely to be using the C# keyboard mapping scheme, which will use these hotkeys by default:

<大骨节病>控制 + <大骨节病>电子,<大骨节病>控制 + <大骨节病> D 格式化整个文档。

Ctrl+E, Ctrl+D to format the entire document.

<大骨节病>控制 + <大骨节病>电子,<大骨节病>控制 + <大骨节病>˚F格式化选项。

Ctrl+E, Ctrl+F to format the selection.

您可以在工具改变这些>选项>环境 - >键盘(通过选择不同的键盘映射方案,或结合各个键的命令Edit.FormatDocument和Edit.FormatSelection)

You can change these in Tools > Options > Environment -> Keyboard (either by selecting a different "keyboard mapping scheme", or binding individual keys to the commands "Edit.FormatDocument" and "Edit.FormatSelection").

如果您没有选择使用C#键盘映射方案,然后点击您可能会发现快捷键是不同的。例如,如果你不使用C#绑定,按键很可能是:

If you have not chosen to use the C# keyboard mapping scheme, then you may find the key shortcuts are different. For example, if you are not using the C# bindings, the keys are likely to be:

<大骨节病>控制 + <大骨节病> K + <大骨节病> D (整个文件)

Ctrl + K + D (Entire document)

<大骨节病>控制 + <大骨节病> K + <大骨节病>˚F(只选)

Ctrl + K + F (Selection only)

要找出哪个键绑定在适用的Visual Studio的副本,请在编辑>高级菜单 - 键所显示的菜单项的右侧,所以很容易发现哪些他们是你的系统上。

To find out which key bindings apply in YOUR copy of Visual Studio, look in the Edit > Advanced menu - the keys are displayed to the right of the menu items, so it's easy to discover what they are on your system.

(请不要修改这个答案来改变上面什么系统具有键绑定!)

(Please do not edit this answer to change the key bindings above to what your system has!)

这篇关于格式code快捷键的Visual Studio?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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