You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many [extensions](/docs/editor/extension-gallery.md) on the VS Code [Marketplace](https://marketplace.visualstudio.com/vscode) include snippets. If you find one you want to use, install it and restart VS Code and the new snippet is available (see [here](/docs/editor/extension-gallery.md#browse-and-install-extensions) for more instructions on installing an extension).
26
28
27
-
Many [extensions](/docs/editor/extension-gallery.md) on the VS Code [Marketplace](https://marketplace.visualstudio.com/vscode) include snippets. If you find one you want to use, install it and restart VS Code and the new snippet will be available (see [here](/docs/editor/extension-gallery.md#browse-and-install-extensions) for more instructions on installing an extension).
28
-
29
-
Below are some popular extensions which include snippets in their language support:
29
+
The following popular extensions include snippets in their language support:
> Tip: The extensions shown above are dynamically queried. Click on an extension tile above to read the description and reviews to decide which extension is best for you. See more in the [Marketplace](https://marketplace.visualstudio.com/vscode).
33
+
> Tip: The preceding extensions are dynamically queried. Click on an extension tile above to read the description and reviews to decide which extension is best for you. See more in the [Marketplace](https://marketplace.visualstudio.com/vscode).
34
34
35
35
## Creating your Own Snippets
36
36
@@ -74,11 +74,11 @@ With tabstops, you can make the editor cursor move inside a snippet. Use `$1`, `
74
74
75
75
### Placeholders
76
76
77
-
Placeholders are tabstops with values, like `${1:foo}`. The placeholder text will be inserted and selected such that it can be easily changed. Placeholders can be nested, like `${1:another ${2:placeholder}}`.
77
+
Placeholders are tabstops with values, like `${1:foo}`. The placeholder text is inserted such that it can be easily changed. Placeholders can be nested, like `${1:another ${2:placeholder}}`.
78
78
79
79
### Choice
80
80
81
-
Placeholders can have choices as values. The syntax is a commaseparated enumeration of values, enclosed with the pipe-character, for example `${1|one,two,three|}`. When the snippet is inserted and the placeholder selected, choices will prompt the user to pick one of the values.
81
+
Placeholders can have choices as values. The syntax is a comma-separated enumeration of values, enclosed with the pipe-character, for example `${1|one,two,three|}`. When the snippet is inserted and the placeholder selected, choices prompt the user to pick one of the values.
82
82
83
83
### Variables
84
84
@@ -89,8 +89,8 @@ The following variables can be used:
89
89
*`TM_SELECTED_TEXT` The currently selected text or the empty string
90
90
*`TM_CURRENT_LINE` The contents of the current line
91
91
*`TM_CURRENT_WORD` The contents of the word under cursor or the empty string
92
-
*`TM_LINE_INDEX` The zero-indexbased line number
93
-
*`TM_LINE_NUMBER` The one-indexbased line number
92
+
*`TM_LINE_INDEX` The zero-index-based line number
93
+
*`TM_LINE_NUMBER` The one-index-based line number
94
94
*`TM_FILENAME` The filename of the current document
95
95
*`TM_FILENAME_BASE` The filename of the current document without its extensions
96
96
*`TM_DIRECTORY` The directory of the current document
@@ -122,7 +122,7 @@ ${TM_FILENAME/(.*)\..+$/$1/}
122
122
123
123
### Grammar
124
124
125
-
Below is the EBNF ([extended Backus-Naur form](https://en.wikipedia.org/wiki/Extended_Backus-Naur_form)) for snippets. With `\` (backslash), you can escape `$`, `}` and `\`. Within choice elements, the backslash also escapes comma and pipe characters.
125
+
Below is the EBNF ([extended Backus-Naur form](https://en.wikipedia.org/wiki/Extended_Backus-Naur_form)) for snippets. With `\` (backslash), you can escape `$`, ༖༗, and `\`. Within choice elements, the backslash also escapes comma and pipe characters.
126
126
127
127
```
128
128
any ::= tabstop | placeholder | choice | variable | text
@@ -146,7 +146,7 @@ text ::= .*
146
146
147
147
## Using TextMate snippets
148
148
149
-
You can also use existing TextMate snippets (.tmSnippets) with VS Code. See the [Using TextMate Snippets](/docs/extensions/themes-snippets-colorizers.md#using-textmate-snippets)topic in our Extension Authoring section to learn more.
149
+
You can also use existing TextMate snippets (.tmSnippets) with VS Code. See the [Using TextMate Snippets](/docs/extensions/themes-snippets-colorizers.md#using-textmate-snippets)article in our Extension Authoring section to learn more.
150
150
151
151
## Assign keybindings to snippets
152
152
@@ -163,14 +163,14 @@ We already know that snippets can be inserted via IntelliSense, the 'Insert Snip
163
163
}
164
164
```
165
165
166
-
It will invoke the 'Insert Snippet'-action but instead of letting you select a snippet it will run on the provided snippet. Also, instead of `snippet` you can have `langId` and `name` arguments to reference an existing snippet: `{ "langId": "csharp", "name": "myFavSnippet" }`
166
+
It invokes the 'Insert Snippet'-action but instead of letting you select a snippet it runs on the provided snippet. Also, instead of `snippet` you can have `langId` and `name` arguments to reference an existing snippet: `{ "langId": "csharp", "name": "myFavSnippet" }`
167
167
168
168
169
169
## Next Steps
170
170
171
-
*[Command Line](/docs/editor/command-line.md) - VS Code has a rich commandline interface to open or diff files and install extensions.
171
+
*[Command Line](/docs/editor/command-line.md) - VS Code has a rich command-line interface to open or diff files and install extensions.
172
172
*[Extending Visual Studio Code](/docs/extensions/overview.md) - Learn about other ways to extend VS Code.
173
-
*[Themes, Snippets, and Colorizers](/docs/extensions/themes-snippets-colorizers.md) - You can package themes, snippets and language colorizers for use in VS Code.
173
+
*[Themes, Snippets, and Colorizers](/docs/extensions/themes-snippets-colorizers.md) - You can package themes, snippets, and language colorizers for use in VS Code.
0 commit comments