visual-studio - Visual Studio 2015 - CodeLens 使用键盘快捷键打开/关闭

标签 visual-studio visual-studio-2015 codelens

我想要一个快速的键盘快捷键来打开/关闭这个功能。该功能很有用,但有时我只想查看代码,而此功能会扭曲代码的视觉外观。

我绑定(bind)了 EditorContextMenus.CodeLens.CodeLensOptions 到键盘快捷键,但这太慢了,因为“选项”菜单打开时间太长。我真的很想有一个快捷方式来打开和关闭这个功能。

我怎样才能做到这一点?我错过了 中的一些选项吗?环境->键盘还是有一些可以提供帮助的附加组件?

最佳答案

要自动化选项对话框,您可以在 Visual Commander 中创建以下命令并为其分配键盘快捷键:

DTE.ExecuteCommand("EditorContextMenus.CodeLens.CodeLensOptions")
System.Windows.Forms.SendKeys.Send("{TAB} {ENTER}")

关于visual-studio - Visual Studio 2015 - CodeLens 使用键盘快捷键打开/关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31746690/

相关文章:

git - 带有 Visual Studio Team Services 的 TeamCity 和 git 存储库

c++ - 使应用程序在使用 Win7 功能的 WinXP/Vista 上运行

c++ - 在 Emacs 中使用 Visual Studio 6 C++ 编译器

c - main 外部的函数未从 For 循环返回正确的值

qt - 为 Visual Studio Community 2015 构建 Qt 5.6.0 时出错

asp.net-mvc - Visual Studio 不将 html/javascript 更新到服务器/浏览器

asp.net - 在 Visual Studio 构建中恢复 Bower 组件

c# - 是否有可能编写完全可维护的代码?

visual-studio-2013 - CodeLens 只找到用 MSTests 编写的测试

visual-studio - 如何扩展 CodeLens