VSCode相关文件设置与插件

· · 个人记录

c_cpp_properties.json

{
  "configurations": [
    {
      "name": "windows-clang-x64",
      "includePath": [
        "${workspaceFolder}/**"
      ],
      "defines": [
        "_DEBUG",
        "UNICODE",
        "_UNICODE"
      ],
      "intelliSenseMode": "windows-clang-x64",
      "compilerPath": "F:/MinGW64/bin/g++.exe",
      "cStandard": "${default}",
      "cppStandard": "${default}"
    },
    {
      "name": "C++",
      "includePath": [
        "${workspaceFolder}/**"
      ],
      "defines": [
        "_DEBUG",
        "UNICODE",
        "_UNICODE"
      ],
      "intelliSenseMode": "gcc-x64",
      "compilerPath": "F:/MinGW64/bin/g++.exe"
    }
  ],
  "version": 4
}

launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "(gdb) 启动",
      "type": "cppdbg",
      "request": "launch",
      "program": "C:\\Windows\\System32\\cmd.exe",
      "args": [
        "/c",
        "${fileDirname}/${fileBasenameNoExtension}.exe",
        "&",
        "pause"
      ],
      "stopAtEntry": false,
      "cwd": "${fileDirname}",
      "environment": [],
      "externalConsole": true,
      "preLaunchTask": "task g++",
      "MIMode": "gdb",
      "miDebuggerPath": "F:/MinGW64/bin/gdb.exe",
      "setupCommands": [
        {
          "description": "为 gdb 启用整齐打印",
          "text": "-enable-pretty-printing",
          "ignoreFailures": true
        }
      ]
    },
    {
      "name": "C/C++ Runner: Debug Session",
      "type": "cppdbg",
      "request": "launch",
      "args": [],
      "stopAtEntry": false,
      "externalConsole": true,
      "cwd": "f:/Code",
      "program": "f:/Code/build/Debug/outDebug",
      "MIMode": "gdb",
      "miDebuggerPath": "gdb",
      "setupCommands": [
        {
          "description": "Enable pretty-printing for gdb",
          "text": "-enable-pretty-printing",
          "ignoreFailures": true
        }
      ]
    }
  ]
}

tasks.josn

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "label": "task g++",
            "command": "F:/MinGW64/bin/g++.exe",
            "args": [
                "-std=c++14",
                "-g",   //g++ -g
                "${file}",  //g++ -g main.cpp
                "-o",   //g++ -g main.cpp -o
                "${fileDirname}\\${fileBasenameNoExtension}.exe"    //g++ -g main.cpp -o main.exe
            ],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "presentation": {
                "panel": "shared"
            }
        }
    ]
}

settings.json

{
  "C_Cpp_Runner.cCompilerPath": "F:/MinGW64/bin/g++.exe",
  "C_Cpp_Runner.cppCompilerPath": "g++",
  "C_Cpp_Runner.debuggerPath": "gdb",
  "C_Cpp_Runner.cStandard": "",
  "C_Cpp_Runner.cppStandard": "",
  "C_Cpp_Runner.msvcBatchPath": "",
  "C_Cpp_Runner.useMsvc": false,
  "C_Cpp_Runner.warnings": [
    "-Wall",
    "-Wextra",
    "-Wpedantic"
  ],
  "C_Cpp_Runner.enableWarnings": true,
  "C_Cpp_Runner.warningsAsError": false,
  "C_Cpp_Runner.compilerArgs": [],
  "C_Cpp_Runner.linkerArgs": [],
  "C_Cpp_Runner.includePaths": [
    "${workspaceFolder}/**"
  ],
  "C_Cpp_Runner.includeSearch": [
    "*",
    "**/*"
  ],
  "C_Cpp_Runner.excludeSearch": [
    "**/build",
    "**/build/**",
    "**/.*",
    "**/.*/**",
    "**/.vscode",
    "**/.vscode/**"
  ]

}

cpp.json

{
    // Place your snippets for cpp here. Each snippet is defined under a snippet name and has a prefix, body and 
    // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
    // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
    // same ids are connected.
    // Example:
    // "Print to console": {
    //  "prefix": "log",
    //  "body": [
    //      "console.log('$1');",
    //      "$2"
    //  ],
    //  "description": "Log output to console"
    // }
        "C++ Template": {
                "prefix": "cpp",
                "body": [
                    "#include<bits/stdc++.h>",
                    "#define inf INT_MAX",
                    "#define ll long long",
                    "#define N 200086",
                    "using namespace std;",
                    "",
                    "namespace my{",
                    "\tvoid IOS();",
                    "\tvoid rwf();",
                    "}",
                    "int main(){",
                    "\t//my::IOS();",
                    "\t",
                    "\treturn 0;",
                    "}",
                    "void my::IOS(){",
                    "\tios::sync_with_stdio(0);",
                    "\tcin.tie(0);cout.tie(0);",
                    "}",
                    "void my::rwf(){",
                    "\tfreopen(\".in\",\"r\",stdin);",
                    "\tfreopen(\".out\",\"w\",stdout);",
                    "}",
                ],
                "description": "模板"
            },
        "fori Template":{
            "prefix":"fori",
            "body":[
                "for(int i=1;i<=n;i++)"
            ]
        },
        "forj Template":{
            "prefix":"forj",
            "body":[
                "for(int j=1;j<=;j++)"
            ],
        }
}

插件

background

settings.json

{
    "background.fullscreen": {

        "images": ["https://cdn.luogu.com.cn/upload/image_hosting/jiv4gf0e.png"],
        "opacity": 0.6,
        "size": "cover",
        "position": "center",
        "interval": 0
    },

    "background.style":{
        "content": "''",
        "pointer-events": "none",
        "position": "absolute",
        "z-index": "99999",
        "width": "150%",//背景图片缩放有多宽
        "height": "150%",//背景图片缩放有多高
        "background-position": "0% 100%",//背景图片显示位置
        "background-repeat": "no-repeat",
        "opacity": 0.45//透明程度。
    },
    "workbench.colorTheme": "One Dark Pro",
    "files.autoSave": "afterDelay",
    "editor.mouseWheelZoom": true,
    "files.autoSaveDelay": 500,
}