Customize VS Code with some code snippets so you can insert them into your projects
For more info see:
- Snippets in Visual Studio Code in the docs.
- VS Code homepage.
Click the link to jump to that section of this gist.
- Makefile snippets.
- .editorconfig snippets.
- HTML snippets.
- Plain text snippets - including a
LICENSE
. - .gitignore snippets.
- YAML snippets - including GitHub Actions workflow.
- JavaScript snippets - including Jest unit test outline.
How to set up and use the the base HTML snippet as an example.
- Open VS Code.
- Open the command palette. ("View" then "Command Palette").
- Type "Snippet" to narrow the options.
- Select the option "Preferences: Configure User Snippets".
- Select
html.json
. - Delete the contents of the file.
- Copy the content of the
html.json
file in this gist and paste it in the file. - Save it.
You can have more than HTML snippet, but in this case we only set up one. See the ignore.json
example for supporting multiple snippets.
We set "prefix": "html_base"
in the file, so that defines the snippet trigger we use here.
- Open or create a new file which has a
.html
extension. Or select the format in the bottom right and choose HTML. - Left-click in the file where you want the snippet to be inserted.
- Start typing the snippet trigger.
- Type
html_base
and s - Or just
html
, then findhtml_base
from available options.
- Type
- Press Enter or Tab.
- The snippet will be inserted.
- This particular snippet has some placefolders.
- Start typing immediately to enter a title.
- Press Tab to skip to the next placeholder.
- Enter a description.
- Press Tab to skip to the next breakpoint, which will be in the body here. But in a simpler snippet you'd jump to the end of the snippet.
Another way to insert a snippet is using "Insert snippet" in the command palette, so see any snippets availble for the current file format.
Guten Tag, ich benötige dafür und GitHub im allem Unterstützung. Danke im Vorraus