VScode插件推荐
Posted jayfeng
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了VScode插件推荐相关的知识,希望对你有一定的参考价值。
一、代码片段类插件
英文叫做 Snippets,就是把常见的代码模式抽出来,通过 2~3 个键就能展开 N 行代码。
VS Code javascript(ES6) snippets
当前最流行的,已有超过 120 万的下载量。这个插件为 JavaScript、TypeScript、html、React 和 Vue 提供了 ES6 的语法支持;
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-0aa0012e314a6f18.png?imageMogr2/auto-orient/strip|imageView2/2/w/817/format/webp)
React-Redux ES6 Snippets
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-3cae69a7ca405200.png?imageMogr2/auto-orient/strip|imageView2/2/w/774/format/webp)
jQuery Code Snippets
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-159bc466a271d730.png?imageMogr2/auto-orient/strip|imageView2/2/w/787/format/webp)
二、自动补全类插件
Path Intellisense
自动路劲补全
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-76e0594a30a9290e.png?imageMogr2/auto-orient/strip|imageView2/2/w/787/format/webp)
Visual Studio IntelliCode
从 GitHub 上高星的开源项目经过大量的机器学习训练,给开发者提供最合适的 IntelliSense 上下文建议功能,除此之外,还有代码格式化和规则推测等功能。
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-fc6b47bf6e57f808.png?imageMogr2/auto-orient/strip|imageView2/2/w/758/format/webp)
Npm Intellisense
用于在import语句中自动填充npm模块
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-c569b71028ac362c.png?imageMogr2/auto-orient/strip|imageView2/2/w/750/format/webp)
IntelliSense for CSS class names
智能提示 css 的 class 名,目前也没有用
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-b04b25e3f66d6b2c.png?imageMogr2/auto-orient/strip|imageView2/2/w/872/format/webp)
Vetur
Vue 的语法高亮、智能感知、Emmet 等;
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-25874aba2a4a1aa6.png?imageMogr2/auto-orient/strip|imageView2/2/w/748/format/webp)
Surround
在你的代码块中增加外包裹模板
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-6a55982a8b9a2e86.png?imageMogr2/auto-orient/strip|imageView2/2/w/734/format/webp)
htmltagwrap
可以在选中HTML标签中外面套一层标签
使用方法:选中要包裹的代码,快捷键Alt+w,默认外包裹标签为p,可以在设置里搜索htmltagwrap将外包裹标签改为div
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-bac854c992d78f7f.png?imageMogr2/auto-orient/strip|imageView2/2/w/706/format/webp)
Image Preview
鼠标悬浮在链接或者装订线(gutter)左边可以预览到图片
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-0f7c36bb809b81af.png?imageMogr2/auto-orient/strip|imageView2/2/w/694/format/webp)
HTML CSS Support
让 html 标签上写class 智能提示当前项目所支持的样式。目前没有用,可能是因为当前作者的开发模式是html和css分开文件开发的。
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-4f99d01ac16f5a4b.png?imageMogr2/auto-orient/strip|imageView2/2/w/777/format/webp)
三、功能增强插件
Debugger for Chrome
让 vscode 映射 chrome 的 debug 功能,静态页面都可以用 vscode 来打断点调试,需要另外配置,有点麻烦;
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-45af6aa93e8b0994.png?imageMogr2/auto-orient/strip|imageView2/2/w/914/format/webp)
Project Manager
在多个项目之前快速切换的工具
工程项目过多时,shift+cmd+p(shift+ctrl+p) 然后输入project,第一次选择edit Project编辑自己的工程项目,之后就可以直接选择open打开你的项目
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-72766968e5d36b16.png?imageMogr2/auto-orient/strip|imageView2/2/w/772/format/webp)
jumpy
通过快捷键快速跳转至某一个位置,对windows来说没什么用
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-6e1e0371b89b5c96.png?imageMogr2/auto-orient/strip|imageView2/2/w/779/format/webp)
language-stylus
为Stylus文件添加语法突出显示,stylus是 CSS 的预处理框架
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-3983071d33816c1a.png?imageMogr2/auto-orient/strip|imageView2/2/w/690/format/webp)
code spell checker
检查你的英文单词拼写是否有误,如果有库里不存在的单词则会下下波浪线
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-d5f92e72f24d9904.png?imageMogr2/auto-orient/strip|imageView2/2/w/762/format/webp)
Settings Sync
Visual Studio代码设置同步,需要github账号辅助的
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-ecfbe80b315c7432.png?imageMogr2/auto-orient/strip|imageView2/2/w/964/format/webp)
JS Refactor
自动重构工具,目前没发现没怎么用
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-b5445dda624e5ad9.png?imageMogr2/auto-orient/strip|imageView2/2/w/735/format/webp)
turbo console log
自动编写有意义的日志消息
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-ef65ec3534989831.png?imageMogr2/auto-orient/strip|imageView2/2/w/743/format/webp)
以下是作者本人的快捷键设置
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-a2959eaeed4942cb.png?imageMogr2/auto-orient/strip|imageView2/2/w/479/format/webp)
turboConsoleLog.displayLogMessage //control+option+L
change case
虽然 VSCode 内置了开箱即用的文本转换选项,但其只能进行文本大小写的转换。而此插件则添加了用于修改文本的更多命名格式,包括驼峰命名、下划线分隔命名,snake_case 命名以及 CONST_CAS 命名等。
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-bf200dd9b9b75f7d.png?imageMogr2/auto-orient/strip|imageView2/2/w/882/format/webp)
在快捷键配置中配置
extension.changeCase.camel //快捷键设置为ctrl+alt+u /commond+option+u将下划线转驼峰
extension.changeCase.snake //快捷键设置为alt+u /control+option+u 将驼峰转为下划线
四、markdown相关插件
Markdown All in One
让vscode支持markdown .md文件
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-74baa69b8c127eb0.png?imageMogr2/auto-orient/strip|imageView2/2/w/783/format/webp)
Markdown Preview Enhanced(未用)
实时预览markdown,markdown使用者必备
markdownlint
markdown语法纠错
五、Git相关插件
GitLens
丰富的 git 日志插件,非常强大,具体看官方介绍或者https://segmentfault.com/a/1190000015360390
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-4445e5a935830ef3.png?imageMogr2/auto-orient/strip|imageView2/2/w/960/format/webp)
Git blame
blame是追溯的意思,查看当前文件历史上谁修改过
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-ae1750f7e2d668fc.png?imageMogr2/auto-orient/strip|imageView2/2/w/710/format/webp)
编辑器左下角能看到是最近一次的编辑信息,点击右下角弹窗可直接打开网页gitlab,查看提交记录
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-a9bc09be134e7bf8.gif?imageMogr2/auto-orient/strip|imageView2/2/w/869/format/webp)
.Git History
以图表的形式查看以及根据条件搜索git日志
在当前文件右键点击Git:viewFileHistory,就能查看当前文件的所有提交信息,并且支持筛选,搜索。
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-70b943ca2b7292b4.png?imageMogr2/auto-orient/strip|imageView2/2/w/754/format/webp)
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-e5e020996815870d.gif?imageMogr2/auto-orient/strip|imageView2/2/w/1200/format/webp)
gi
gi是gitignore缩写,它可以在Visual Studio Code内部生成.gitignore文件的扩展。gi
使用gitignore.io API来更新操作系统,IDE和编程语言列表。
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-c5daa68065ac4e9e.png?imageMogr2/auto-orient/strip|imageView2/2/w/760/format/webp)
六、代码检测相关插件
ESlint
ESlint 接管原生 js 提示,可以自定制提示规则;
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-a36c2445eb62c745.png?imageMogr2/auto-orient/strip|imageView2/2/w/709/format/webp)
TSLint
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-847249dcc85a9502.png?imageMogr2/auto-orient/strip|imageView2/2/w/739/format/webp)
Regex Previewer
这是一个用于实时测试正则表达式的实用工具。它可以将正则表达式模式应用在任何打开的文件上,并高亮所有的匹配项。
在并排文档中显示当前正则表达式的匹配项
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-57eb11465e2978da.png?imageMogr2/auto-orient/strip|imageView2/2/w/803/format/webp)
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-39ca041c8142213b.gif?imageMogr2/auto-orient/strip|imageView2/2/w/718/format/webp)
七、美化编辑器类
Bracket Pair Colorizer
让括号拥有独立的颜色,易于区分。可以配合任意主题使用
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-569215b3153746b8.png?imageMogr2/auto-orient/strip|imageView2/2/w/815/format/webp)
使用结果:
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-a77834dccf9edef3.png?imageMogr2/auto-orient/strip|imageView2/2/w/504/format/webp)
vscode-icon
让 vscode 资源树目录加上图标
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-54dea10dc2a36f5e.png?imageMogr2/auto-orient/strip|imageView2/2/w/852/format/webp)
color highlight
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-ebe80ea4266b5f2d.png?imageMogr2/auto-orient/strip|imageView2/2/w/749/format/webp)
Output Colorizer
输出提示的文字颜色有一些变化,方便获取关键信息
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-249a29de4f7c5c76.png?imageMogr2/auto-orient/strip|imageView2/2/w/707/format/webp)
Guides
指导线,当前所在的级别缩进线会变红,当前在哪一级一目了然。
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-1445a324e731336d.png?imageMogr2/auto-orient/strip|imageView2/2/w/667/format/webp)
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-0600a1ca796127c0.png?imageMogr2/auto-orient/strip|imageView2/2/w/513/format/webp)
Log File Highlighter
日志文件(.log后缀的文件)高亮
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-bfb8d9bf0b5c839e.png?imageMogr2/auto-orient/strip|imageView2/2/w/851/format/webp)
八、其他
Laravel goto view
跳转到相应的文件路径
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-a6e086d77da46000.png?imageMogr2/auto-orient/strip|imageView2/2/w/724/format/webp)
open in browser
当前的 html 文件用浏览器打开,快捷键alt+b,或者右键点击html文件,选择open in default Browsers
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-fe0f80eecdee33f6.png?imageMogr2/auto-orient/strip|imageView2/2/w/723/format/webp)
sass
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-e94402c491a39a38.png?imageMogr2/auto-orient/strip|imageView2/2/w/723/format/webp)
TypeScript Hero
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-5f0f51426d62028f.png?imageMogr2/auto-orient/strip|imageView2/2/w/797/format/webp)
Remote
远程开发用的
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-cecce860cd2cc4d3.png?imageMogr2/auto-orient/strip|imageView2/2/w/755/format/webp)
TODO相关
Todo Tree
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-8ea7bfb525fe7d56.png?imageMogr2/auto-orient/strip|imageView2/2/w/757/format/webp)
TODO Highlight
能够在你的代码中标记出所有的 TODO 注释,以便更容易追踪任何未完成的业务
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-6523217da95047f5.png?imageMogr2/auto-orient/strip|imageView2/2/w/689/format/webp)
提示类
Import Cost
在编辑器中显示引入包的大小
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-2d364d589fbe4f0e.png?imageMogr2/auto-orient/strip|imageView2/2/w/697/format/webp)
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-ff193927a6c8465d.png?imageMogr2/auto-orient/strip|imageView2/2/w/629/format/webp)
filesize
在底部状态栏显示当前文件大小,点击后还可以看到详细创建、修改时间
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-aa2d84fa58018652.png?imageMogr2/auto-orient/strip|imageView2/2/w/789/format/webp)
Quokka.js
实时观看 javascript 的变量的变化
先shift+cmd+p (ctrl+shift+p)输入 quokka 选择 new javascript 就行了
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-3a2c321ba4827cd0.png?imageMogr2/auto-orient/strip|imageView2/2/w/683/format/webp)
CSS peek
使用此插件,你可以追踪至样式表中 CSS 类和 ids 定义的地方。当你在 HTML 文件中右键单击选择器时,选择“ Go to Definition 和 Peek definition ”选项,它便会给你发送样式设置的 CSS 代码。
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-e8801418de7cca93.png?imageMogr2/auto-orient/strip|imageView2/2/w/926/format/webp)
注释类
1.Better Comments
使注释有人性化的高亮显示
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-2819a2604ccee9fc.png?imageMogr2/auto-orient/strip|imageView2/2/w/772/format/webp)
使用方法:
/**
* 我的方法
* *重要的信息会被高亮显示
* !及其反对的代码,不要使用
* TODO 重构此方法
* @param 该方法的参数
*/
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-f33df1a483a78dd0.png?imageMogr2/auto-orient/strip|imageView2/2/w/388/format/webp)
Document This
快速注释
fileheader
顶部注释模板,可定义作者、时间等信息,并会自动更新最后修改时间
ctrl + alt + i你可以在头部插入注释,ctrl + s保存文件后,自动更新时间和作者。
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-11cc8ef77562727c.png?imageMogr2/auto-orient/strip|imageView2/2/w/629/format/webp)
图片相关
SVG Viewer(目前还没用)
无需离开编辑器,便可以打开 SVG 文件并查看它们
![技术图片](http://upload-images.jianshu.io/upload_images/9813501-9eb94e64bd58bdd0.png?imageMogr2/auto-orient/strip|imageView2/2/w/663/format/webp)
以上是关于VScode插件推荐的主要内容,如果未能解决你的问题,请参考以下文章