Skip to content

barrettruth/cp.nvim

Repository files navigation

cp.nvim

The definitive competitive programming environment for Neovim

Scrape problems, run tests, and debug solutions across multiple platforms with zero configuration.

Screen.Recording.2025-10-24.at.9.29.14.PM.mov

Features

  • Multi-platform support: AtCoder, CodeChef, Codeforces, and CSES
  • Automatic problem setup: Scrape test cases and metadata in seconds
  • Dual view modes: Lightweight I/O view for quick feedback, full panel for detailed analysis
  • Test case management: Quickly view, edit, add, & remove test cases
  • Rich test output: 256 color ANSI support for compiler errors and program output
  • Language agnostic: Works with any language
  • Diff viewer: Compare expected vs actual output with 3 diff modes

Optional Dependencies

Quick Start

cp.nvim follows a simple principle: solve locally, submit remotely.

Basic Usage

  1. Find a contest or problem

  2. Set up contests locally

    :CP codeforces 1848
    
  3. Code and test

    :CP run
    
  4. Navigate between problems

    :CP next
    :CP prev
    :CP e1
    
  5. Debug and edit test cases

:CP edit
:CP panel --debug
  1. Submit on the original website

Documentation

:help cp.nvim

See my config for the setup in the video shown above.

Motivation

I could not find a neovim-centric, efficient, dependency-free, flexible, and easily customizable competitive programming workflow that "just works"--so I made it myself. I conferenced with top competitive programmers at Carnegie Mellon Univerity and the University of Virginia and covered their (and my) pain points:

  • Scraping: contests are automatically loaded asynchronously
  • Test Case Management: test case editor (:CP edit)
  • UI: both run and panel layouts cover common formats
  • Extensibility: snippet plugins, compilation, etc. are left to the programmer

Similar Projects

About

competitive programming plugin for neovim

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published