Open In App

Setting up Sublime Text For Competitive Programming (C++) Using Fast Olympic Coding Plugin

Last Updated : 12 Sep, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Competitive Programming is a mind sport where time matters the most. For that, a fast and easy-to-use tool is required for writing code. Sublime text along with the CppFastOlympicCoding plugin provides the same. Sublime text is popular for its fast performance and aesthetic UI. The CppFastOlympicCoding plugin offers features such as:

  • TestManager: We can easily add, edit, and delete tests with the help of Test manager
  • StressTesting: StressTesting means that we can test our program to find test where it is not working.
  • CppLint: We can edit the properties of Cpplint in the settings.
  • Debugger: It provides debug functions for OSX.
  • Class Completions: For Template substitution, write chars as classes.
  • Contest Setup: It is specifically designed for competitive Programming.

In this article, we will get to know how we can easily set up Sublime text For Competitive Programming using Fast Olympic Coding Plugin. If you want to download and install sublime text please refer to the article – How to Install Sublime Text3 in Windows?

To download the latest version of Sublime Text 4 visit the link and then install the .exe file on your local machine.

Downloading and Installing Mingw Compiler

For Downloading the Mingw compiler visit their official link.

Step 1: Downloading setup of MinGW

Downloading and Installing Mingw Compiler

 

Step 2: Mark mingw32-base and mingw32-gcc-g++ packages for installation and then Update Catalogue.

mingW install

 

Setting up Sublime Text

Step 1: Open the command pallet in the sublime text by selecting tools options or using Ctrl+Shift+P (for windows users)

  Setting up Sublime Text

 

Step 2: Type Install package control to install package controller for sublime text. The package controller helps in downloading different packages for sublime text.

  Setting up Sublime Text

 

  Setting up Sublime Text

 

Step 3: Type Package Control: Install Package in command pallet and search for C++ & C Single File Builder – Minghang Yang package.

package control

 

single file builder - minghang yang

 

Step 4: After installing select the Build System as C++ Builder Minghang Yang

Build system

 

Step 5: Now you can run a C++ program using the command Ctrl+B. To know more about Installing and Setting up the Fast Olympic Coding plugin refer to this link.

build program

 

CppFastOlymicCoding is a powerful sublime plugin for Competitive programmers. It comprises features like a Test manager, a C++ linter CppLint, Class Completion, Debugger, and Stress Testing. For information about its features and Key bindings visit the link.

  • Step 1: Type Package Control: Install Package in command pallet and search and install Cpp​Fast​Olympic​Coding by Jatana.
Installing and Setting up Fast Olympic Coding Plugin

 

  • Step 2: To Build and run using fast Olympic Coding use Key binding (Ctrl+Alt+B).
Installing and Setting up Fast Olympic Coding Plugin

 

  • Step 3: If Input/Test Cases get lost each time you compile the code paste the following into the User setting of CppFastOlympicCoding. To open the user setting type CppFastOlympicCoding: Open Setting in the command pallet.
Installing and Setting up Fast Olympic Coding Plugin

 

C




{
    // enable/disable lint
    "lint_enabled": true,
      
    // lint style properties
    "lint_error_region_scope": "invalid.illegal",
    // "lint_error_region_scope": "variable.c++",
    "lint_warning_region_scope": "constant",
  
    "algorithms_base": null,
    "tests_file_suffix": "__tests",
  
    // run settings:
    // "{file}": file name
    // "{source_file}": relative path to file
    // "{source_file_dir}": relative path to file directory
    // "{file_name}": file basename
    "run_settings": [
        {
            "name": "C++",
            "extensions": ["cpp"],
            "compile_cmd": "g++ \"{source_file}\" -std=c++11 -o \"{file_name}\"",
            "run_cmd": "\"{source_file_dir}\\{file_name}.exe\" {args} -debug",
  
            "lint_compile_cmd": "g++ -std=gnu++11 \"{source_file}\" -I \"{source_file_dir}\""
        },
  
        {
            "name": "Python",
            "extensions": ["py"],
            "compile_cmd": null,
            "run_cmd": "python \"{source_file}\""
        },
          
        {
            "name": "Java",
            "extensions": ["java"],
            "compile_cmd": "javac -J-Dfile.encoding=utf8 -d \"{source_file_dir}\" \"{source_file}\"",
            "run_cmd": "java -classpath \"{source_file_dir}\" \"{file_name}\""
        }
    ],
  
    // time limit for stress
    "stress_time_limit_seconds": 2,
  
    // enable/disable complete
    "cpp_complete_enabled": true,
  
    // class completion settings
    "cpp_complete_settings": {
        "classes": {
            "int": {
                "template_size": 0,
            },
  
            "char": {
                "template_size": 0
            },
  
            "string": {
                "template_size": 0,
            },
  
            "pair": {
                "template_size": 2,
            },
  
            "vector": {
                "template_size": 1
            },
  
            "bool": {
                "template_size": 0
            },
  
            "ll": {
                "template_size": 0
            },
  
            "double": {
                "template_size": 0
            },
  
            "set": {
                "template_size": 1,
                "bind": "S"
            },
  
            "map": {
                "template_size": 2
            }
        },
  
        "dont_expand": [
            "pii"
        ]
    },
  
    // closing sidebar when executing
    "close_sidebar": true
}




Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads