Solve Codewars katas from within Neovim.
-
Train — open any kata by title, slug or URL, write your solution with the description and test cases beside it, then
test/attempt/submit. -
Find work — browse and filter all kata, see your completed ones, or let Codewars' trainer pick with Choose Today's Focus.
-
Community solutions — after solving, browse other people's solutions with their Best Practices / Clever counts and rendered comment threads, and vote from the popup.
-
Leaderboards — top-500 boards for Overall, Completed Kata, Authored Kata & Translations, and Ranks.
-
Freestyle Sparring — browse kumite, fork one into an editable copy, run it against its fixture, and save or publish it back.
-
Author kata — turn a kumite into a kata and finish it without leaving Neovim: solution, initial solution, tests, example tests, description, metadata, language and runtime, then publish.
-
Your own starter code — per-language templates so every kata opens with the imports and scaffolding you actually use, wrapped around the signature Codewars grades.
:CW template offturns them off again, buffer and all. See CONFIGS.md.
- Neovim >= 0.9.0
- plenary.nvim — HTTP requests, file operations
- nui.nvim — UI components
- telescope.nvim — kata picker, language picker
- nvim-treesitter with
markdownparser — description rendering (optional) - markdown.nvim — enhanced markdown rendering (optional)
{
"prosk-sudo/codewars.nvim",
version = "*", -- pin to tagged releases; remove to track main
lazy = false,
dependencies = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
"nvim-telescope/telescope.nvim", -- kata picker / language picker
-- optional
"tadmccorkle/markdown.nvim", -- markdown rendering in description
},
opts = {},
}version, dir and the trade-offs between them are covered in
CONFIGS.md.
- Log in to codewars.com in your browser
- Open Developer Tools (F12) → Application tab → Cookies
- Find these two cookies for
www.codewars.com:CSRF-TOKEN_session_id
- Run
:CW cookiein Neovim and paste them in this format:
CSRF-TOKEN=your_csrf_value; _session_id=your_session_value
Your cookies are stored locally at ~/.cache/nvim/codewars/cookie.
Launch Neovim with the plugin argument to get a dashboard:
nvim codewars.nvimSee COMMANDS.md for the full list, or run :CW help inside Neovim.
:CW cookie " paste your browser cookies (one-time setup)
:CW train multiply python
This opens the 8 kyu Multiply kata with the description on the left, the code
editor on the right, and the test cases below it. Write your solution, then
:CW test → :CW attempt → :CW submit.
To find something to solve, :CW focus lets Codewars' trainer pick for you,
:CW list browses everything with filters, and :CW completed shows what
you've already finished.
Kata are authored from kumite. Browse or start one with :CW kumite, fork it,
run it against its fixture with :CW test, then save it and use
:CW kumite convert to turn it into a kata draft.
:CW kata open <id|url> opens that draft in the editor. Its five text fields —
Complete Solution, Initial Solution, Test Cases, Example Test Cases and
Description — each get their own buffer, switched with g1…g5, so edits in a
hidden pane are never lost. A read-only side panel keeps the metadata, pane list
and keys in view while :CW kata meta, validate, save and publish finish
the kata off.
If Codewars rejects a save, publish, or convert because the name is taken, the plugin offers a rename and retries.
:CW doctor
Reports Neovim version, dependencies, auth state, and cache status. It also runs the HTML parsers against committed fixtures — Codewars has no public API for most of this data, so that check turns a silent scraping break into a visible diagnostic.
All settings are optional. See CONFIGS.md for the full reference.
require("codewars").setup({})- Long test output lines (e.g. random test inputs with large data structures) may overflow the result popup. Neovim's
wrapoption is enabled but may not fully contain all content within NUI Layout popups. - Some language icons in the picker may display as boxes or incorrect characters depending on your Nerd Font version and variant. Nerd Font v3 reorganized many codepoints, and not all patched fonts include every icon set (Devicons, Material Design, Seti-UI, etc.).
This plugin was heavily inspired by leetcode.nvim by @kawre!
Built and maintained with the help of Claude Code.
