你最喜欢的Visual Studio快捷键是什么?我总是把我的手放在键盘上,远离鼠标!
请回答一个问题。
你最喜欢的Visual Studio快捷键是什么?我总是把我的手放在键盘上,远离鼠标!
请回答一个问题。
当前回答
我很惊讶没有在清单上找到这个,因为我一直在用它:
Ctrl + K, Ctrl + M -实现方法存根。
编写一个对不存在的方法的调用,然后使用该快捷方式在正确的位置创建方法,使用正确的参数和返回值,但是使用只抛出NotImplementedException的方法体。
非常适合自顶向下的编码。
其他回答
节省大量的时间复制和切割:
一行中没有选择的Ctrl+C:复制整行 没有选择的Ctrl+X -剪切整行
Ctrl+K然后Ctrl+H添加一行代码到内置的任务/todo列表(Ctrl+Alt+K)。非常方便!
格式的文档
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.
库存Visual Studio?F12 - Edit.GoToDefinition。
拥有DevExpress的重构!不过,installed意味着Ctrl + '是我一直以来的最爱;)
如果你的键盘设置设置为“Visual c# 2005”,窗口切换和文本编辑和弦是非常棒的。按第一个Ctrl + Key组合键,然后松开并按下一个字母。
Ctrl+E, C:注释所选文本 Ctrl+E, U:取消所选文本的注释 Ctrl+W, E:显示错误列表 Ctrl+W, J:显示对象浏览器 Ctrl+W, S:显示解决方案资源管理器 Ctrl+W, X:显示工具箱
我仍然使用F4来显示属性窗格,所以我不知道那个和弦。
如果你去到工具>自定义菜单选项并按键盘按钮,它会给你一个命令列表,你可以搜索,看看是否有一个快捷键可用,或者你可以选择“按快捷键:”文本框并测试你想要分配的快捷键,看看它们是否冲突。
附录:我刚刚发现了另一个很棒的方法,我认为我会经常使用:Ctrl+K, S会弹出一个智能提示框,询问你想用什么来包围所选文本。这正是我需要的所有时候,我需要包装一个块在条件或try/catch。