Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/Dhanus3133/Leetbuddy.nvim

Solve Leetcode problems within Neovim 🔥
https://github.com/Dhanus3133/Leetbuddy.nvim

neovim neovim-plugin nvim-plugin plugin

Last synced: 2 months ago
JSON representation

Solve Leetcode problems within Neovim 🔥

Lists

README

        

## 👋 Archiving and Recommendation 🙌

I have decided to archive **LeetBuddy.nvim**. I believe that [kawre/leetcode.nvim](https://github.com/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

## Requirements

- Neovim (v0.9.0 or higher)
- `plenary.nvim`
- `telescope.nvim`

## Installation

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

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

```

## Commands

LeetBuddy.nvim provides the following commands:

- `LBQuestions`: Lists all Leetcode problems with submission status and difficulty level.
Additionally, there are custom filters available to further refine the displayed problems:
- ``: Reset all filters and display all problems.
- ``: Display only easy difficulty problems.
- ``: Display only medium difficulty problems.
- ``: Display only hard difficulty problems.
- ``: Display only problems with a status of "Accepted" (AC).
- ``: Display only problems with a status of "Not Started" (NOT_STARTED).
- ``: Display only problems with a status of "Tried" (TRIED).
- ``: Display problems next page.
- ``: Display problems prev page.
- `LBQuestion`: Displays the question in a popup window.
- `LBReset`: Resets the code of the current question to the default template.
- `LBTest`: Runs the test cases for the current question. Multiple test cases can be added.
- `LBSubmit`: Submits the code for the current question.
- `LBChangeLanguage`: Dynamically switch the language for the current problem.

## 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:

```lua
require('leetbuddy').setup({
domain = "com" -- `cn` for chinese leetcode
language = "py",
limit = 30, -- Number of problems displayed in telescope
keys = {
select = "",
reset = "",
easy = "",
medium = "",
hard = "",
accepted = "",
not_started = "",
tried = "",
page_next = "",
page_prev = "",
}
})
```

Available language options for the language configuration are:

| Short Name | Language |
| ---------- | ---------- |
| `cpp` | C++ |
| `java` | Java |
| `py` | Python 3 |
| `c` | C |
| `cs` | C# |
| `js` | JavaScript |
| `rb` | Ruby |
| `swift` | Swift |
| `go` | Go |
| `scala` | Scala |
| `kt` | Kotlin |
| `rs` | Rust |
| `php` | PHP |
| `ts` | TypeScript |
| `rkt` | Racket |
| `erl` | Erlang |
| `ex` | Elixir |
| `dart` | Dart |

## 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.

## 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.

---