Anyone knows how to assign key shortcut to specific code snippet?
I would like to assign for instance CTRL+K,CTRL+J to a #region
snippet.
Therefore by able to:
#region
.. #endregion
.I hate when I have to take my hands out of keyboard for more time than necessary:).
EDIT: 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.
Thx for any suggestions.
On the menu bar, choose Tools > Options. Expand Environment, and then choose Keyboard. Optional: Filter the list of commands by entering all or part of the name of the command, without spaces, in the Show commands containing box. In the list, choose the command to which you want to assign a keyboard shortcut.
To add a snippet trigger, right-click on the workflow canvas to pop up the objects menu and, under Triggers, choose Snippet. To configure the snippet trigger, set a keyword. Keep in mind that you'll need to type the prefix followed by your keyword. By default, the Shared Prefix is set to \\ with no Suffix set.
Type a <
and then type your snippet shorcut(your XML file Name) and then press tab
.
you can get more info from this link https://docs.microsoft.com/en-us/visualstudio/xml-tools/how-to-use-xml-snippets?view=vs-2017
for example i have a code snippet which i've set xml file name and its shortcut to flog
when i want to use it directly to my code i do like this:
<flog
and press tab
it Works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With