vscode code snippets All In One
vscode code snippets All In One
vscode & code snippets
code snippet
js6r, js6, h5t, c3t, tst, p3y,
JSON5, JSON, JSONC
https://github.com/xgqfrms/vscode/tree/master/code-snippets
https://github.com/xgqfrms/FEIQA/tree/master/000-xyz/templates
https://github.com/xgqfrms/es-next/tree/master/.vscode
TypeScript template for leetcode
{
"TypeScript Template": {
"prefix": "tst",
"body": [
"\"use strict\";",
"",
"/**",
" * ",
" * @author xgqfrms",
" * @license MIT",
" * @copyright xgqfrms",
" * @created 2023-02-0$1",
" * @modified ",
" * ",
" * @description ",
" * @description ",
" * @difficulty Easy Medium Hard",
" * @ime_complexity O(n)",
" * @space_complexity O(n)",
" * @augments ",
" * @example ",
" * @link https://leetcode.com/problems/$2/",
" * @link https://leetcode.cn/problems/$2/",
" * @solutions ",
" * ",
" * @best_solutions ",
" * ",
" */",
"",
"export {};",
"",
"const log = console.log;",
"",
"// Generator",
"const $3 = ($5datas = [], debug = false) => {",
" let result = ``;",
" // do something...",
" return $7result;",
"};",
"",
"",
"export default $3;",
"export {",
" $3,",
"};",
"",
"/*",
"",
"",
"// 测试用例 test cases",
"const testCases = [",
" {",
" inputs: [],",
" input: '4193 with words ',",
" result: 4193,",
" desc: 'value equal to 4193',",
" },",
"];",
"",
"for (const [i, testCase] of testCases.entries()) {",
" const [first, second] = testCase.inputs;",
" const result = $3(first, second);",
" log(`test case \\${i} result: `, JSON.stringify(result) === JSON.stringify(testCase.result) ? `✅ passed` : `❌ failed`, result);",
" const result = $3(testCase.input);",
" log(`test case \\${i} result: `, result === testCase.result ? `✅ passed` : `❌ failed`, result);",
" // log(`test case ${i} =`, testCase);",
"}",
"",
"// $ npx ts-node ./100\\ same-tree.ts",
"",
"*/",
"",
],
"description": "TypeScript Template & code snippets!"
}
}
HTML5 Template
h5t
{
"HTML5 Template": {
"prefix": "h5t",
"body": [
"<!DOCTYPE html>",
"<html lang=\"zh-Hans\">",
"<head>",
" <meta charset=\"UTF-8\">",
" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
" <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
" <meta name=\"author\" content=\"xgqfrms\">",
" <meta name=\"generator\" content=\"VS code\">",
" <title>$1</title>",
"</head>",
"<body>",
" <header>",
" <h1>$2</h1>",
" </header>",
" <main>",
" <section>",
" <a href=\"https://feiqa.xgqfrms.xyz/index.html\">$3</a>",
" </section>",
" <article></article>",
" <main>",
" <footer>",
" <p>copyriht© xgqfrms 2019</p>",
" </footer>",
"</body>",
"</html>"
],
"description": "HTML5 Template & code snippets!"
}
}
css reset
{
"CSS3 Template": {
"prefix": "c3t",
"body": [
"@charset \"UTf-8\";",
"",
"/* $1.css */\n",
":root {",
" --cololr: #fff;",
" --default-cololr: #000;",
" --new-cololr: #0f0;",
"}",
"",
"html{",
" font-size: 62.5%;",
" /* 10px = 1rem */",
"}",
"",
"* {",
" box-sizing: border-box;",
" -moz-box-sizing: border-box;",
" -webkit-box-sizing: border-box;",
"}",
"",
"html, body, div, h1, h2, h3, h4, h5, h6, hr, p, blockquote, dl, dt, dd, ul, ol, li, pre, form, fieldset, object, code, legend, button, input, textarea, th, td, a, img, video {",
" margin: 0;",
" padding: 0;",
" border: 0;",
" outline: 0;",
"}",
"",
],
"description": "CSS3 Template & code snippets!"
}
}
c3t
{
"CSS3 Template": {
"prefix": "c3t",
"body": [
"@charset \"UTf-8\";",
"",
"/* $1.css */\n",
":root {",
" --cololr: $2;",
" --default-cololr: $2;",
" --new-cololr: $3;",
"}",
],
"description": "CSS3 Template & code snippets!"
}
}
js6r
new
{
"JavaScript ES6 React Template": {
"prefix": "js6r",
"body": [
"\"use strict\";",
"",
"/**",
" * ",
" * @author xgqfrms",
" * @license MIT",
" * @copyright xgqfrms",
" * @created 2019-08-$1",
" * ",
" * @description $2",
" * @augments $3",
" * @example $4",
" * @link $5",
" * ",
" */",
"",
"const $2Generator = ($5datas = [], debug = false) => {",
" let result = ``;",
" // do something...",
" return $7result;",
"};",
"",
"",
"",
"export default $2;",
"",
"export {",
" $2,",
"};",
"",
],
"description": "JavaScript ES6 React Template & code snippets!"
}
}
old
{
"JavaScript ES6 React Template": {
"prefix": "js6r",
"body": [
"\"use strict\";",
"",
"/**",
" * ",
" * @author xgqfrms",
" * @license MIT",
" * @copyright xgqfrms",
" * ",
" * @description $2",
" * @augments $3",
" * @example $4",
" * ",
" */",
"",
"const $2Generator = ($5datas = [], debug = false) => {",
" let result = ``;",
" // do something...",
" return $7result;",
"};",
"",
"",
"",
"export default $2;",
"",
"export {",
" $2,",
"};",
"",
],
"description": "JavaScript ES6 React Template & code snippets!"
}
}
h5t
{
"HTML5 Template": {
"prefix": "h5t",
"body": [
"<!DOCTYPE html>",
"<html lang=\"zh-Hans\">",
"<head>",
" <meta charset=\"UTF-8\">",
" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
" <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
" <meta name=\"author\" content=\"xgqfrms\">",
" <meta name=\"generator\" content=\"VS code\">",
" <title>$1</title>",
"</head>",
"<body>",
" <section>",
" <h1>$2</h1>",
" <a href=\"https://feiqa.xgqfrms.xyz/index.html\">$3</a>",
" </section>",
"</body>",
"</html>"
],
"description": "HTML5 Template & code snippets!"
}
}
json
{
"NPM JSON Template": {
"prefix": "njt",
"body": [
"{",
" \"name\": \"$1npm node project\",",
" \"description\": \"$2an open source project created by xgqfrms\",",
" \"author\": \"xgqfrms\",",
" \"version\": \"1.1.1\",",
" \"license\": \"MIT\",",
" \"private\": true,",
" \"scripts\": {",
" \"dev\": \"npm run start\",",
" \"app\": \"npm run build\",",
" \"rmrf\": \"rimraf dist/**/*\",",
" \"map\": \"rimraf dist/**/*.map\"",
" },",
" \"bin\": {",
" \"dev\": \"dev\",",
" \"app\": \"app\"",
" },",
" \"keywords\": [",
" \"Node.js\",",
" \"NPM\",",
" \"JS\"",
" ]",
"",
"}"
],
"description": "NPM JSON Template & code snippets!"
}
}
json5
JSON5
{
"JSON5 Template": {
"prefix": "json5",
"body": [
"{",
" \"name\": \"$1npm node project\",",
" \"description\": \"$2an open source project created by xgqfrms\",",
" \"author\": \"xgqfrms\",",
" \"version\": \"1.1.1\",",
" \"license\": \"MIT\",",
" \"private\": true,",
" \"scripts\": {",
" \"dev\": \"npm run start\",",
" \"app\": \"npm run build\",",
" \"rmrf\": \"rimraf dist/**/*\",",
" \"map\": \"rimraf dist/**/*.map\"",
" },",
" \"bin\": {",
" \"dev\": \"dev\",",
" \"app\": \"app\"",
" },",
" \"keywords\": [",
" \"Node.js\",",
" \"NPM\",",
" \"JS\"",
" ]",
"",
"}"
],
"description": "JSON5 Template & code snippets!"
}
}
jsonc
JSON with Comments
{
"JSON with Comments Template": {
"prefix": "jsonc",
"body": [
"{",
" \"name\": \"$1npm node project\",",
" \"description\": \"$2an open source project created by xgqfrms\",",
" \"author\": \"xgqfrms\",",
" \"version\": \"1.1.1\",",
" \"license\": \"MIT\",",
" \"private\": true,",
" \"scripts\": {",
" \"dev\": \"npm run start\",",
" \"app\": \"npm run build\",",
" \"rmrf\": \"rimraf dist/**/*\",",
" \"map\": \"rimraf dist/**/*.map\"",
" },",
" \"bin\": {",
" \"dev\": \"dev\",",
" \"app\": \"app\"",
" },",
" \"keywords\": [",
" \"Node.js\",",
" \"NPM\",",
" \"JS\"",
" ]",
"",
"}"
],
"description": "JSON with Comments Template & code snippets!"
}
}
refs
https://github.com/xgqfrms/vscode
https://github.com/xgqfrms/vscode/tree/master/code-snippets
https://github.com/xgqfrms/vscode/blob/master/code-snippets/typescript.json
https://github.com/xgqfrms/vscode/blob/master/code-snippets/javascript.json
https://github.com/xgqfrms/vscode/blob/master/code-snippets/html5.json
(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!
©xgqfrms 2012-2021
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/9226993.html
未经授权禁止转载,违者必究!