步骤

  1. 修改设置文件settings.json
  1. {
  2. "[markdown]": {
  3. "editor.wordWrap": "on",
  4. "editor.quickSuggestions": true # 使代码片段功能生效
  5. }
  6. }
  1. 添加代码片段,即编辑markdown.json
    1. {
    2. "note template": {
    3. "prefix": "header",
    4. "body": [
    5. "---",
    6. "title: $TM_FILENAME_BASE",
    7. "date: $CURRENT_YEAR/$CURRENT_MONTH/$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
    8. "updated: $CURRENT_YEAR/$CURRENT_MONTH/$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
    9. "categories: ${1:categories}",
    10. "tags: ${2:tags}",
    11. "---",
    12. "$0"
    13. ],
    14. "description": "header template"
    15. },
    16. "red font": {
    17. "prefix": "red",
    18. "body": [
    19. "<font color='red'>$1</font>$0"
    20. ],
    21. "description": "红色字体"
    22. }
    23. }