简体   繁体   中英

Custom emmet snippets not working in vscode

I am trying to set custom emmet snippets, but it is not working.

My snippets.json file

{
  "html": {
    "snippets": {
      "testing": "div{Hello World}"
    }
  }
}

My file is certainly 'HTML' format and I tried to relaunch vscode.
Also I checked that path to snippets.json is correct and it is visible in 'settings'.

Also tried with two different machines, same situation.

Here is settings.json

{
  "some other settings",
  "emmet.extensionsPath": ["D:\\FRONTEND\\snippets.json"]
}

The emmet.extensionsPath takes a directory not a file path so try

"emmet.extensionsPath": ["D:\\FRONTEND"] instead

Using custom Emmet snippets

Custom Emmet snippets need to be defined in a json file named snippets.json . The emmet.extensionsPath setting should have the path to the directory containing this file.

Your syntax for the snippet is kinda wrong, here is the correct one, copy paste this: (you must modify the prefix as like you want)

    "html": {
    "prefix":  ["div"],
    "body": "div{Hello World}",
    "description": "div"
    }

    

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM