markdown-trick

vscode snippets

Ex: markdown snippets

以设置 markdown 代码片段为例

开启设置

文件 > 首选项 > 设置

1
2
3
"[markdown]":  {
"editor.quickSuggestions": true
}

设置模板

文件 > 首选项 > 用户代码片段 > markdown.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"markdown write template": {
"prefix": "mdrt",
"body": [
"--- $1",
"title: $TM_FILENAME_BASE",
"tags:",
"* xx",
"categories:",
"* xx",
"date: $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE-$CURRENT_HOUR",
"--- ",
" \n ",

"<!--more--> $2"
],
"description": "Create template for markdown write"
}
}

输出

1
2
3
4
5
6
7
8
9
10
---
title: md-kill
tags:
* xx
categories:
* xx
date: 2018-03-31-20
---

<!--more-->

参考

Markdown Snippet Prefix Does Not Trigger Snippet #28048
Creating your own snippets

文章作者: lmislm
文章链接: http://blog.booml.cn/2018/07/22/markdown-trick/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Baskerville*