1、快速下载
Visual Studio Code在官网的下载速度感人,蚂蚁搬家的速度,在官网获取下载地址,然后把 az764295.vo.msecnd.net
替换成 vscode.cdn.azure.cn
例如:
官网下载地址:
https://az764295.vo.msecnd.net/stable/f1b07bd25dfad64b0167beb15359ae573aecd2cc/VSCode-win32-x64-1.83.1.zip
修改后下载地址:
https://vscode.cdn.azure.cn/stable/f1b07bd25dfad64b0167beb15359ae573aecd2cc/VSCode-win32-x64-1.83.1.zip
以下是国内镜像VSCode-1.83.1
下载地址:
win x64
User Installer
https://vscode.cdn.azure.cn/stable/f1b07bd25dfad64b0167beb15359ae573aecd2cc/VSCodeUserSetup-x64-1.83.1.exe
System Installer
https://vscode.cdn.azure.cn/stable/f1b07bd25dfad64b0167beb15359ae573aecd2cc/VSCodeSetup-x64-1.83.1.exe
.zip
https://vscode.cdn.azure.cn/stable/f1b07bd25dfad64b0167beb15359ae573aecd2cc/VSCode-win32-x64-1.83.1.zip
注:user版会安装在当前计算机帐户目录,这意味着如果使用另一个帐号登陆计算机将无法使用别人安装的vscode。而system版本可以安装在非用户目录,例如C盘根目录,任何帐户都可以使用。
system installer和user installer的区别就在用于为所有用户/单用户安装。
这个是主要的区别
vscode默认提供的user版本,大多数人都是用的这个版本。
其他包
MAC .zip
Intel chip
https://vscode.cdn.azure.cn/stable/f1b07bd25dfad64b0167beb15359ae573aecd2cc/VSCode-darwin.zip
Apple silicon
https://vscode.cdn.azure.cn/stable/f1b07bd25dfad64b0167beb15359ae573aecd2cc/VSCode-darwin-arm64.zip
2、自动识别文件编码
我们的vscode打开文件默认是utf-8编码,当我们打开其他编码文件(例如gb2312)时就会产生乱码现象。
开启vscode是识别功能的,方法如下:
依次打开,文件 》首选项 》设置
然后设置界面就会变化,在搜索框内搜索【files.autoGuessEncoding】,就会出现设置项,勾选上就可以了。
或者 打开settings.json
复制下面代码
"files.autoGuessEncoding": true,
3 、格式化HTML代码保持标签属性不换行
用户设置》扩展》Vetur》Vetur>Format:Default Formatter Options
点击 【在settings.json中编辑】,复制下面脚本,如之前有过设置属性,外层括号不复制
{ "vetur.format.defaultFormatter.html": "js-beautify-html",
"emmet.includeLanguages": {
"wxml": "html"
},
"minapp-vscode.disableAutoConfig": true,
"explorer.confirmDelete": false,
"vetur.format.options.tabSize": 4,
"vetur.format.defaultFormatterOptions":{
"js-beautify-html":{
"wrap_attributes":"auto"
}
},
"html.format.wrapLineLength": 12000,//每行字符长度,自行设置
}