- Function Component -
funcom
- Enhanced Function Component -
enhfuncom
- Connected Function Component -
confuncom
- Use Material Styles -
usemuisty
- Reducer -
reducer
- Use Material Styles -
usemuisty
- In VSCode View -> Command Palette
cmd
+shift
+P
and typesnippets
. Choose optionPreferences: Configure User Snippets
:
- Select language:
- Now a
<lang>.json
has been opened. Paste code from according file insnippets
folder.
- Open a file which you want to use your snippet in and try to use
prefix
from one of them. In example below that'slog
.
- Done.
- Place your snippets for any language you want according filename in
snippets
folder. - Each snippet is defined under a snippet name and has a prefix, body and description.
- The prefix is what is used to trigger the snippet and the body will be expanded and inserted.
- Possible variables are:
$1
,$2
for tab stops,$0
for the final cursor position, and${1:label}
,${2:another}
for placeholders. - Placeholders with the same ids are connected.
"Print to console": {
"prefix": "log",
"body": [
"console.log('$1');",
"$2"
],
"description": "Log output to console"
}
- Cool tool snippet-generator.app
- Tutorial Traversy Media - Code Faster With Custom VS Code Snippets
- Q: Can I commit some code and create PR?
- A: Yup.