Assign code snippet to keyboard shortcut in Visual Studio

前端 未结 4 712
野趣味
野趣味 2021-02-02 10:33

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.

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-02 11:18

    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:

    and press tab it Works.

提交回复
热议问题