当前位置:网站首页>Simple configuration of vscade

Simple configuration of vscade

2022-06-11 07:30:00 Master. Yi

Come first Official website https://code.visualstudio.com/ next Vscode

then Find a place https://www.jianshu.com/p/ee1ccb0a3062 next Mingw( If there is anything else IDE You don't have to )
I'm off Mingw After the bin Add to environment variables Path Inside .( This computer -> ( Right click ) attribute -> Advanced system setup -> environment variable -> Path -> Add a path )

Then you need some plug-ins :

Chinese(simplified)

Into Chinese

C/C++

Code Runner

Remember to tick this :
 Insert picture description here
And this one. ?
 Insert picture description here

Python

use python First come Official website https://www.python.org/ Download a .( It can be installed in cmd Use it , Super cool )
And then in Vscode Put it in Python plug-in unit .

background

Set the background , Open in extension settings.json, Add these words :
Turn off its default image :

"background.useDefault": false,

Set your own picture :

"background.customImages": [" File path "],

Note the format of the file path , It's best to open the picture with a browser and copy the address in the URL bar ( This is without Chinese )
Then add some picture positions 、 size 、 Transparency settings :

 "background.style": {
    
        "background-position": "center",
        "background-size":"cover",// Picture size 
        "opacity": 0.2, // transparency 
    },

The basic configuration is completed , You can write the program happily .

How to debug ?

Select the open folder in the file ,
After writing a document , Press F5,Vscode Will automatically write launch.json and tasks.json
Then there is the interface :
 Insert picture description here
After setting the breakpoint , Click on the green triangle or press F5 Ready for debugging .
Ctrl+F5 Is to run
In doing so, there is no need to CodeRunner 了

Terminals and independent windows

stay launch.json Lieutenant general "externalConsole": false, Change it to true, You can debug and run in a separate window .

Independent window operation flashback problem

You can change the settings to solve , stay launch.json Medium configuration Add an instruction to the :

{
    
            "name": "Only Run",
            "type": "cppdbg",
            "request": "launch",
            "program": "C:\\WINDOWS\\system32\\cmd.exe",
            "args": [
                "/C",
                "${fileDirname}\\${fileBasenameNoExtension}.exe",
                "&",
                "pause"
            ],
            "cwd": "${fileDirname}",
            "externalConsole": true,
}

This is to run with the help of terminals , At the same time, a separate window pops up ,args After running the program “pause” once .
Note that the added location is equivalent to the original one ( in other words configuration Now there are two big pieces in the ), Will notice
 Insert picture description here
There are two options : One is the original ; One is new , For operation , Be careful not to compile , Therefore, you may need to use CodeRunner perhaps GDB Compile the ( If you can directly use the configuration solution, please leave a message ~).

That's almost enough , Oh , If you want to write Markdown You can add one Markdown plug-in unit .

原网站

版权声明
本文为[Master. Yi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203020520542760.html