Home

Awesome

👋 Archiving and Recommendation 🙌

I have decided to archive LeetBuddy.nvim. I believe that kawre/leetcode.nvim provides more features.

Note: This repository is now archived, and no further development or maintenance will be done.

LeetBuddy.nvim

LeetBuddy.nvim enables seamless integration with Leetcode, empowering you to solve coding problems effortlessly within Neovim.

Demo

https://github.com/Dhanus3133/Leetbuddy.nvim/assets/43700516/411e7c02-c888-41ad-9e01-99427cb05de5

Requirements

Installation

Use your favorite plugin manager to install LeetBuddy.nvim. Here's an example using Lazy:

return {
  "Dhanus3133/LeetBuddy.nvim",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "nvim-telescope/telescope.nvim",
  },
  config = function()
    require("leetbuddy").setup({})
  end,
  keys = {
    { "<leader>lq", "<cmd>LBQuestions<cr>", desc = "List Questions" },
    { "<leader>ll", "<cmd>LBQuestion<cr>", desc = "View Question" },
    { "<leader>lr", "<cmd>LBReset<cr>", desc = "Reset Code" },
    { "<leader>lt", "<cmd>LBTest<cr>", desc = "Run Code" },
    { "<leader>ls", "<cmd>LBSubmit<cr>", desc = "Submit Code" },
  },
}

Commands

LeetBuddy.nvim provides the following commands:

Custom Configuration

LeetBuddy.nvim allows you to customize certain aspects of its behavior. You can modify the following configuration options in your Neovim configuration file to suit your preferences:

require('leetbuddy').setup({
    domain = "com"  -- `cn` for chinese leetcode
    language = "py",
    limit = 30, -- Number of problems displayed in telescope
    keys = {
        select = "<CR>",
        reset = "<C-r>",
        easy = "<C-e>",
        medium = "<C-m>",
        hard = "<C-h>",
        accepted = "<C-a>",
        not_started = "<C-y>",
        tried = "<C-t>",
        page_next = "<C-l>",
        page_prev = "<C-h>",
    }
})
<details> <summary>Available language options for the <code>language</code> configuration are:</summary>
Short NameLanguage
cppC++
javaJava
pyPython 3
cC
csC#
jsJavaScript
rbRuby
swiftSwift
goGo
scalaScala
ktKotlin
rsRust
phpPHP
tsTypeScript
rktRacket
erlErlang
exElixir
dartDart
</details>

Login to your account

To use LeetBuddy.nvim, you'll need to obtain the CSRF token and session from your Leetcode account. Please make sure to log in to your account before proceeding. Please note that due to the authentication system implemented by Leetcode, manual login credentials entry is not supported.

https://github.com/Dhanus3133/Leetbuddy.nvim/assets/43700516/068f4019-5f2e-4003-a549-46fc061e3e21

Contributing

Contributions are welcome! If you have any bug reports, feature requests, or suggestions, please open an issue or submit a pull request. For major changes, please discuss them in the issue tracker before making any modifications.

License

This plugin is available under the MIT License. Feel free to use and modify it according to your needs.