No description
Find a file
Barrett Ruth 37ad92432e
test: add offline fixture coverage for Kattis and USACO
Problem: Kattis and USACO had zero offline test coverage — no fixtures,
no conftest routers, and no entries in the test matrix. Precision, error
cases, and the Kattis contest-vs-slug fallback were also untested.

Solution: Add HTML fixtures for both platforms covering metadata, tests,
and contest list modes. Wire up conftest routers that patch
`httpx.AsyncClient.get` using the same pattern as CSES/CodeChef. Extend
the test matrix to include Kattis and USACO (18 parametrized cases, up
from 12). Add a dedicated test for the Kattis contest-path (verifies
`contest_url`/`standings_url` are set). Add parametrized metadata error
tests for CSES, USACO, and Kattis. Assert `precision` field type in all
tests-mode payloads; `usaco/problem_1471.html` includes an absolute-error
hint to exercise `extract_precision`.
2026-03-06 16:46:03 -05:00
.github ci: nix config migration 2026-02-23 18:04:17 -05:00
after/ftplugin rename and simplify things 2025-10-05 11:59:24 -04:00
doc feat(config): merge platform config model and add disabled-platform guard (#336) 2026-03-06 16:14:16 -05:00
lua/cp feat(commands): add :CP <platform> signup subcommand (#337) 2026-03-06 16:14:33 -05:00
plugin feat(commands): add tab completion for :CP open (#338) 2026-03-06 16:14:58 -05:00
scrapers fix(kattis,usaco): precision, open URLs, and Kattis submit error surface (#335) 2026-03-06 15:23:55 -05:00
scripts feat(atcoder): extract submit helpers; add live status notifications (#294) 2026-03-04 19:27:29 -05:00
tests test: add offline fixture coverage for Kattis and USACO 2026-03-06 16:46:03 -05:00
.editorconfig fix: imports 2025-09-18 20:12:01 -04:00
.gitignore fix: flake config; 2026-02-17 21:10:29 -05:00
.luarc.json feat(atcoder): extract submit helpers; add live status notifications (#294) 2026-03-04 19:27:29 -05:00
.pre-commit-config.yaml format yml too in pre-commit 2026-02-03 01:43:13 -05:00
.prettierignore some misc fixes 2025-12-07 16:09:17 -06:00
.prettierrc fix: scrapers 2025-10-05 22:10:26 -04:00
.python-version initial commit 2025-09-11 23:52:32 -05:00
.styluaignore feat(atcoder): extract submit helpers; add live status notifications (#294) 2026-03-04 19:27:29 -05:00
cp.nvim-scm-1.rockspec fix(ci): fix rockspec url 2026-02-01 17:01:29 -05:00
flake.lock try to fix the setup 2026-02-18 14:13:37 -05:00
flake.nix fix: replace curl_cffi with scrapling in codeforces metadata (#334) 2026-03-06 13:25:44 -05:00
LICENSE fix(ci): format 2025-09-18 20:04:36 -04:00
pyproject.toml fix: replace curl_cffi with scrapling in codeforces metadata (#334) 2026-03-06 13:25:44 -05:00
README.md docs: fix dependencies section in readme 2026-02-21 23:59:40 -05:00
selene.toml ci: nix config migration 2026-02-23 18:04:17 -05:00
stylua.toml fix: imports 2025-09-18 20:12:01 -04:00
uv.lock fix: remove curl_cffi 2026-03-06 15:05:42 -05:00
vim.yaml fix(config): add bit to ignored filetypes 2026-02-26 19:09:16 -05:00

cp.nvim

The definitive competitive programming environment for Neovim

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

https://github.com/user-attachments/assets/e81d8dfb-578f-4a79-9989-210164fc0148

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

Installation

Install using your package manager of choice or via luarocks:

luarocks install cp.nvim

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