vscode相关配置
tab 空格
使用vscode写golang,当进行保存的时候,会自动将文件格式化,同时将空格转化为tab,写习惯python觉得很不适应
修改方式:
1、将"editor.formatOnSave": false,
2、安装插件[ EditorConfig for VS Code ]
- 在workdir目录下增加文件.editorconfig
- 文件内容为
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
顺便贴一下vscode的go配置项
"go.formatTool": "goimports",
"go.useLanguageServer": true,
"[go]": {
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
},
"gopls": {
"completeUnimported": true,
"usePlaceholders": true,
"completionDocumentation": true,
"hoverKind": "SynopsisDocumentation", // No/Synopsis/Full, default Synopsis
"deepCompletion": true, // enable deep completion
},