A Competitive Programming setup using VSCode for C++ users in Windows and Ubuntu with Debugging support.
Installation video for Windows on Youtube
Installation video for Ubuntu on Youtube
- VSCode ready to use out of the box (Only windows users need to correct MinGW installation path).
- Run
.\windows-reset.bat
in Windows or./ubuntu-reset.sh
in Ubuntu to reset theCurrent
Folder. - All
.cpp
files automatically take input frominput.txt
and output tooutput.txt
in the same folder. No need for complicatedifdef
s. - Leverage powerful features of VSCode:
- Step Through Debugging (Execute the code line by line, Hover over variables to get values)
- Debug Console (View any object i.e. map, set, vector or any complex object)
- Zen Mode (Utilize your screen to the fullest)
- Follow Steps 1-4 from Official VSCode Windows Prerequisites
- Check your MinGW installation
You are good to go!
- Follow Steps 1-2 from Official VSCode Linux Prerequisites
- Make sure g++ is installed
- Install
sudo apt-get update sudo apt-get install g++ sudo apt-get install gdb
- Check Installation
g++ --version gdb --version
You are good to go!
- Download this repository and extract folder
CP-VSCODE-SETUP
. - Open VSCode. Click on
File->Open Folder->CP-VSCODE-SETUP
- Open a Terminal by clicking on
Terminal->New Terminal
or pressCtrl+`
- You can always create a
Current
Folder from terminal by- Windows
.\windows-reset.bat
- Ubuntu
- Make the script executable (Only needed once)
chmod +x ubuntu-reset.sh
- Execute the script
./ubuntu-reset.sh
Current
Folder at any time, you may run this command again.
Your MinGW package version may be different. In this case, you should update the gcc.exe
, g++.exe
and gdb.exe
locations in the .vscode
configuration files.
- You should write your code in the
Current
Folder. - Press
F5
to run any.cpp
file. The file will automatically take input frominput.txt
and write output tooutput.txt
Happy Coding!
Please create a Github Issue should you come across an Issue or have a suggestion. I will be happy to resolve it at the earliest.