最近遇到一个问题,用 Vscode 写代码有提示,为什么写 markdown文档没有呢,很不方便。
方法
添加markdomw代码片段
Code-首选项-用户代码片段
输入 markdown
,编辑 markdown.json:
{
// Place your snippets for markdown here. 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.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"markdwon php": {
"prefix": "php",
"body": [
"```php",
"$1",
"```"
],
"description": "输出php代码块"
},
}
修改setting.json文件
添加好了代码片段之后,到.md文件,输入php,发现没有提示。
按快捷键:command
+shift
+ p
,输入 setting.json
enter
打开 setting.json,添加一段:
"[markdown]": {
"editor.quickSuggestions": true
}
然后在到md文件中,输入 php
,就有提示了