Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to activate Markdown user snippets in Visual Studio Code?

User Snippets are an awesome feature of Code, however, I can't get them to work for Markdown files. A markdown.json file exists and is editable, but I can't get snippets defined in that file to activate (using Tab like for other languages). Is there a different activation method for these snippets or are they just not supported yet?

EDIT: Here's the contents of the markdown.json file just in case I'm doing something wrong there.

{
    "Markdown comment": {
        "prefix": "comment",
        "body": [
            "<!--- \n --->"
        ],
        "description": "A Markdown comment"
    }
}
like image 512
Joe Martella Avatar asked Sep 21 '15 19:09

Joe Martella


1 Answers

  • Open the editor
  • Go to File -> Preferences -> User Snippets
  • Select Markdown. The file C:\Users\YOU\AppData\Roaming\Code\User\snippets\markdown.json will be opened
  • Paste your snippet into the file and save it
  • From now on you can use the snippet in all .md files.

In case the snippet suggestion doesn't popup when you type "comment" then you should type CTRL + Space to force it.

like image 71
Wosi Avatar answered Oct 05 '22 09:10

Wosi