No description
Find a file
2025-09-18 19:32:25 +02:00
.github/workflows fix(ci): point to luarc 2025-09-12 17:40:54 -05:00
after fix(scraper/codeforces): scrape multiple tc 2025-09-18 13:30:53 -04:00
doc feat: :CP test refactor 2025-09-18 10:20:20 -04:00
ftdetect fix 2025-09-15 10:39:02 -04:00
lua/cp fix(scraper/codeforces): scrape multiple tc 2025-09-18 13:30:53 -04:00
plugin feat: :CP test refactor 2025-09-18 10:20:20 -04:00
scrapers fix(scraper/codeforces): scrape multiple tc 2025-09-18 13:30:53 -04:00
.gitignore fix: update docs, no more vim.g 2025-09-14 01:53:22 -05:00
.luarc.json fix(ci): vim typing 2025-09-12 17:39:28 -05:00
.python-version initial commit 2025-09-11 23:52:32 -05:00
pyproject.toml initial commit 2025-09-11 23:52:32 -05:00
readme.md feat: :CP test refactor 2025-09-18 10:20:20 -04:00
selene.toml fix(ci/selene): shadowing 2025-09-15 14:16:45 -04:00
uv.lock initial commit 2025-09-11 23:52:32 -05:00
vim.toml cleanup 2025-09-11 23:58:49 -05:00

cp.nvim

neovim plugin for competitive programming.

https://github.com/user-attachments/assets/cb142535-fba0-4280-8f11-66ad1ca50ca9

video config

Sample test data from codeforces is scraped via cloudscraper. Use at your own risk.

Features

  • Support for multiple online judges (AtCoder, Codeforces, CSES)
  • Multi-language support (C++, Python)
  • Automatic problem scraping and test case management
  • Integrated build, run, and debug commands
  • Enhanced test viewer with individual test case management
  • LuaSnip integration for contest-specific snippets

Requirements

  • Neovim 0.10.0+
  • uv: problem scraping (optional)
  • LuaSnip: contest-specific snippets (optional)

Documentation

:help cp.nvim

Philosophy

This plugin is highly tuned to my workflow and may not fit for you. Personally, I believe there are two aspects of a cp workflow:

  • local work (i.e. coding, running test cases)
  • site work (i.e. problem reading, submitting)

Namely, I do not like the idea of submitting problems locally - the experience will never quite offer what the remote does. Therefore, cp.nvim works as follows:

  1. Find a problem
  • Browse the remote and find it
  • Read it on the remote
  1. Set up your local environment with :CP ...
  • test cases and expected output automatically scraped
  • templates automatically configured
  1. Solve the problem locally
  • easy to run/debug
  • easy to diff actual vs. expected output
  1. Submit the problem (on the remote!)

Similar Projects

TODO

  • fzf/telescope integration (whichever available)
  • autocomplete with --lang and --debug
  • finer-tuned problem limits (i.e. per-problem codeforces time, memory)
  • notify discord members