你最喜欢的Visual Studio快捷键是什么?我总是把我的手放在键盘上,远离鼠标!

请回答一个问题。


当前回答

格式的文档

   Ctrl+K, Ctrl+D

On an aspx page, this takes care of properly indenting all of your markup and ensures that everything is XHTML compliant (adds quotes to attributes, corrects capitalization, closes self-closing tags). I find that this makes it much easier to find mismatched tags and to make sure that my markup makes sense. If you don't like how it's indenting, you can control which tags go on their own line and how much space they get around them under Tools/Options/Text Editor/HTML/Format/Tag Specific Options. In your C# or VB code, this will correct any capitalization or formatting issues that didn't get caught automatically. For CSS files, you can choose compact (one definition per line), semi-expanded, or expanded (each rule on its own line); and you can choose how it handles capitalization.

其他回答

剪切和粘贴线条

每个人都知道Ctrl + X和Ctrl + C用于剪切/复制文本;但你知道吗,在VS中,如果你想剪切或复制一行,你不必先选择文本。如果没有选择,则整行将被剪切或复制。

格式的文档

   Ctrl+K, Ctrl+D

On an aspx page, this takes care of properly indenting all of your markup and ensures that everything is XHTML compliant (adds quotes to attributes, corrects capitalization, closes self-closing tags). I find that this makes it much easier to find mismatched tags and to make sure that my markup makes sense. If you don't like how it's indenting, you can control which tags go on their own line and how much space they get around them under Tools/Options/Text Editor/HTML/Format/Tag Specific Options. In your C# or VB code, this will correct any capitalization or formatting issues that didn't get caught automatically. For CSS files, you can choose compact (one definition per line), semi-expanded, or expanded (each rule on its own line); and you can choose how it handles capitalization.

Ctrl + K + C -设置当前所选代码为注释 Ctrl + K + U -设置当前所选注释为代码

节省大量的时间复制和切割:

一行中没有选择的Ctrl+C:复制整行 没有选择的Ctrl+X -剪切整行

Ctrl+-和Ctrl+Shift+-。但如果你是一个键盘爱好者,那就选择Resharper吧