Skip to content

搜索技巧

一 找到设置目录

正常Ctrl+shift+p打开"设置",Configure User Snippets -> python.json

二 配置代码

json
{
	// Place your liangxinghua-vitepress workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and 
	// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope 
	// is left empty or omitted, the snippet gets applied to all languages. 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": {
	// 	"scope": "clg",
	// 	"prefix": "log",
	// 	"body": [
	// 		"console.log('$1');",
	// 		"$2"
	// 	],
	// 	"description": "Log output to console"
	// },

	"markdown center image": {
		"prefix": "ccc",
		"body": [
			"<center>",
			"<img src=\"/product/20250626192701\" alt=\"img\" class=\"custom-img\" style=\"zoom:60%;\" />",
			"</center>"
		],
		"description": "快速插入 图像代码"
	},
	"markdown center br": {
		"prefix": "bb",
		"body": [
			"<br/>"
		],
		"description": "快速插入 图像代码"
	},
	"markdown center math": {
		"prefix": "aaa",
		"body": [
			"$$s_{t}$"
		],
		"description": "数学公式"
	},
}

三 setting.json配置

json
//   自动补全代码
"editor.suggest.showSnippets": true,
// 优先显示代码片段
"editor.snippetSuggestions": "top",
"[markdown]": {
"editor.quickSuggestions": {
	"comments": "on",
	"strings": "on",
	"other": "on"
}
},

Released under the MIT License.