A Neovim plugin enabling you to solve LeetCode problems.
Clone โพ
| 13 B | |
| 207 B | |
| 174 B | |
| 1.0 KB | |
| 6.2 KB |
๐จ leetcode.nvim is currently in the alpha stage of development ๐จ
leetcode.nvim
๐ฅ Solve LeetCode problems within Neovim ๐ฅ
https://github.com/kawre/leetcode.nvim/assets/69250723/309088c9-4ff7-4dff-ab61-ab3f09b43740
โจ Features
-
๐ an intuitive dashboard for effortless navigation within leetcode.nvim
-
๐ question description formatting for a better readability
-
๐ support for daily and random questions
-
๐พ caching for optimized performance
๐ฌ Requirements
-
Neovim >= 0.9.0
-
nvim-treesitter (optional, but highly recommended) used for formatting the question description. Make sure to install the parser for
html. -
nvim-notify (optional)
-
Nerd Font (optional)
๐ฆ Installation
{
"kawre/leetcode.nvim",
build = ":TSUpdate html",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim", -- required by telescope
"MunifTanjim/nui.nvim",
-- optional
"rcarriga/nvim-notify",
},
opts = {
-- configuration goes here
},
}
๐ ๏ธ Configuration
To see full configuration types see template.lua
โ๏ธ default configuration
{
---@type lc.domain
domain = "com", -- For now "com" is the only one supported
---@type string
arg = "leetcode.nvim",
---@type lc.lang
lang = "cpp",
---@type lc.sql
sql = "mysql",
---@type string
directory = vim.fn.stdpath("data") .. "/leetcode/",
---@type boolean
logging = true,
console = {
---@type boolean
open_on_runcode = false,
size = {
width = "75%", ---@type string | integer
height = "75%", ---@type string | integer
},
dir = "row", ---@type "col" | "row"
},
description = {
width = "40%", ---@type string | integer
},
}
arg
Argument for Neovim
---@type string
arg = "leetcode.nvim"
See usage for more info
lang
Language to start your session with
---@type lc.lang
lang = "cpp"
---@type lc.sql_lang
sql = "mysql"
domain
LeetCode domain.
---@type lc.domain
domain = "com" -- For now "com" is the only one supported
directory
Where to store leetcode.nvim data
---@type string
directory = vim.fn.stdpath("data") .. "/leetcode/"
logging
Whether to log leetcode.nvim status notifications
---@type boolean
logging = true
console
question console
console = {
open_on_runcode = false, ---@type boolean
size = {
width = "75%", ---@type string | integer
height = "75%", ---@type string | integer
},
dir = "row", ---@type "col" | "row"
}
description
question description
description = {
width = "40%", ---@type string | integer
}
๐ Commands
| command | description |
|---|---|
| LcMenu | opens menu dashboard |
| LcList | opens a problem list picker |
| LcConsole | opens console for currently opened question |
| LcHints | opens hints for currently opened question |
| LcTabs | opens a picker with all currently opened question tabs |
| LcLanguage | opens a picker to change the language of the current question |
| LcDescriptionToggle | toggle question description |
| LcRun | run currently opened question |
| LcSubmit | submit currently opened question |
๐ Usage
This plugin is meant to be used within a fresh Neovim instance.
Meaning that to lauch leetcode.nvim you have to pass arg as the first and only Neovim argument
nvim leetcode.nvim
Sign In
It is required to be signed-in to use leetcode.nvim
https://github.com/kawre/leetcode.nvim/assets/69250723/b7be8b95-5e2c-4153-8845-4ad3abeda5c3
โ Todo
- CN version
- SQL support
- Statistics menu page
- Docs
- Hints pop-up