最喜欢的 Visual Studio 键盘重新映射?

发布于 2024-09-01 17:53:20 字数 2079 浏览 12 评论 0原文

Stack Overflow 涵盖了最喜欢的快捷方式和插件、优化和首选项——所有这些都是很棒的主题。如果这个已经被覆盖,我找不到它——所以提前感谢您提供的链接。

您最喜欢的 Visual Studio 键盘重新映射是什么?

我的动机是因为我是一名盲打打字员。鼠标、功能键、方向键、Home、End——哎呀。这些是我每天都会执行的命令,因此我将它们重新映射到我可以执行的序列,而无需将手从主行移开。

Tools => 中重新映射的命令定制=> [键盘] 显示在括号中。

我百分百肯定有比这些更好的重新映射,所以请发布您的!请包含命令;很多时候,弄清楚它是一个挑战。

-- Hoytster

运行应用程序并操作调试器

Ctrl+Q + Ctrl+R 在调试模式下运行应用程序 (Debug.Start)

Ctrl+Q + Ctrl+Q 退出(停止)应用程序 (Debug.StopDebugging)

Ctrl+T 在当前行切换断点 ( Debug.ToggleBreakpoint)

Ctrl+K + Ctrl+I 单步执行方法 (Debug.StepInto)

Ctrl+K + Ctrl+ O 跳出方法 (Debug.StepOut)

Ctrl+N 跳出方法到下一个语句 (Debug.StepOver)

Ctrl+K + < kbd>Ctrl+H 运行代码,在光标位置处停止 (Debug.RunToCursor)

Ctrl+K + Ctrl+E 将 then next 语句设置为执行 (Debug.SetNextStatement)

浏览代码

Ctrl+S 向左移动一个字符 (Edit.CharLeft)

Ctrl+D 向右移动一个字符 ( Edit.CharRight)

Ctrl+Q + Ctrl+S 移动到当前行的左端 (Edit.LineStart)

Ctrl+Q + Ctrl+D 移动到当前行的右端 (Edit.LineEnd)

Ctrl+E 向上移动一行 (Edit.LineUp)

Ctrl+X< /kbd> 向下移动一行 (Edit.LineDown)

Ctrl+K + Ctrl+K 切换(添加或删除)书签 (Edit.ToggleBookmark)

Ctrl+ K + Ctrl+N 移至下一个书签 (Edit.NextBookmark)

Ctrl+K + Ctrl+P 移至上一个书签 (Edit.PreviousBookmark)

Ctrl+Q + Ctrl+W 保存所有修改的 Windows (File.SaveAll)

Ctrl+L 查找下一个搜索字符串的实例 (Edit.FindNext)

Ctrl+K + Ctrl+L 查找搜索字符串的上一个实例 (Edit.FindPrevious)

Ctrl+Q + Ctrl+L 下拉打开的文件列表 (Window.ShowEzMDIFileList)

最后一个序列就像单击代码编辑器窗口右上角的向下三角形。 VS 将显示所有打开的窗口的列表。您可以通过键入文件名从列表中进行选择;当您键入时,将选择匹配的文件。暂停一秒钟并继续输入,然后匹配过程重新开始,因此您可以选择不同的文件。不错,VS 团队。该键将带您进入所选文件的选项卡。

好吧,这是一个社区维基;编辑掉。 :)

Stack Overflow has covered favorite short-cuts and add-ins, optimizations and preferences -- great topics all. If this one has been covered, I can't find it -- so thanks in advance for the link.

What are your favorite Visual Studio keyboard remappings?

Mine are motivated by the fact that I'm a touch-typist. Mouse, function keys, arrow keys, Home, End -- bleh. These are commands I do all day every day, so I've remapped them to sequences I can execute without moving my hands from the home row.

The command that is remapped in Tools => Customize => [Keyboard] is shown in parentheses.

I'm 100% positive that there are better remappings than these, so please post yours! Please include the command; oft times, figuring it out is a challenge.

-- Hoytster

Running the app and operating the debugger

Ctrl+Q + Ctrl+R Run the application, in debug mode (Debug.Start)

Ctrl+Q + Ctrl+Q Quit (stop) the application (Debug.StopDebugging)

