VSC 常用配置

1. VSC 常用配置

1.1 settings.json

// 位于.vscode/ 目录下,如果 .vscode/ 不存在,在当前文件的根目录下新建即可

{
    "search.exclude": {
        "**/node_modules": true,
        "**/bower_components":true,
        "**/*.code-search":true,
    },
    "files.exclude": {
        "**/.git":true,
        "**/.svn":true,
        "**/.hg":true,
        "**/CVS":true,
        "**/.DS_Store":true
    }  
}



/**
 * 注释
 */

1. "search.exclude" 里面是需要在搜索结果中需要排除的文件或者文件夹,true: 不搜索;false: 搜索
2. "files.exclude" 是在左侧工程目录中需要排除的文件或文件夹,即不显示在框图中,true: 不显示;false: 显示

Note: 上面使用了通配符 "*",比如 "**/.git" 表示所有.git 结尾的文件或文件夹。".root/[a-l]*" 表示在 root 目录下所有以 "a" ~ "l" 开头的文件或文件夹。

1.2 c_cpp_properties.json

// 位于.vscode/ 目录下,如果 .vscode/ 不存在,在当前文件的根目录下新建即可

{
  "env": {
    "myDefaultIncludePath": ["${workspaceFolder}", "${workspaceFolder}/include"],
    "myCompilerPath": "/usr/local/bin/gcc-7"
  },
  "configurations": [
    {
      "name": "Win32",
      "intelliSenseMode": "clang-x64",
      "includePath": ["${myDefaultIncludePath}", "/another/path"],
      "macFrameworkPath": ["/System/Library/Frameworks"],
      "defines": ["FOO", "BAR=100"],
      "forcedInclude": ["${workspaceFolder}/include/config.h"],
      "compilerPath": "/usr/bin/clang",
      "cStandard": "c11",
      "cppStandard": "c++17",
      "compileCommands": "/path/to/compile_commands.json",
      "browse": {
        "path": ["${workspaceFolder}"],
        "limitSymbolsToIncludedHeaders": true,
        "databaseFilename": ""
      }
    }
  ],
  "version": 4
}


/**
 * 注释
 */

1. "includePath" 表示要包含的头文件路径。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值