将代码段分配给Visual Studio中的键盘快捷键 [英] Assign code snippet to keyboard shortcut in Visual Studio

查看:95
本文介绍了将代码段分配给Visual Studio中的键盘快捷键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何将快捷键分配给特定的代码段吗?

Anyone knows how to assign key shortcut to specific code snippet?

我想将 CTRL + K,CTRL + J 分配给#region代码段.

因此能够:

  1. 选择文本,
  2. CTRL + K,CTRL + J =>
  3. 选定的文本将用#region .. #endregion包围.
  1. select text,
  2. press CTRL+K,CTRL+J =>
  3. selected text would be surrounded with #region .. #endregion.

我讨厌不得不将自己的手从键盘上拿出多余的时间:).

I hate when I have to take my hands out of keyboard for more time than necessary:).

为了获得更多理解,我想问如何将快捷键直接绑定到特定代码段.打开摘要选择器对我不起作用.如果我必须搜索所有代码段才能到达#region,那么糟糕的是自己写所有代码.

For more understanding, I am asking how to bind key shortcut directly to SPECIFIC snippet. Opening snippet selector wont work for me. If I have to search through all my snippets to get to a the #region one, its worse then writting all its code by myself.

感谢任何建议.

推荐答案

CTRL + k + s

请参阅 您必须知道的Visual Studio快捷方式

这篇关于将代码段分配给Visual Studio中的键盘快捷键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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