- Lua 62.6%
- Python 36%
- Nix 0.9%
- Shell 0.4%
- Just 0.1%
## Summary - update the README GitHub mirror banner to the active-development wording - keep the Forgejo link repo-specific and preserve any existing canonical-link note ## Checks - git diff --check Reviewed-on: https://git.barrettruth.com/barrettruth/cp.nvim/pulls/404 |
||
|---|---|---|
| .forgejo | ||
| .github/workflows | ||
| after/ftplugin | ||
| doc | ||
| lua/cp | ||
| plugin | ||
| scrapers | ||
| scripts | ||
| tests | ||
| .editorconfig | ||
| .gitignore | ||
| .luarc.json | ||
| .python-version | ||
| .styluaignore | ||
| biome.json | ||
| CONTRIBUTING.md | ||
| cp.nvim-scm-1.rockspec | ||
| flake.lock | ||
| flake.nix | ||
| justfile | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
| selene.toml | ||
| stylua.toml | ||
| uv.lock | ||
| vim.yaml | ||
cp.nvim
The definitive competitive programming environment for Neovim
Scrape problems, run tests, and debug solutions across multiple platforms with zero configuration.
Note
Due to GitHub's historic unreliability, active development is hosted on Forgejo. GitHub is maintained as a read-only mirror. See
:help cp.nvim-migrationto optionally update your plugin source configuration.
Features
- Multi-platform support: AtCoder, CodeChef, Codeforces, USACO, CSES, Kattis
- Online Judge Integration: Submit problems and view contest standings
- Live Contest Support: Participate in real-time contests
- Automatic setup: Scrape test cases and metadata in seconds
- Streamlined Editing: Configure coding view, edit test cases, stress-test solutions, run interactive problems, and more
- Rich output: 256 color ANSI support for compiler errors and program output
- Language agnosticism: Configure with any language
- Security: Passwords go untampered
Installation
With vim.pack (Neovim 0.12+):
vim.pack.add({
'https://git.barrettruth.com/barrettruth/cp.nvim',
})
Or via luarocks:
luarocks install cp.nvim
Dependencies
Quick Start
- Find a contest:
:CP pick
- View the problem:
:CP open
- Code and test
:CP run
- Navigate between problems
:CP next
:CP prev
:CP e1
- Debug and edit test cases
:CP edit
:CP panel --debug
- Submit:
:CP submit
- View contest standings:
:CP open standings
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
runandpanellayouts cover common formats - Extensibility: snippet plugins, compilation, etc. are left to the programmer