zoukankan      html  css  js  c++  java
  • vscode添加Astyle

    1、安装astyle插件,在应用商城里面一键安装即可。
    2、下载astyle的bin文件,并添加到系统环境变量。
    3、打开vscode的settings.json,添加以下代码。

    {
        "editor.mouseWheelZoom": true,    //鼠标放大的
    
        "astyle.additional_languages": [
            "c",
            "cpp",
        ],
    
        "astyle.cmd_options": [
            "--style=allman",//Kernighan&Ritchie 风格格式和缩进
            "--indent=spaces=4",//缩进4个空格
            "--convert-tabs",
            "--align-pointer=name",
            "--align-reference=name",
            "--keep-one-line-statements",
            "--pad-header",
            "--pad-oper",//操作符两端插入一个空格
        ],
    
        "astyle.executable": "D:\AStyle\bin\astyle.exe",
    
        "files.encoding":"GB2312",//文件编码的,以防中文乱码
    
        "[c]": {
            "editor.defaultFormatter": "chiehyu.vscode-astyle"
        },  //这个是插件安装好了就有的
    }
      

    注意要添加逗号

    然后在文件中使用Alt+Shift+F就可以格式化代码啦。

  • 相关阅读:
    tar压缩
    sh脚本的dos和unix
    hive常用函数
    hive的union问题
    hive行转多列LATERAL VIEW explode
    Iterator和Enumeration
    基础啊基础
    一道考题---当n=1,2,3...2015时,统计3n+n3能整除7的个数
    自然语言处理
    矩阵相乘
  • 原文地址:https://www.cnblogs.com/CodeWorkerLiMing/p/10800827.html
Copyright © 2011-2022 走看看