安装
- 安装vscode go 插件
- ctrl+shift+p 打开命令面板,
- go install tools
- 选择全部插件,
- 安装
vscode 配置
用户配置
{
"breadcrumbs.enabled": true,
"editor.fontFamily": "JetBrains Mono, Source Code Pro, Consolas, Ubuntu Mono, Cascadia Code, Fira Code",
"editor.fontLigatures": "'ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06', 'zero', 'onum'",
"editor.fontSize": 16,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.maxTokenizationLineLength": 200000,
"editor.minimap.enabled": false,
"editor.renderControlCharacters": true,
"editor.renderIndentGuides": false,
"editor.tabSize": 4,
"editor.tabCompletion": "on",
"editor.wordWrap": "on",
"editor.rulers": [
100,
],
"extensions.autoCheckUpdates": true,
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"terminal.integrated.fontSize": 18,
"terminal.integrated.copyOnSelection": true,
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.rightClickBehavior": "paste",
"workbench.activityBar.visible": true,
"workbench.colorTheme": "Darcula Pycharm with Light GUI",
"workbench.iconTheme": "vscode-icons",
"workbench.editor.highlightModifiedTabs": true,
"workbench.colorCustomizations": {
"editorCursor.foreground": "#7fff00",
"window.activeBorder": "#cc8111",
"window.inactiveBorder": "#295c8a"
},
"diffEditor.renderSideBySide": false,
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/dist": true,
"**/build": true,
"**/elehukouben": true,
"**/.git": true,
"**/.gitignore": true,
"**/.svn": true,
"**/.DS_Store": true,
"**/.idea": true,
"**/.vscode": false,
"**/yarn.lock": true,
},
"amVim.bindCtrlCommands": false,
"amVim.startInInsertMode": true,
"rust-analyzer.updates.askBeforeDownload": true,
"go.useLanguageServer": true,
"go.testFlags": [
"-v"
],
"[go]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"editor.snippetSuggestions": "top",
},
"gopls": {
"usePlaceholders": true,
"completeUnimported": true,
"completionDocumentation": true,
"hoverKind": "SynopsisDocumentation",
},
"python.languageServer": "Pylance",
"window.menuBarVisibility": "compact",
"window.zoomLevel": 0,
"workbench.editorAssociations": [
{
"viewType": "jupyter.notebook.ipynb",
"filenamePattern": "*.ipynb"
}
],
"explorer.confirmDelete": false,
}
参考
https://code.visualstudio.com/docs/languages/go