utility/leetcode-nvim: init

This commit is contained in:
army castillo 2025-02-13 22:18:31 -05:00
commit 5c812b02fd
7 changed files with 134 additions and 1 deletions

View file

@ -177,6 +177,7 @@ isMaximal: {
surround.enable = isMaximal; surround.enable = isMaximal;
diffview-nvim.enable = true; diffview-nvim.enable = true;
yanky-nvim.enable = false; yanky-nvim.enable = false;
leetcode-nvim.enable = isMaximal;
motion = { motion = {
hop.enable = true; hop.enable = true;
leap.enable = true; leap.enable = true;

View file

@ -143,8 +143,12 @@
[ARCIII](https://github.com/ArmandoCIII): [ARCIII](https://github.com/ArmandoCIII):
[leetcode.nvim]: https://github.com/kawre/leetcode.nvim
- Add `vim.languages.zig.dap` support through pkgs.lldb dap adapter. Code - Add `vim.languages.zig.dap` support through pkgs.lldb dap adapter. Code
Inspiration from `vim.languages.clang.dap` implementation. Inspiration from `vim.languages.clang.dap` implementation.
- Add [leetcode.nvim] plugin under `vim.utility.leetcode-nvim`.
[nezia1](https://github.com/nezia1) [nezia1](https://github.com/nezia1)

View file

@ -15,5 +15,6 @@
./telescope ./telescope
./wakatime ./wakatime
./yanky-nvim ./yanky-nvim
./leetcode-nvim
]; ];
} }

View file

@ -0,0 +1,26 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
cfg = config.vim.utility.leetcode-nvim;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = [
"leetcode-nvim"
"plenary-nvim"
"fzf-lua"
"nui-nvim"
];
lazy.plugins.leetcode-nvim = {
package = "leetcode-nvim";
setupModule = "leetcode";
inherit (cfg) setupOpts;
};
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./leetcode-nvim.nix
./config.nix
];
}

View file

@ -0,0 +1,83 @@
{lib, ...}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) enum str bool;
inherit (lib.generators) mkLuaInline;
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
in {
options.vim.utility = {
leetcode-nvim = {
enable = mkEnableOption "complementary neovim plugin for leetcode.nvim";
setupOpts = mkPluginSetupOption "leetcode-nvim" {
logging = mkEnableOption "Whether to log leetcode.nvim status notifications." // { default = true; };
image_support = mkEnableOption "Whether to render question description images using image.nvim (image-nvim must be enabled)." // { default = false; };
lang = mkOption {
type = enum [
"cpp"
"java"
"python"
"python3"
"c"
"csharp"
"javascript"
"typescript"
"php"
"swift"
"kotlin"
"dart"
"golang"
"ruby"
"scala"
"rust"
"racket"
"erlang"
"elixir"
"bash"
];
default = "python3";
description = "Language to start your session with";
};
arg = mkOption {
type = str;
default = "leetcode.nvim";
description = "Argument for Neovim";
};
cn = {
enabled = mkEnableOption "Enable leetcode.cn instead of leetcode.com" // { default = false; };
translator = mkOption {
type = bool;
default = true;
description = "Enable translator";
};
translate_problems = mkOption {
type = bool;
default = true;
description = "Enable translation for problem questions";
};
};
storage = {
home = mkOption {
type = luaInline;
default = mkLuaInline "vim.fn.stdpath(\"data\") .. \"/leetcode\"";
description = "Home storage directory";
};
cache = mkOption {
type = luaInline;
default = mkLuaInline "vim.fn.stdpath(\"cache\") .. \"/leetcode\"";
description = "Cache storage directory";
};
};
plugins = {
non_standalone = mkEnableOption "To run leetcode.nvim in a non-standalone mode" // { default = false; };
};
};
};
};
}

View file

@ -555,6 +555,18 @@
"url": "https://github.com/ggandor/leap.nvim/archive/c6bfb191f1161fbabace1f36f578a20ac6c7642c.tar.gz", "url": "https://github.com/ggandor/leap.nvim/archive/c6bfb191f1161fbabace1f36f578a20ac6c7642c.tar.gz",
"hash": "1dmy45czi3irjd5qb74yamjam4d1lvqsgfxgh4vaj740b19gyl1w" "hash": "1dmy45czi3irjd5qb74yamjam4d1lvqsgfxgh4vaj740b19gyl1w"
}, },
"leetcode-nvim": {
"type": "Git",
"repository": {
"type": "GitHub",
"owner": "kawre",
"repo": "leetcode.nvim"
},
"branch": "master",
"revision": "db7e1cd6b9191b34b4c1f2f96e4e3949cde9f951",
"url": "https://github.com/kawre/leetcode.nvim/archive/db7e1cd6b9191b34b4c1f2f96e4e3949cde9f951.tar.gz",
"hash": "1d3lb7625b2qdzqm74mzrac66rxqc0qgjd3mb37l4v8wqyiyv6pp"
},
"lsp-lines": { "lsp-lines": {
"type": "Git", "type": "Git",
"repository": { "repository": {
@ -2044,4 +2056,4 @@
} }
}, },
"version": 3 "version": 3
} }