[Windows] Visual Studio Code personal configuration

Editor to add

settings.json

Open this:

 

{
    "editor.fontSize": 20,//编辑字号
    "files.autoSave": "afterDelay",//自动保存
    "workbench.colorTheme": "One Monokai",//主题
    "command-runner.commands": {
        "Run": "start cmd /c \"C:\\Program Files (x86)\\Dev-Cpp\\ConsolePauser.exe\" ${fileDirname}\\${fileBasenameNoExtension}"
}convenient to run a//
    }

 

The third need to install plug-ins:

 

The fourth need to install plug-ins:

 

 keybindings.json

Shortcut keys

Similarly open position

[
    {
        "key": "f11",
        "command": "workbench.action.tasks.build"
    },//编译运行
    {
        "key": "f10",
        "command": "command-runner.run",
        "args":{
            "command": "Run"
        },
        "When " : " editorTextFocus " 
    } // run, with the above command runner plug 
]

Within each file

Want to be compiled:

c_cpp_properties.json

Configuring compiler location and language

{
     " Configurations " : [ 
        { 
            " name " : " MinGW " ,
             " intelliSenseMode " : " GCC-x64- " ,
             " compilerPath " : " C: / Program Files (the x86) / Dev-Cpp / MinGW64 / bin / G ++ EXE. " , // compiler location, installation Dev C ++ have this path. . . 
            " IncludePath " : [
                 " $ {workspaceFolder} " 
            ], 
            ""c11",
            "cppStandard": "c++11"
        }
    ],
    "version": 4
}

settings.json

I did not know what use

{
    "files.associations": {
        "array": "cpp",
        "atomic": "cpp",
        "*.tcc": "cpp",
        "bitset": "cpp",
        "cctype": "cpp",
        "cfenv": "cpp",
        "chrono": "cpp",
        "cinttypes": "cpp",
        "clocale": "cpp",
        "cmath": "cpp",
        "complex": "cpp",
        "condition_variable": "cpp",
        "csetjmp": "cpp",
        "csignal": "cpp",
        "cstdarg": "cpp",
        "cstdint": "cpp",
        "cstdio": "cpp",
        "cstdlib": "cpp",
        "cstring": "cpp",
        "ctime": "cpp",
        "cwchar": "cpp",
        "cwctype": "cpp",
        "deque": "cpp",
        "forward_list": "cpp",
        "list": "cpp",
        "unordered_map": "cpp",
        "unordered_set": "cpp",
        "vector": "cpp",
        "exception": "cpp",
        "fstream": "cpp",
        "functional": "cpp",
        "future": "cpp",
        "initializer_list": "cpp",
        "iomanip": "cpp",
        "iosfwd": "cpp",
        "iostream": "cpp",
        "istream": "cpp",
        "limits": "cpp",
        "mutex": "cpp",
        "new": "cpp",
        "ostream": "cpp",
        "numeric": "cpp",
        "ratio": "cpp",
        "scoped_allocator": "cpp",
        "sstream": "cpp",
        "stdexcept": "cpp",
        "streambuf": "cpp",
        "system_error": "cpp",
        "thread": "cpp",
        "type_traits": "cpp",
        "tuple": "cpp",
        "typeindex": "cpp",
        "typeinfo": "cpp",
        "utility": "cpp",
        "valarray": "cpp"
    }
}

tasks.json

Compile command

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Compile",
            "type": "shell",
            "command": "g++ -Wall -std=c++11 -O2 -Wl,-stack=512000000 \"${file}\" -o \"${fileDirname}\\${fileBasenameNoExtension}\" && start cmd /c \"C:\\Program Files (x86)\\Dev-Cpp\\ConsolePauser.exe\" ${fileDirname}\\${fileBasenameNoExtension}",
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        },
        {
            "label": "Run",
            "type": "shell",
            "command": "start cmd /c \"C:\\Program Files (x86)\\Dev-Cpp\\ConsolePauser.exe\" ${fileDirname}\\${fileBasenameNoExtension}",
            "problemMatcher": []
        },
        {
            "type": "shell",
            "label": "g++.exe build active file",
            "command": "C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/g++.exe",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "C:/Program Files (x86)/Dev-Cpp/MinGW64/bin"
            }
        }
    ]
}

Additional plug-ins

In addition to the above two

and also:

 

The first two are the configuration of the C ++ language

The last one is Chinese localization

Renderings

 

Guess you like

Origin www.cnblogs.com/Miracevin/p/10986522.html