No description
Find a file
2025-09-15 16:59:28 +02:00
.github/workflows fix(ci): point to luarc 2025-09-12 17:40:54 -05:00
after fix 2025-09-15 10:39:02 -04:00
doc fix: revert multiple test cases 2025-09-15 10:37:40 -04:00
ftdetect fix 2025-09-15 10:39:02 -04:00
lua/cp remove unused functions 2025-09-15 10:58:35 -04:00
plugin fix: revert multiple test cases 2025-09-15 10:37:40 -04:00
scrapers fix(ci): format 2025-09-15 10:53:00 -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: use new filetype structure 2025-09-15 08:23:56 -05:00
selene.toml fix ci 2025-09-12 00:13:50 -05:00
uv.lock initial commit 2025-09-11 23:52:32 -05:00
vim.toml fix ci 2025-09-12 00:13:50 -05:00

cp.nvim

neovim plugin for competitive programming.

https://private-user-images.githubusercontent.com/62671086/489116291-391976d1-c2f4-49e6-a79d-13ff05e9be86.mp4?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTc3NDQ1ODEsIm5iZiI6MTc1Nzc0NDI4MSwicGF0aCI6Ii82MjY3MTA4Ni80ODkxMTYyOTEtMzkxOTc2ZDEtYzJmNC00OWU2LWE3OWQtMTNmZjA1ZTliZTg2Lm1wND9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA5MTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwOTEzVDA2MTgwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI0Zjc0YmQzNWIzNGZkM2VjZjM3NGM0YmZmM2I3MmJkZGQ0YTczYjIxMTFiODc3MjQyMzY3ODc2ZTUxZDRkMzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.MBK5q_Zxr0gWuzfjwmSbB7P7dtWrATrT5cDOosdPRuQ

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

  • finer-tuned problem limits (i.e. per-problem codeforces time, memory)
  • better highlighting
  • test case management
  • USACO support
  • new video with functionality, notify discord members