Configure Sublime Text for Competitive Coding

Himanshu Mishra
The Startup
Published in
3 min readMay 6, 2020

Competitive coding involves testing many input cases, multiple times and the standard terminal interface is not suitable for that.

In this article, you will learn how to configure Sublime Text, for C++ Codes. After the configuration you will have something like this:-

We have a separate Column for the code and one for the input-output. And the errors are displayed at the bottom panel.

So let's get started!

Installing the GNU Compiler

First, you need to have the GCC compiler installed on your system. To use it in the windows system, you need to install MinGW.

If you already have it installed in your system then skip this step.

Else, head over to this site, click on Downloads and then download the setup file and run it. Click on Install, in the next panel keep everything to its default value.

Click on continue, now the setup will download some additional files, after download, click on continue again and next it will show you a new window. In this window, you have to specify the packages you want to install, mark the packages shown in the image below and then click on Installation and then on Apply Changes.

Close the window. Now the compiler has been installed on your PC, next we will configure the Sublime Text.

Configuring Sublime Text

Create a folder in your D drive with name “Temp”, then create two empty text files named “input.txt” and “output.txt”.

Next, open Sublime text editor, click on

Tools > Build System > New Build System

A new file will be opened, paste the following JSON code in it, and save the file with name competi-cpp

Next, we need to select this new build system

Tools > Build System > competi-cpp

Next, we need to create input-output columns.

View > Layout > Columns: 3

Then, click

View > Groups > Max Columns: 2

Now you should have something like this:-

Now drag and drop the input.txt and the output.txt files in the second and third column respectively. Load your code in the first column. Provide input in the input file to save it.

Next to compile and run your program press Ctrl+B

And Yay we are all set!

--

--