一文搞懂vscode的几项基本配置(超详细讲解) - 沐歌爱编程 - 博客园 (cnblogs.com)
这两天搭建android后端开发云服务器,想通过vscode连接服务器直接进行后端和数据库开发,但是在连接时无论怎么连接都连接不上服务器。使用的解决方法有,重装vscode,重装remote-ssh插件,进行各种拓展文件设置等等。
最终,发现问题出在了一个网络上的教程都没提到的地方,就是setting-json文件。以前安装latex的时候,更改过该文件,导致其中的支持远端连接的配置失效了。而且相关的配置文件会保存在你的电脑中,即时重装也不会改变,所以需要手动将之修改。其默认配置为:
{
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
// "wrap_attributes": "force-expand-multiline",
"wrap_line_length": 150, // 换行字符串阈值
"wrap_attributes": "auto",
"end_with_newline": false // html 属性是否换行
},
"prettyhtml": {
"printWidth": 100,
"singleQuote": false, // //去掉末尾分号
"wrapAttributes": false,
"sortAttributes": false
},
"prettier": {
"semi": false, //去掉末尾分号
"singleQuote": true //将所有双引号改为单引号
}
},
"editor.tabSize": 2, //缩进2个空格
"javascript.format.insertSpaceBeforeFunctionParenthesis": true, //在方括号之间插入空格
"vetur.format.defaultFormatter.js": "vscode-typescript",
//iview组件eslint报告Col闭合标签问题
"vetur.validation.template": false,
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
"workbench.iconTheme": "vscode-icons",
"extensions.ignoreRecommendations": true,
"window.zoomLevel": 0.8,
"editor.fontSize": 15,
"explorer.confirmDelete": false,
"vetur.format.defaultFormatter.html": "js-beautify-html",
"remote.SSH.remotePlatform": {
"182.92.209.16": "linux"
}
}
同时,告诫自己,身为计算机人儿,千万不要被花里胡哨的教程和软件界面啥吓到了,一定要抓住程序的内核问题。文章开头的链接,多读读,深入挖掘vscode!