Recently I used .mdx file to write my post, I found VSCode doesn’t support .mdx by default. So how to do it to support mdx?

First of all, install MDX support, or you can search from Extension: marketplace: mdx.

Next, edit the settings.json file, adding an associate to mdx.

"files.associations": {
 "*.md": "mdx"
},

Second, we need to create a snippet, Preferences > User Snippets and new snippet.

You can create local snippet and put it into your project, also you can create global snippet what you need.

{
    "mdx": {
        "prefix": "mdx",
        "body": [
            "---",
            "title: $1",
            "date: ${2:$CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE}",
            "tags:",
            " - $0",
            "---"
        ],
        "description": "MDX file."
    },
}