VisualStidio自定义代码片段小记

<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.6.0">
    <Header>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>Jql</Title>
      <Author>John Sheehan (@johnsheehan)</Author>
      <Description>An anonymous function.</Description>
      <HelpUrl>https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets</HelpUrl>
      <Shortcut>jql</Shortcut>
    </Header>
    <Snippet>
      <Declarations>
        <Literal Editable="true">
          <ID>param</ID>
          <ToolTip>Parameter</ToolTip>
          <Default>
          </Default>
          <Function>
          </Function>
        </Literal>
      </Declarations>
      //$符合有注释功能,如果输出$符合 用两个即可  
      //$param$参数光标位置    $end$  用户Enter之后光标位置
      <Code Language="javascript"><![CDATA[$$(function(){$param$})]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>

VS Code自定义Vue模板:

{
	// Place your 全局 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:
	"h5 sample": {
		"prefix": "vp",
		"body": [
			"<!DOCTYPE html>",
			"<html lang=\"en\">",
			"<head>",
				"\t<meta charset=\"UTF-8\">",
				"\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
				"\t<title>Document</title>",
			"</head>",
			"<body>",
				"\t<div id=\"app\">",
				"\t</div>",
				"\t<script src=\"VueDemo/VueDemo/VueJs/vue.js\"></script>",
				"\t<script>",
					"\t\tlet vm = new Vue({",
						"\t\t\tel:\"#app\",",
						"\t\t\tdata:{",
						"\t\t\t},",
						"\t\t\tmethods:{",
						"\t\t\t},",
					"\t\t})",
				"\t</script>",
			"</body>",
			"</html>"
		],
		"description": "The full sample code - html5."
   }
}
 
发布了83 篇原创文章 · 获赞 11 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/MrLsss/article/details/104468118