VSCODE 自定义按键生成代码段

in code > preferrence > USER SNIPPT > serch: html.json > in html.json

{
	// Place your snippets for html 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"
	// }

	//----------按键API:html-------------
	"飞云: HTML5-template": {
        "prefix": "ht", // 对应的是使用这个模板的快捷键
        "body": [
		"<!DOCTYPE html>",
		"<html lang=\"zh-CN\">",
		"<head>",
		"\t<meta charset=\"UTF-8\">",
		"\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
		"\t<meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
		"\t<title>$1</title>",
		"</head>\n",
		"<body>",
		"\t$2", // $2表示 第一个tab定位到$1,第二个tab定位到$2		
		"</body>\n",
		"</html>"
        ],
        "description": "飞云: HTML5-template" // 模板的描述
	},
	//------------按键API:js---------------------
	"飞云: JavaScript-template": {
        "prefix": "js", // 对应的是使用这个模板的快捷键
        "body": [
		"<script type=\"text/javascript\">\n",
		"\t$1",		
		"</script>\n",
        ],
        "description": "飞云: JavaScript-template" // 模板的描述
	},
	//vscode全选格式化的组合热键 start
	//	: ctrl + A 然后 ALT + Shift + F
	//vscode全选格式化的组合热键 end
}
上一篇:PTA-56 求给定精度的简单交错序列部分和


下一篇:np &opencv &more