用户代码片段
- VS Code 可以通过设置用户代码片段,快速生成 frontmatter
- VS Code 左下角
设置 -> User Snippets -> markdown.json
,将以下代码粘贴到{}
中 - 在
.md
文件中,通过输入md
即可快速生成(可以通过prefix
进行修改)
json
"minimalism-setup": {
"prefix": "md",
"body": [
"---",
"title: ${TM_FILENAME_BASE}",
"datetime: '${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}'",
"outline: deep",
"category: ${0}",
"tags: ",
" - ${1}",
"---",
"",
"# ${TM_FILENAME_BASE}"
],
"description": "minimalism-setup"
}
预览: