Visual Studio 2010 code snippet

I managed to make a code snippet, and all this is good, the question is that I do not want to use ctrl + k ctrl + S, then click on the snippet, instead I want to use a key combination to just use the snippet directly or at least by pressing ctrl + k ctrl + S, then another combination?

perhaps?

thanks in advance...

+3
source share
3 answers

If you say you click Ctrl+K, Ctrl+S, it’s because the added fragment was a Surround With fragment, right?

ReSharper . ( ReSharper) , , Surround-With.

, .

: Ctrl+Alt+J, :

ReSharper templates example

, , .

, if, : Ctrl+Alt+J, 1.

:
, Ctrl+Alt+J , , ReSharper > > Surround With Template...

+2

- + [Tab] + [Tab]. Visual Studio , , .

"f + [tab] + [tab]" .

+1

In your code snippet file, you can customize the shortcut. Code snippets are under (depending on the language):

"\ Documents \ Visual Studio 2010 \ Code Snippets \ Visual C # \ My Code Snippets"

In the CodeSnippet \ Header \ Shortcut section in the code snippet file, enter a unique short corresponding series of characters.

  <CodeSnippet>
    <Header>
      <Shortcut>spi</Shortcut>
    </Header>

Entering these characters, followed by a tab in the code window, inserts a piece of code.

+1
source

Source: https://habr.com/ru/post/1795025/


All Articles