VSCode代码片段,配置文件

1.代码片段

{
	"vue2 + js": {
		"prefix": "vb2", // 这个就是代码片段的快捷键,我们自定义的
		"body": [
			"<template>",
			"  <div>$0</div>",
			"</template>",
			"",
			"<script>",
			"export default {",
			"  data () {",
			"    return {\n",
			"    }",
			"  },",
			"  components: {\n",
			"  },",
			"  mounted() {\n",
			"  },",
			"  methods: {\n",
			"  },",
			"}",
			"",
			"</script>",
			"<style scoped lang='scss'>",
			"</style>"
		],
		"description": "vue2 快速生成代码块"
	},
	"Print to console": {
	    "prefix": "ccc",
	    "body": [
	     "console.log($1)"
	    ],
	    "description": "Log output to console"
  }
}

2. 配置文件
{
	"editor.lineHeight": 24,
	//开启行数提示
	"editor.lineNumbers": "on",
	// 在输入时显示含有参数文档和类型信息的小面板。
	"editor.parameterHints.enabled": true,
	"window.zoomLevel": 0,
	"editor.fontFamily": "'Source Code Pro','Consolas','Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
	// 自定义vscode面板颜色
	"workbench.colorCustomizations": {
		"tab.activeBackground": "#253046", // 活动选项卡的背景色
		// "activityBar.background": "#253046", //活动栏背景色
		// "sideBar.background": "#253046", //侧边栏背景色
		"activityBar.foreground": "#23f8c8" //活动栏前景色(例如用于图标)
		// "editor.background": "#292a2c" //编辑器背景颜色
	},
	// vscode默认启用了根据文件类型自动设置tabsize的选项
	"editor.detectIndentation": false,
	// 重新设定tabsize
	"editor.tabSize": 2,
	// 添加emmet支持vue文件
	"emmet.includeLanguages": {
		"wxml": "html",
		"vue-html": "html",
		"wpy": "html"
	},
	//快速预览(右侧)
	"editor.minimap.enabled": true,
	// tab 代码补全
	"files.associations": {
		"*.wpy": "vue",
		"*.vue": "vue",
		"*.cjson": "jsonc",
		"*.wxss": "css",
		"*.wxs": "javascript",
		".prettierrc": "plaintext"
	},
	//关闭rg.exe进程 用cnpm导致会出现rg.exe占用内存很高
	"search.followSymlinks": false,
	// 控制资源管理器是否在把文件删除到废纸篓时进行确认。
	"explorer.confirmDelete": true,
	"workbench.colorTheme": "One Dark Pro",
	"terminal.integrated.defaultProfile.windows": "Command Prompt",
	//编辑器格式化工具
	"editor.defaultFormatter": "esbenp.prettier-vscode",
	// vue 格式化工具
	"[vue]": {
		"editor.defaultFormatter": "octref.vetur"
	},
	// javascript 格式化工具
	"[javascript]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	},
	// typescript 格式化工具
	"[typescript]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	},
	// less 格式化工具
	"[less]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	},
	// scss 格式化工具
	"[scss]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	},
	"vetur.format.styleInitialIndent": true,
	"vetur.ignoreProjectWarning": true,
	"vetur.format.options.tabSize": 2,
	// 格式化.vue中html
	"vetur.format.defaultFormatter.html": "js-beautify-html",
	// 让vue中的js按编辑器自带的ts格式进行格式化
	"vetur.format.defaultFormatter.js": "vscode-typescript",
	"vetur.format.defaultFormatterOptions": {
		"js-beautify-html": {
			"wrap_attributes": "auto", // 属性强制折行对齐 // 对属性进行换行。
			// - auto: 仅在超出行长度时才对属性进行换行。
			// - force: 对除第一个属性外的其他每个属性进行换行。
			// - force-aligned: 对除第一个属性外的其他每个属性进行换行,并保持对齐。
			// - force-expand-multiline: 对每个属性进行换行。
			// - aligned-multiple: 当超出折行长度时,将属性进行垂直对齐。
			"wrap_line_length": 12000,
			"semi": false,
			"end_with_newline": false
		},
		"prettier": {
			"semi": false, //去掉代码结尾的分号
			"singleQuote": true //使用单引号替代双引号
		},
		"vscode-typescript": {
			"semi": false,
			"singleQuote": true
		}
	},
	// 定义匿名函数的函数关键字后面的空格处理。
	"javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
	// 定义函数参数括号前的空格处理方式。
	"typescript.format.insertSpaceBeforeFunctionParenthesis": false,
	// 新版本消息
	"vsicons.dontShowNewVersionMessage": true,

	"editor.fontLigatures": false,
	"eslint.format.enable": true,
	"eslint.validate": ["vue", "javascript", "typescript", "typescriptreact", "html"],
	"workbench.startupEditor": "none",
	"beautify.options": {},
	"editor.fontWeight": "normal",
	"workbench.editor.enablePreview": false,
	"prettier.semi": false,
	"prettier.tabWidth": 2,
	"prettier.vueIndentScriptAndStyle": true,
	"prettier.useEditorConfig": false,
	"editor.codeActionsOnSave": {},
	"prettier.printWidth": 240,
	"settingsSync.ignoredSettings": [],

	"javascript.format.insertSpaceAfterConstructor": true,
	"prettier.arrowParens": "avoid",
	/* 	//是否开启
	"powermode.enabled": true,
	//效果样式  “水花-particles”, “烟花-fireworks”, “火焰-flames”, “雪花-magic”, “幽灵-clippy”, “激光-simple-rift”, “大激光-exploding-rift”
	"powermode.presets": "particles",
	//时间间隔
	"powermode.combo.timeout": 5,
	//是否抖动
	"powermode.shake.enabled": false, */
	"better-comments.highlightPlainText": true,
	"prettier.jsxSingleQuote": true,
	"prettier.useTabs": true,
	"js/ts.implicitProjectConfig.experimentalDecorators": true,
	"editor.guides.bracketPairs": true,
	"editor.fontSize": 16,
	"prettier.singleQuote": true,
	"vue.inlayHints.optionsWrapper": false,
	"typescript.suggestionActions.enabled": false,
	"javascript.suggestionActions.enabled": false,
	"git.confirmSync": false,
	"editor.accessibilitySupport": "off",
	"[dotenv]": {
		"editor.defaultFormatter": "foxundermoon.shell-format"
	},
	"editor.wordWrap": "on",
	"cssrem.rootFontSize": 75,
	"cssrem.remHover": false,
	"cssrem.wxss": true,
	"cssrem.vw": true,
	"cssrem.vwHover": false,
	"css.enabledLanguages": ["html"]
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值