vscode 模仿goland的配置

image.png
image.png
image.png

把下面的復制到圖三,中,如果缺少什么插件,在下載

{
    "workbench.tree.indent": 26,
    "files.autoSave": "onFocusChange",
    "workbench.colorTheme": "Atom One Dark",
    "git.openRepositoryInParentFolders": "always",
    "workbench.preferredDarkColorTheme": "Solarized Dark",
    "editor.fontSize": 16,
    "editor.fontVariations": false,

    "editor.tokenColorCustomizations": {
        "[Atom One Dark]": {
            //"keywords": "#BD814C", // 關(guān)鍵字   
            "variables": "#B6B9B4", // 變量名
            "strings": "#76b975b0", // 字符串
            //"functions": "#416ed8", // 函數(shù)名
            //"types": "#FF0000",
            "textMateRules": [
                {
                    "scope": "keyword.operator",   // 加減乘除的顏色
                    "settings": {
                        "foreground": "#B6B9B4"
                    }
                }, 
                {
                    "scope":"keyword",   //package  type  function   struct  等關(guān)鍵字的顏色
                    "settings": {
                        "foreground": "#CF8E6D",
                    }
                },
                {
                    "scope":"keyword.control", //import的顏色
                    "settings": {
                        "foreground": "#BD814C"

                    }
                },
                {
                    "scope":"keyword.other", //import的顏色
                    "settings": {
                        "foreground": "#BD814C"

                    }
                },
                {
                    "scope":"entity.name.type", // 定義的類型名稱的顏色
                    "settings": {
                        "foreground": "#B6B9B4",
                    }
                },
                {
                    "scope":"entity.name.function",
                    "settings": {
                        "foreground": "#5b9fd6",
                    }
                },
                {
                    "scope": "meta.function.parameters",
                    "settings": {
                        "foreground": "#FF0000"
                    }
                }
                //{
                //    "scope": "keyword.type.go",
                //    "settings": {
                //        "foreground": "#FF0000"
                //    }
                //}
        
                //{
                //    "scope": [
                //        "variable.other.go",
                //        "variable.other.readwrite.go",
                //        "variable"
                        
                //    ],
                //    "settings": {
                //        "foreground": "#f2f0f1" // 未用后的變量顏色
                        
                //    }
                //},
                //{
                //    "scope": [
                //        "variable.other.used.go",
                //        "variable.other.assignment.go"
                //    ],
                //    "settings": {
                //        "foreground": "#6B7077" // 使用的變量顏色
                //    }
                //}
         
            ]
        },
        //"comments": "#5e615f", // 注釋
        //"keywords": "#BD814C", // 關(guān)鍵字
        //"variables": "#f2f0f1", // 變量名
        //"strings": "#76b975b0", // 字符串
        // "functions": "#416ed8", // 函數(shù)名
        //"numbers": "#9d1fbd", // 數(shù)字
        //"textMateRules": [
        //    {
        //        "scope": [
        //            "variable"
        //        ],
        //        "settings": {
        //            "foreground": "#f2f0f1"
        //            //"foreground": "#416ed8" // 方法定義顏色設置為淺藍色
        //        }
        //    },
        //]

    
    },

    "editor.semanticTokenColorCustomizations": {
        "rules": {
            "variable.read": {
                "foreground": "#FF0000" // 未使用的類型和方法顏色,這里使用紅色
            },
            "variable.write": {
                "foreground": "#00FF00" // 使用后的類型和方法顏色,這里使用綠色
            }
        }
    },
    "editor.lineHeight": 1.4,
    "editor.fontFamily": "JetBrains Mono, 'Courier New', monospace",
    "editor.fontLigatures": true,
    "terminal.integrated.fontFamily": "monospace",
    "editor.links": false,
    //"go.lintTool": "golangci-lint",
    //"go.lintFlags": [
    //    "--disable-all", 
    //    "--enable=errcheck"
    //],
    "editor.comments.insertSpace": false,
    "javascript.format.insertSpaceAfterCommaDelimiter": false,
    "javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
    "javascript.format.insertSpaceAfterKeywordsInControlFlowStatements": false,
    "javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
    "editor.renderLineHighlightOnlyWhenFocus": true,
    "terminal.integrated.lineHeight": 1.2,
    "terminal.integrated.fontSize": 15,
    "problems.showCurrentInStatus": true,
    "problems.decorations.enabled": false,

    "todo-tree.highlights.defaultHighlight": {
        "icon": "alert",
        "type": "text",
        "foreground": "#050505",
        "background": "#f2f0f1",
        "opacity": 50,
        "iconColour": "#416ed8"
    },
    "todo-tree.highlights.customHighlight": {
        "TODO": {
            "icon": "check",
            "type": "line"
        },
        "FIXME": {
            "foreground": "#050505",
            "iconColour": "#c2da9a",
            "gutterIcon": true
        }
    },
    "workbench.tree.renderIndentGuides": "always",
    "remote.SSH.remotePlatform": {
        "10.10.201.205": "linux"
    },
    "git.ignoreLegacyWarning": true,
    "gitlens.graph.minimap.dataType": "lines",
    "editor.minimap.renderCharacters": false,
    //"go.editorContextMenuCommands": {
    //    "benchmarkAtCursor": true
    //},

    //"go.highlightReferences": true,
    //"go.highlightUsesOfColor": {
    //    "write": "#FFA07A",
    //    "read": "#ADD8E6",
    //    "undeclared": "#FF0000"
    //},
     "go.formatTool": "gofmt", // go格式化工具
     "go.lintFlags": [        // 提示等級
         "-min_confidence=.8"
     ],
     // 檢查工具,默認staticcheck
     "go.lintTool": "golangci-lint",
     // go language service設置
 
     "gopls": {
         // 點擊import添跳轉(zhuǎn)到目錄,默認是跳轉(zhuǎn)到瀏覽器中去打開pkg.go.dev中的官方文檔
         "ui.navigation.importShortcut": "Definition",
         // 關(guān)閉鼠標懸浮在方法上面出現(xiàn)的pkg.go.dev的鏈接跳轉(zhuǎn)提示
         "ui.documentation.linksInHover": false
     },
     // 輸入提示上下文
     // https://github.com/golang/vscode-go/blob/master/docs/settings.md#uidiagnosticanalyses
     "go.editorContextMenuCommands": {
         "toggleTestFile": true,
         "addTags": true,
         "removeTags": false,
         "fillStruct": true,
         "testAtCursor": true,
         "testFile": false,
         "testPackage": false,
         "generateTestForFunction": true,
         "generateTestForFile": false,
         "generateTestForPackage": false,
         "addImport": true,
         "testCoverage": true,
         "playground": true,
         "debugTestAtCursor": true,
         "benchmarkAtCursor": false
     },
     // go結(jié)構(gòu)體tag設置, 
     "go.addTags": {
         "tags": "json",
        // "options": "", // 項目中不需要omitempty屬性可以設置為空 default "json=omitempty"
         "promptForTags": false,
         "transform": "camelcase", // Options: snakecase, camelcase, lispcase, pascalcase, keep
         "template": ""
     },
     // git設置,vscode中設置中文后,鼠標懸浮會有中文提示
     "git.untrackedChanges": "separate",
     "git.alwaysShowStagedChangesResourceGroup": true,
     // 工作區(qū)顏色設置,可自定義主題,此處的配置優(yōu)先級為最高,切換主題不會改變這里的配置
     "workbench.colorCustomizations": {
        //  "statusBar.background": "#909399",
 
        //  "panel.background": "#909399",
        "editor.background": "#21252B",
          "sideBar.background": "#282C34",
 /*  */
        //  "activityBar.background": "#EBEEF5",
 
        //  "menu.background": "#504f4f",
 
        //  "editor.selectionHighlightBackground": "#CD5C5C"
        //"editor.selectionBackground": "#050505",
         // 鼠標選擇的文字的顏色
         "editor.selectionHighlightBackground": "#be5343ea",
         // ctrl + f 時的搜索時選中的文字顏色
         "editor.findMatchBackground": "#be5443"
    },
    "go.toolsManagement.autoUpdate": true,
    "workbench.editor.enablePreview": false,
    "editor.bracketPairColorization.enabled": false,
    "diffEditor.codeLens": true,
    "editor.codeLens": true,
    "editor.minimap.enabled": false,
    "workbench.iconTheme": "vscode-jetbrains-icon-theme-2023-auto",
    "editor.unicodeHighlight.ambiguousCharacters": false,
    "go.coverOnTestPackage": false,
    "go.inlayHints.constantValues": true,
    "editor.inlineSuggest.showToolbar": "never",
    "editor.screenReaderAnnounceInlineSuggestion": false,
    "editor.parameterHints.enabled": false,
    "go.inlayHints.parameterNames": true
}
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容