Published on

VS code Snippets Config

Authors
  • avatar
    Name
    Shelton Ma
    Twitter

VS Code Snippets Config

  1. Configure Snippets

    • Ctrl + Shift + p, input > snippets

    • Select User Snippets: Snippets:Configure Snippets

    • Select New Global Snippets file, Create new file: mdx-snippets.json.code-snippets

    • markdown demo, snippet generator

      "blog_frontmatter": {
       "prefix": "blog frontmatter",
       "body": [
        "---",
        "title: ",
        "date: $CURRENT_YEAR-$CURRENT_MONTH-${CURRENT_DATE} $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
        "tags: []",
        "draft: false",
        "summary: ",
        "images: []",
        "authors: ['default']",
        "---",
        "",
        ""
       ],
       "description": "blog_frontmatter"
      },
      
  2. Use

when you type blog frontmatter in an MDX file, VS Code will auto-insert the code block template