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

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

 

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

 

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)

 

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

 

 

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

 

 

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

 

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.

 

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.

 

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

 

  • 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.

 

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
}