Ctrl+T Toggle a breakpoint at the current line (Debug.ToggleBreakpoint)

Ctrl+K + Ctrl+I Step Into the method (Debug.StepInto)

Ctrl+K + Ctrl+O Step Out of the method (Debug.StepOut)

Ctrl+N Step over the method to the Next statement (Debug.StepOver)

Ctrl+K + Ctrl+H Run the code, stopping Here at the cursor position (Debug.RunToCursor)

Ctrl+K + Ctrl+E Set then next statement to Execute (Debug.SetNextStatement)

Navigating the code

Ctrl+S Move a character LEFT (Edit.CharLeft)

Ctrl+D Move a character RIGHT (Edit.CharRight)

Ctrl+Q + Ctrl+S Move to the LEFT END of the current line (Edit.LineStart)

Ctrl+Q + Ctrl+D Move to the RIGHT END of the current line (Edit.LineEnd)

Ctrl+E Move a line UP (Edit.LineUp)

Ctrl+X Move a line DOWN (Edit.LineDown)

Ctrl+K + Ctrl+K Toggle (add or remove) bookmark (Edit.ToggleBookmark)

Ctrl+K + Ctrl+N Move to the NEXT bookmark (Edit.NextBookmark)

Ctrl+K + Ctrl+P Move to the PREVIOUS bookmark (Edit.PreviousBookmark)

Ctrl+Q + Ctrl+W Save all modified Windows (File.SaveAll)

Ctrl+L Find the NEXT instance of the search string (Edit.FindNext)

Ctrl+K + Ctrl+L Find the PREVIOUS instance of the search string (Edit.FindPrevious)

Ctrl+Q + Ctrl+L Drop down the list of open files (Window.ShowEzMDIFileList)

The last sequence is like clicking the downward-facing triangle in the upper-right corner of the code editor window. VS will display a list of all the open windows. You can select from the list by typing the file name; the matching file will be selected as you type. Pause for a second and resume typing, and the matching process starts over, so you can select a different file. Nice, VS Team. The key takes you to the tab for the selected file.

OK, it's a community wiki; edit away. :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

玩物 2024-09-08 17:53:21

我通常不会重新映射太多(可能是因为必须经常四处走动并帮助其他拥有默认映射的人),但我喜欢做两个添加/更改:

  • Alt+N 变成 VAssistX - >重构->重命名...为​​ Visual Assist X (VAssistX.RefactorRename)。最近的 VAX 副本会自动执行此 Shift+Alt+R 操作,但我们使用的版本没有为此进行键绑定,因此我习惯了 Alt+N。
  • F7 更改以进行构建 ->仅项目 ->仅构建项目(Build.BuildOnlyProject); Ctrl+Shift+B 仍然构建解决方案。不确定我是否已经结婚了,但我确实希望 BuildOnlyProject 有一个默认的键盘快捷键。由于我们使用的是外部 make,因此单个文件的 Ctrl+F7 (Build.Compile) 对我们不起作用,而且在处理其他项目时,我忘记它存在一半的时间。

如果您允许我继续滔滔不绝地谈论商业产品,我最喜欢的快捷键仍然是 VAX 的 Alt+Shift+S 查找符号、Alt+Shift+O 打开文件在解决方案中,Alt+O 打开相应的文件。但这些不是重新映射,它们是默认值......

I don't generally remap much (probably due to having to wander around and help others who have default mappings often), but there are two additions / changes I like to make:

  • Alt+N becomes VAssistX -> Refactor -> Rename... for Visual Assist X (VAssistX.RefactorRename). More recent VAX copies make this Shift+Alt+R automatically, but we were on a version without a keybinding for this, and I became accustomed to Alt+N.
  • F7 changes to do a Build -> Project Only -> Build Only Project (Build.BuildOnlyProject); Ctrl+Shift+B still builds the solution. Not sure if I'm married to this or not, but I do wish there was a default keyboard shortcut for BuildOnlyProject. Since we're using an external make, Ctrl+F7 (Build.Compile) for a single file doesn't work for us, and I forget it exists half the time when working with other projects.

If you'll allow me to continue to gush over a commercial product, my favorite shortcuts are still VAX's Alt+Shift+S find symbol, Alt+Shift+O open file in solution, and Alt+O open corresponding file. But those are not remappings, they're defaults...

忆依然 2024-09-08 17:53:21
  • Ctrl+1 - Resharper.UnitTest_ContextRun(在光标位置运行单元测试)

  • Ctrl+2 - Resharper.UnitTest_ContextDebug(在光标位置调试单元测试)

  • Ctrl+1 - Resharper.UnitTest_ContextRun (Run unit test at cursor position)

  • Ctrl+2 - Resharper.UnitTest_ContextDebug (Debug unit test at cursor position)

oО清风挽发oО 2024-09-08 17:53:21

http://www.viemu.com/

它非常努力地准确模拟 vim。 Intellisense 和 VS 的所有其他功能仍然可以完美运行(与所有免费的 vi[m] 插件不同)。

开发人员非常友好,并且对功能请求的周转时间非常快。

作为一个长期的 vim 用户,如果没有这个插件,我就无法使用 VS。

http://www.viemu.com/

It tries very hard to accurately emulate vim. Intellisense and all other features of VS still work perfectly (unlike with all the free vi[m] plugins).

The developer is very friendly and has a very fast turnaround time for feature requests.

I can't use VS without this plugin as a long long time vim user.

意中人 2024-09-08 17:53:21

ALT+W+U :隐藏所有工具窗口,例如“监视”、“立即”、“输出”等。当您想专注于正在编写的代码时很有用

ALT+W+U : Hide all tool windows like Watch, Immediate, Output etc. Useful when you wanna focus on the code you're writing

迷爱 2024-09-08 17:53:20

工具 -> 选项 -> 键盘 -> 应用以下附加键盘映射方案 -> Emacs

Tools -> Options -> Keyboard -> Apply the following additional keyboard mapping scheme -> Emacs

蹲墙角沉默 2024-09-08 17:53:20

对于编辑和重新排列,我发现以下 3 个非常有用,即使它们不在主行:

  • Keypad + for Edit.Copy

  • 键盘 - 用于 Edit.Cut

  • 键盘 * 用于 Edit.Paste

这些很容易点击(即使用右手拇指,在紧要关头,如果你的右手拿着鼠标)​​并且不需要元键。我经常编写代码片段,然后使用搜索和替换将其转换为可编译的代码,然后从其他地方复制文字。第二步通常是通过使用鼠标光标来最有效地完成,所以我没有发现这些键距离打字设置太远的问题 - 能够在没有元键的情况下点击它们更重要。

(为了注释掉大段代码,上面的代码使得无法使用数字键盘快速添加 /**/ 。我已经开始使用 < code>Edit.CommentSelection 和 Edit.UncommentSelection 代替,或者 Visual Assist 的注释选择工具,它们具有不产生不可嵌套注释的额外优势。)

我发现自己只有其他特别有用的快捷方式。没有被困住的是这两个:

  • Ctrl+Alt+1 for View.FindResults1
  • Ctrl+Alt+2 for View.FindResults2

其他较小的窗口默认有键盘快捷键;我不确定为什么“查找结果”窗口不显示。

For editing and rearranging I've found the following 3 very useful, even though they're not on the home row:

  • Keypad + for Edit.Copy

  • Keypad - for Edit.Cut

  • Keypad * for Edit.Paste

These are easy to hit (even with the right thumb, at a pinch, if your right hand is holding the mouse) and require no meta keys. I often work by writing snippets then turning it into compilable code using search and replace, and then copying in words from elsewhere. The second step is usually most efficiently done by using the cursor with the mouse, so I've not found it a problem that these keys are so far away from the typing set -- being able to hit them without meta keys is more important.

(For commenting out large swathes of code, the above makes it impossible to use the numeric keypad to quickly add in /* or */. I've taken to using Edit.CommentSelection and Edit.UncommentSelection instead, or Visual Assist's comment selection facility. These have the additional slight advantage of not producing unnestable comments.)

Only other particularly useful shortcuts I find myself stuck without are these two:

  • Ctrl+Alt+1 for View.FindResults1
  • Ctrl+Alt+2 for View.FindResults2

The other lesser windows have keyboard shortcuts for them by default; I'm not sure why the Find Results windows don't.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文