一、自用 vscode插件
DeepSeek VS Code 插件
console插件
Auto Logger Log
二、v2-v3代码片段
v2 代码片段
{
// 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:
// "Print to console": {
// "scope": "javascript,typescript",
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"Print to console": {
"scope": "vue",
"prefix": "vue",
"body": [
"<template>",
"<div class=''>",
"",
"</div>",
"</template>",
"",
"<script>",
"export default {",
"data() {",
"return {};",
"},",
"mounted() {},",
"methods: {},",
"components: {},",
"computed: {},",
"};",
"</script>",
"",
"<style lang='scss' scoped>",
"",
"</style>",
""
],
"description": "Log output to console"
}
}
v3代码片段
{
// Place your snippets for vue 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"
// }
"Print to console": {
"scope": "vue",
"prefix": "vs",
"body": [
"<template>",
" <div class='home'>",
" ",
" </div>",
"</template>",
"<script setup>",
" import { reactive, toRefs, onMounted } from 'vue'",
"//import { useRoute,useRouter } from 'vue-router'",
"//const route = useRoute()",
" //const router = useRouter()",
"//const id = route.query.id",
" const data = reactive({",
" list: [],",
" })",
" const getList = () => {}",
" onMounted(() => {",
" getList()",
" })",
"const { list } = toRefs(data)",
"</script>",
"<style lang='scss' scoped>",
" .home {",
" }",
" .flex {",
" display: flex;",
" }",
" .flex-s {",
" display: flex;",
"justify-content: space-between;",
" }",
"</style>",
],
"description": "Log output to console"
}
}
eslint配置项
{
"workbench.colorTheme": "The Ultimate Cool",
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"security.workspace.trust.untrustedFiles": "open",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.fontLigatures": false,
"editor.suggestSelection": "first",
"workbench.colorCustomizations": {
"editor.selectionBackground": "#e29607f8"
},
"workbench.iconTheme": "material-icon-theme",
"explorer.confirmDragAndDrop": false,
"explorer.confirmDelete": true, // 启用保存时自动修复,默认只支持.js文件
"eslint.validate": [
"javascript", // 用eslint的规则检测js文件
{
"language": "vue", // 检测vue文件
"autoFix": true // 为vue文件开启保存自动修复的功能
},
{
"language": "html",
"autoFix": true
}
],
// vscode默认启用了根据文件类型自动设置tabsize的选项
"editor.detectIndentation": false, // 检测缩进
"editor.tabSize": 2, // tab 空格
"editor.formatOnSave": false, // 保存时格式化 于vue中eslint冲突
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"fileheader.cursorMode": {
"description": "",
"param": "",
"return": ""
},
"fileheader.customMade": {
"Author": "zhouyx",
"Date": "Do not edit",
"LastEditTime": "Do not edit",
"LastEditors": "zhouyx",
"FilePath": "Do not edit", // 设置后,默认生成文件相对于项目的路径
"程序猿": "佛祖保佑 永不宕机 永无BUG"
},
"fileheader.configObj": {
"createFileTime": true,
"autoAdd": true,
"language": {
"languagetest": {
"head": "/$$",
"middle": " $ @",
"end": " $/"
}
},
"autoAddLine": 100,
"autoAlready": true,
"annotationStr": {
"head": "/*",
"middle": " * @",
"end": " */",
"use": true
},
"headInsertLine": {
"php": 2,
"sh": 2
},
"beforeAnnotation": {
"文件后缀": "该文件后缀的头部注释之前添加某些内容"
},
"afterAnnotation": {
"文件后缀": "该文件后缀的头部注释之后添加某些内容"
},
"specialOptions": {
"特殊字段": "自定义比如LastEditTime/LastEditors"
},
"switch": {
"newlineAddAnnotation": true
},
"supportAutoLanguage": [],
"prohibitAutoAdd": ["json"],
"folderBlacklist": ["node_modules", "文件夹禁止自动添加头部注释"],
"prohibitItemAutoAdd": [
"项目的全称, 整个项目禁止自动添加头部注释, 可以使用快捷键添加"
],
"moveCursor": true,
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"atSymbol": ["@", "@"],
"atSymbolObj": {
"文件后缀": ["头部注释@符号", "函数注释@符号"]
},
"colon": [": ", ": "],
"colonObj": {
"文件后缀": ["头部注释冒号", "函数注释冒号"]
},
"filePathColon": "路径分隔符替换",
"showErrorMessage": false,
"writeLog": false,
"wideSame": false,
"wideNum": 13,
"functionWideNum": 0,
"CheckFileChange": false,
"createHeader": true,
"useWorker": false,
"designAddHead": false,
"headDesignName": "random",
"headDesign": false,
"cursorModeInternal": false,
"openFunctionParamsCheck": true,
"functionParamsShape": "normal",
"functionBlankSpace": 0
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"settingsSync.ignoredExtensions": [],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"eslint.autoFixOnSave": true,
"workbench.editor.enablePreview": false,
"files.autoSave": "afterDelay",
"workbench.colorTheme": "The Ultimate Cool",
"settingsSync.ignoredSettings": []
}