Solve LeetCode problems from Neovim with built-in NeetCode roadmaps.
neetcode.nvim is a hard fork of kawre/leetcode.nvim focused on a separate NeetCode workflow:
:Neetcommand namespace.neetcode,neetcode-ui, andneetcode-pluginsLua namespaces.- Storage under Neovim's
neetcodedata/cache directories. - Offline Blind 75 and NeetCode 150 roadmap manifests generated into the repo.
- No runtime dependency on the NeetCode website or spreadsheet data.
- Neovim 0.9.0 or newer.
nui.nvim.plenary.nvim.- A LeetCode account and valid
csrftoken/LEETCODE_SESSIONcookies for authenticated actions.
{
"zeroaddresss/neetcode.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
},
cmd = "Neet",
opts = {
lang = "python3",
},
}To use the plugin inside an existing Neovim session with listed buffers, enable non-standalone mode:
opts = { plugins = { non_standalone = true, }, }
Sign in once:
:Neet cookie updateYou will be prompted for two values:
csrftokenLEETCODE_SESSION
The cookie is persisted in Neovim's cache directory and restored lazily on future sessions. If LeetCode expires the cookie, run :Neet cookie update again.
Select a roadmap:
:Neet roadmap blind75 :Neet roadmap neetcode150
Open the next unsolved accessible roadmap problem:
:Neet nextList roadmap problems:
:Neet list :Neet list difficulty=easy :Neet list status=todo :Neet list category=arrays-and-hashing :Neet list difficulty=medium status=todo category=two-pointers
Show progress:
:Neet progress
:Neet progress roadmap=neetcode150Open a random roadmap problem:
:Neet random
Open the LeetCode daily challenge:
:Neet daily
Open the dashboard:
:Neet
:Neet menuAfter opening a problem, edit the generated solution buffer and use:
:Neet run " run against test cases :Neet test " alias for run :Neet submit " submit to LeetCode :Neet yank " yank the solution body :Neet open " open the problem in a browser :Neet reset " reset the solution template :Neet desc " toggle the description pane :Neet info " toggle problem metadata :Neet console " toggle the console pane
Default problem UI keys:
| Key | Action |
|---|---|
q |
close/toggle current popup |
<CR> |
confirm/select |
r |
reset test cases |
U |
use selected test case |
H |
focus test cases |
L |
focus result |
| Command | Description |
|---|---|
:Neet / :Neet menu |
Open the dashboard |
:Neet roadmap blind75 |
Select Blind 75 |
:Neet roadmap neetcode150 |
Select NeetCode 150 |
:Neet list [filters] |
Pick from the selected roadmap |
:Neet next |
Open the next unsolved accessible roadmap problem |
:Neet random |
Open a random accessible roadmap problem |
:Neet progress [roadmap=...] |
Show roadmap progress |
:Neet daily |
Open the daily challenge |
:Neet run / :Neet test |
Run the current solution |
:Neet submit |
Submit the current solution |
:Neet cookie update |
Save new LeetCode cookies |
:Neet cookie delete |
Sign out and delete cookies |
:Neet cache update |
Refresh the problem cache |
:Neet exit |
Exit the plugin session |
Default values are defined in lua/neetcode/config/template.lua.
Example:
require("neetcode").setup({ lang = "python3", storage = { home = vim.fn.stdpath("data") .. "/neetcode", cache = vim.fn.stdpath("cache") .. "/neetcode", }, plugins = { non_standalone = true, }, keys = { toggle = { "q" }, confirm = { "<CR>" }, reset_testcases = "r", use_testcase = "U", focus_testcases = "H", focus_result = "L", }, })
Supported language slugs include cpp, java, python, python3, javascript, typescript, golang, rust, and other LeetCode-supported languages listed in lua/neetcode/config/langs.lua.
Roadmap manifests live under:
lua/neetcode/data/roadmaps/
lua/neetcode/data/problem_registry.lua
They are generated by:
python scripts/sync_roadmaps.py python scripts/sync_roadmaps.py --check
The generator uses only Python standard library modules. Generated data is committed so normal plugin usage does not need Python or network access to NeetCode.
- Run
:Neet cookie updateand entercsrftokenplusLEETCODE_SESSION. - Run
:Neet roadmap blind75. - Run
:Neet progressand close withq. - Run
:Neet list difficulty=easy status=todoand open a problem. - Solve the problem in the generated buffer.
- Run
:Neet run. - Run
:Neet submit. - Run
:Neet nextto continue through the roadmap.
Run all checks:
python -m unittest discover -s scripts/tests python scripts/sync_roadmaps.py --check nvim --headless -u tests/minimal_init.lua \ -c "PlenaryBustedDirectory tests/plenary/ { minimal_init = './tests/minimal_init.lua' }" \ -c "qa!"
The core LeetCode integration is derived from kawre/leetcode.nvim. See UPSTREAM.md and THIRD_PARTY_LICENSES.md for attribution details.