VS 2012 中的格式代码 (Strg K + D) [英] Format Code (Strg K + D) in VS 2012

查看:27
本文介绍了VS 2012 中的格式代码 (Strg K + D)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在 VS2010 中按 STRG K + D 代码(例如 HTML、ASPX)将被格式化并删除空行.

if I press STRG K + D in VS2010 the code (e.g. HTML, ASPX) will be formatted and empty lines will be deleted.

如果我在 VS2012 中使用这个快捷方式,空行不会被删除.有没有办法做到这一点?

If I use this shortcut in VS2012 the empty lines will not be deleted. Is there a way to do this?

推荐答案

我使用以下组合在 VS2012 中自动格式化代码的缩进.

I use the following combination to auto format indentations of my code in VS2012.

Ctrl+A 选择要格式化的文件中的所有代码.或者您可以只选择一段代码.

Ctrl+A to select all the code in a file to be formatted. Or you can select just a block of the code.

Ctrl+K,然后 Ctrl+F 将使用适当的缩进格式化代码.

Ctrl+K, then Ctrl+F will format the code with proper indentations.

虽然没有删除空行.

这篇关于VS 2012 中的格式代码 (Strg K + D)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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