Code Monkey home page Code Monkey logo

leetbuddy.nvim's Introduction

LeetBuddy.nvim

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

Demo

Leetbuddy.nvim.Demo.mp4

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:

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:

  • LBQuestions: Lists all Leetcode problems with submission status and difficulty level.
  • 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.

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",
})
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.

Login.mp4

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.


leetbuddy.nvim's People

Contributors

dhanus3133 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.