competitive programming plugin for neovim
  • Lua 62.4%
  • Python 36.4%
  • Nix 0.8%
  • Shell 0.3%
  • Just 0.1%
Find a file
Barrett Ruth b687f52d40
All checks were successful
quality / Format (push) Successful in 9s
quality / Lint (push) Successful in 9s
quality / Test (push) Successful in 6s
deploy / LuaRocks (push) Successful in 33s
ci: fix deploy job name expression (#395)
## Problem

The consolidated deploy workflow uses one publish job with a dynamic job name. On main pushes, Forgejo rendered the job as `deploy / LuaRocks` instead of `deploy / Nightly`, even though the step-level `github.ref` conditions still selected the correct publish path.

## Solution

Use `github.ref` for the job-name expression, matching the step conditions and the runner-provided compatibility context. This keeps the one-file `deploy.yaml` layout while preserving the expected rendered names.

Validation:

- parsed `.forgejo/workflows/*.yaml` with PyYAML via Nix
- `git diff --check`

Reviewed-on: #395
2026-05-03 19:01:48 +00:00
.forgejo ci: fix deploy job name expression (#395) 2026-05-03 19:01:48 +00:00
after/ftplugin rename and simplify things 2025-10-05 11:59:24 -04:00
doc docs: use Forgejo install URLs for cp.nvim (#383) 2026-05-02 17:48:26 +00:00
lua/cp build(nix): use nixpkgs vimdoc-language-server (#380) 2026-04-20 18:33:59 -04:00
plugin feat: git credential backend for credential storage (#371) 2026-03-07 20:15:06 -05:00
scrapers build(nix): use nixpkgs vimdoc-language-server (#380) 2026-04-20 18:33:59 -04:00
scripts ci: make just the task source of truth (#379) 2026-04-20 12:06:48 -04:00
tests feat(codechef): implement full CodeChef support (#354) 2026-03-06 23:10:44 -05:00
.editorconfig fix: imports 2025-09-18 20:12:01 -04:00
.gitignore fix(scrapers): cookie fast paths, centralized storage, and reauth hardening (#363) 2026-03-07 16:10:51 -05:00
.luarc.json feat(atcoder): extract submit helpers; add live status notifications (#294) 2026-03-04 19:27:29 -05: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
biome.json chore: replace prettier with biome (#381) 2026-04-25 16:16:15 -04:00
cp.nvim-scm-1.rockspec docs: use Forgejo install URLs for cp.nvim (#383) 2026-05-02 17:48:26 +00:00
flake.lock build(nix): use nixpkgs vimdoc-language-server (#380) 2026-04-20 18:33:59 -04:00
flake.nix chore: replace prettier with biome (#381) 2026-04-25 16:16:15 -04:00
justfile chore: replace prettier with biome (#381) 2026-04-25 16:16:15 -04:00
LICENSE chore: switch license to GPL 2026-05-01 04:51:10 +00:00
pyproject.toml fix: replace curl_cffi with scrapling in codeforces metadata (#334) 2026-03-06 13:25:44 -05:00
README.md docs: use Forgejo install URLs for cp.nvim (#383) 2026-05-02 17:48:26 +00: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.

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

  1. Find a contest:
:CP pick
  1. View the problem:
:CP open
  1. Code and test
:CP run
  1. Navigate between problems
:CP next
:CP prev
:CP e1
  1. Debug and edit test cases
:CP edit
:CP panel --debug
  1. Submit:
:CP submit
  1. 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 run and panel layouts cover common formats
  • Extensibility: snippet plugins, compilation, etc. are left to the programmer

Similar Projects