安装

  1. 安装vscode go 插件
  2. ctrl+shift+p 打开命令面板,
  3. go install tools
  4. 选择全部插件,
  5. 安装

vscode 配置

用户配置

  1. {
  2. "breadcrumbs.enabled": true,
  3. "editor.fontFamily": "JetBrains Mono, Source Code Pro, Consolas, Ubuntu Mono, Cascadia Code, Fira Code",
  4. "editor.fontLigatures": "'ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06', 'zero', 'onum'",
  5. "editor.fontSize": 16,
  6. "editor.formatOnSave": true,
  7. "editor.formatOnType": true,
  8. "editor.maxTokenizationLineLength": 200000,
  9. "editor.minimap.enabled": false,
  10. "editor.renderControlCharacters": true,
  11. "editor.renderIndentGuides": false,
  12. "editor.tabSize": 4,
  13. "editor.tabCompletion": "on",
  14. "editor.wordWrap": "on",
  15. "editor.rulers": [
  16. 100,
  17. ],
  18. "extensions.autoCheckUpdates": true,
  19. "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
  20. "terminal.integrated.fontSize": 18,
  21. "terminal.integrated.copyOnSelection": true,
  22. "terminal.integrated.cursorBlinking": true,
  23. "terminal.integrated.rightClickBehavior": "paste",
  24. "workbench.activityBar.visible": true,
  25. "workbench.colorTheme": "Darcula Pycharm with Light GUI",
  26. "workbench.iconTheme": "vscode-icons",
  27. "workbench.editor.highlightModifiedTabs": true,
  28. "workbench.colorCustomizations": {
  29. "editorCursor.foreground": "#7fff00",
  30. "window.activeBorder": "#cc8111",
  31. "window.inactiveBorder": "#295c8a"
  32. },
  33. "diffEditor.renderSideBySide": false,
  34. "search.exclude": {
  35. "**/node_modules": true,
  36. "**/bower_components": true,
  37. "**/dist": true,
  38. "**/build": true,
  39. "**/elehukouben": true,
  40. "**/.git": true,
  41. "**/.gitignore": true,
  42. "**/.svn": true,
  43. "**/.DS_Store": true,
  44. "**/.idea": true,
  45. "**/.vscode": false,
  46. "**/yarn.lock": true,
  47. },
  48. "amVim.bindCtrlCommands": false,
  49. "amVim.startInInsertMode": true,
  50. "rust-analyzer.updates.askBeforeDownload": true,
  51. "go.useLanguageServer": true,
  52. "go.testFlags": [
  53. "-v"
  54. ],
  55. "[go]": {
  56. "editor.codeActionsOnSave": {
  57. "source.organizeImports": true
  58. },
  59. "editor.snippetSuggestions": "top",
  60. },
  61. "gopls": {
  62. "usePlaceholders": true,
  63. "completeUnimported": true,
  64. "completionDocumentation": true,
  65. "hoverKind": "SynopsisDocumentation",
  66. },
  67. "python.languageServer": "Pylance",
  68. "window.menuBarVisibility": "compact",
  69. "window.zoomLevel": 0,
  70. "workbench.editorAssociations": [
  71. {
  72. "viewType": "jupyter.notebook.ipynb",
  73. "filenamePattern": "*.ipynb"
  74. }
  75. ],
  76. "explorer.confirmDelete": false,
  77. }

参考

https://code.visualstudio.com/docs/languages/go