vscode 插件和配置
程序员文章站
2022-06-01 10:22:55
...
通用
- vscode-icons
- Prettier - Code formatter:配合 vscode 保存自动格式化
- Atom One Dark Theme
- Auto Close Tag
- Auto Rename Tag
- Bracket Pair Colorizer
- Chinese (Simplified) Language Pack for Visual Studio Code
- Code Runner
- CSS Peek
- Document This ==> 快捷键 Ctrl+Alt+D and again Ctrl+Alt+D,生成.ts声明
- HTML CSS Support
- IntelliSense for CSS class names in HTML
- JavaScript (ES6) code snippets
- Live Server
- One Dark Pro
- Path Autocomplete
- Path Intellisense
- Prettier
- Project Manager
- VS Color Picker
- setting sync
- Git History - 通过vscode管理git
- Debugger for Chrome
- Debugger for Firefox
- Prettier - Code formatter
- editConfig for VS Code
配置说明
-
"editor.formatOnSave": false
:设置为true
,保存Prettier
自动格式化代码 -
setting sync
插件,自动同步vscode插件到GitHub
,配置详见插件本身。 - 通过vscode管理git,详见之前文章,Mac下git的三种方式
-
editConfig for VS Code
不同IDE配置相同的格式化
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
vue
- Vetur
- 在 User Setting 的 json 内配置格式化vue
// vetur 插件
"extensions.ignoreRecommendations": true,
"emmet.syntaxProfiles": {
"vue-html": "html",
"vue": "html"
},
"vetur.validation.template": false,
"eslint.options": {
"plugins": ["html"]
},
"eslint.validate": ["javascript", "javascriptreact", "html", "vue"],
"prettier.singleQuote": true,
"prettier.semi": false,
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.defaultFormatterOptions": {
"wrap_attributes": "force-aligned"
}
- 配置vue模板 - 输入vue然后tab
入口: cmd + shift + p 输入snippets,选择vue,进入 vue.json 文件拷贝如下代码
// vue 模板
"Print to console": {
"prefix": "vue",
"body": [
"<template>",
" <div class=\"main\">\n",
" </div>",
"</template>\n",
"<script>",
"export default {",
" components: {\n",
" },",
" data() {",
" return {\n",
" }",
" },",
" methods: {\n",
" },",
" computed: { },",
" watch: { },",
" mounted() {\n",
" },",
"}\n",
"</script>\n",
"<style scoped lang=\"less\">\n",
".main {\n",
"}",
"</style>",
"$2"
],
"description": "Log output to console"
}
- 模板效果图
<template>
<div class="main">
</div>
</template>
<script>
export default {
components: {
},
data() {
return {
}
},
methods: {
},
computed: { },
watch: { },
mounted() {
},
}
</script>
<style scoped lang="less">
.main {
}
</style>
微信小程序
- Easy WXLESS ==> 将 less 转为 wxss,在vue项目内停用该插件
- minapp
- 小程序助手
后记:wechat-snippet 和 minapp 补全会冲突,wechat-snippet 有 json 补全,但其他地方差强人意,更建议使用minapp,json手动拷贝即可。
备注
不能同步插件:
- Easy WXLESS ==> 将 less 转为 wxss,在vue项目内停用该插件
- minapp
- Live Server
todo
- ESLint 用法
- Beauty
格式化代码选择 prettier ,没有使用 beautiful 插件
转载于:https://www.jianshu.com/p/c15f9d8573a2
上一篇: 【vscode】sftp同步修改代码
下一篇: vscode配置
推荐阅读
-
struts2+Spring3+hibernate3零配置并且正式环境和开发环境不需要多大改动 Struts
-
Linux学习(一)--VMware下Linux安装和配置
-
java整合crud和分页插件操作mysql
-
eclipse配置Tomcat和Tomcat出现无效端口解决办法
-
基于Jquery和html5的7款个性化地图插件_jquery
-
PHP5安装配置和Zend Optimizer安装教程
-
myEclipse8.5和php的环境配置,该如何解决
-
Windows环境配置jenkins打包Android项目和vue项目
-
VSCode 使用Settings Sync同步配置(最新版教程,非常简单)
-
20个非常棒的 jQuery 幻灯片插件和教程分享_jquery