美文网首页
VS code google代码风格设置

VS code google代码风格设置

作者: Optimization | 来源:发表于2020-04-06 19:54 被阅读0次

    参考资料:

    [1]VSCode 添加clang-format扩展
    [2]团队效率工具: 代码格式化之Clang-format

    操作:

    • VScode中安装Clang-Format插件


      image.png
    • 安装 clang-format(因为插件中需要填写可执行文件地址)
    sudo apt-get install clang-format
    
    • 打开File->Preference->Settings,点击右上角,打开settings.json


      image.png
    linux类似这样:
    {
        "clang-format.executable": "/usr/lib/llvm-3.8/bin/clang-format",
        //鼠标滑动改变字体大小
        "editor.mouseWheelZoom": true,
        //改变左侧界面字体
        "window.zoomLevel": 1.5,
        "editor.fontSize": 18,
        "[cpp]": {
            "editor.defaultFormatter": "xaver.clang-format"
        },
        "editor.formatOnSave": true,
        "clang-format.style": "Google",
        "extensions.ignoreRecommendations": true
        //改变编辑器字体大小
        //"editor.fontSize": 15,
    }
    
    win类似这样:
    {
        "editor.fontSize": 25,
        "window.zoomLevel": 0,
        "leetcode.endpoint": "leetcode-cn",
        "leetcode.workspaceFolder": "C:\\Users\\optimization\\.leetcode",
        "todo-tree.tree.showScanModeButton": false,
        "clang-format.executable": "C:\\Users\\optimization\\.vscode-insiders\\extensions\\ms-vscode.cpptools-0.28.3\\LLVM\\bin\\clang-format.exe",
        "[cpp]": {
            "editor.defaultFormatter": "xaver.clang-format",
        },
        "editor.formatOnSave": true,
        "clang-format.style": "Google"
    }
    

    相关文章

      网友评论

          本文标题:VS code google代码风格设置

          本文链接:https://www.haomeiwen.com/subject/otciphtx.html