vs code 配置html模板

vs code 配置html模板

  1. 找到配置位置

首选项 - 用户代码片段 - 输入html.json

在这里插入图片描述
2. 写入代码段

// 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"
	// }
	"html5 demo": {
		"prefix": "!5",   // 这个是你输入的快捷代码
		"body": [// 这里是插入的内容
			"",
			"",
			"",
				"\t",
				"\t",
				"\t",
				"\t",
				"\t",
				"\t",
				"\t",
				"\t",
				"\t",
			    "\t",
			    "\t",
				"\t$1",  // 光标首次会在$1 的地方,按tab 会跳到 $2
				"\t",
			"",
			"",
			    "\t$2",
			""
		],
		"description": "html5 专用 create by qiphon"  // 这里是你的快捷输入的时候 VS code 提示的文字
	}
}

感谢网友SilenceJude

你可能感兴趣的:(html,工具书签,visual,studio,code)