Skip to content

prosk-sudo/codewars.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codewars.nvim

Solve Codewars katas from within Neovim.

codewars.nvim

Requirements

Installation

lazy.nvim

{
  "prosk-sudo/codewars.nvim",
  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 = {},
}

Authentication

Getting Your Cookies

  1. Log in to codewars.com in your browser
  2. Open Developer Tools (F12) → Application tab → Cookies
  3. Find these two cookies for www.codewars.com:
    • CSRF-TOKEN
    • _session_id
  4. Run :CW cookie in 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.

Usage

Standalone Mode

Launch Neovim with the plugin argument to get a dashboard:

nvim codewars.nvim

Available Commands

See COMMANDS.md for the full list, or run :CW help inside Neovim.

Example Workflow

:CW cookie               " paste your browser cookies (one-time setup)
:CW train multiply python

This opens the 8 kyu Multiply kata with:

  • Description split on the left (markdown)
  • Code editor on the right (with template)
  • Test cases split below the code editor

Write your solution, then:

:CW test        " Quick test with example cases
:CW attempt     " Full attempt with all test cases
:CW submit      " Submit after passing attempt

Configuration

All settings are optional. See CONFIGS.md for the full reference.

require("codewars").setup({})

Current Issues

  • Long test output lines (e.g. random test inputs with large data structures) may overflow the result popup. Neovim's wrap option 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.).

Acknowledgements

This plugin was heavily inspired by leetcode.nvim by @kawre!

Built and maintained with the help of Claude Code.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors