Competitive programming workflow for Sublime Text. Parse problems straight from your browser via Competitive Companion, auto-open them in a 3-pane layout (code / sample input / expected output), and compile + test against every sample with one keypress. Real clangd-powered autocomplete for the C++ standard library included.
- Click the Competitive Companion extension on a Codeforces problem -> a
.cppfile appears, named after the problem (A_halloumi_boxes.cpp), with sample input/output files alongside it, and Sublime opens a 3-pane split automatically. - Ctrl+B compiles and runs your code against every sample case, reporting pass/fail per case with a line-by-line diff on failure.
- Optional daily-practice mode: route problems from different contests into one folder instead of scattering them across per-contest folders.
| OS | Install | Setup script |
|---|---|---|
| macOS / Linux | cross-platform/README.md · download zip |
bash setup.sh |
| Windows | windows/README.md · download zip |
.\setup.ps1 |
Each install script asks where your CP folder should live, auto-detects your compiler and Sublime Text, and writes every config file for you - nothing needs hand-editing.
- Download the zip for your OS from the table above (or clone this repo) and unpack it.
- Open the folder for your OS and run its setup script (see table above).
- Open a new terminal window.
- In Sublime Text install Package Control, then
LSPandLSP-clangd; restart. - Install the Competitive Companion browser extension, set its port to 1327.
- Try it:
settarget # optional: route problems into one daily-practice folder
parse # start listening; Ctrl+C to stop
# click Competitive Companion on any Codeforces problem...
runsample A # compile + test problem A against every sampleparse [N] # listen for problems; optional auto-stop after N
cf <contest> # jump to the cf<contest> folder
goto <folder> # jump to any folder
settarget [name] # route problems into one folder (daily practice)
cleartarget # back to normal per-contest folders
runsample <letter> # compile + test against every sample
runsample <letter> -Manual # feed your own input by hand
runsample <letter> -Test 0 # run just test case 0In Sublime: Ctrl+B to test the open file, Ctrl+Shift+B for manual input or a specific test case.
cross-platform/- macOS / Linux version (setup.sh,templates/)windows/- Windows version (setup.ps1,templates/)A*.cpp/A*.in*/A*.outat the repo root - test artifacts from the sample runner, not part of the project
parse.py- a small local server Competitive Companion posts problem data to; creates the.cpp/.in/.ansfiles and launches Sublimedbg.py/dbg.ps1- compiles with g++ and diffs your output against every sample, order-sensitive and whitespace/case-tolerantAutoLayoutProblem.py- Sublime plugin for the 3-pane layoutCompetitiveProgramming.sublime-build- wires Ctrl+B to the test runnerProfileFunctions.*- theparse/runsample/cf/goto/settarget/cleartargetshell commandscompile_flags.txt- tells clangd where your compiler's headers live, so autocomplete actually works
MIT