summaryrefslogtreecommitdiffstats
path: root/modules/plugins/utility/leetcode-nvim/leetcode-nvim.nix
blob: feb615704ead3acb028d53ac63582f743b40411d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{lib, ...}: let
  inherit (lib.options) mkOption mkEnableOption;
  inherit (lib.types) enum str;
  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 "logging for leetcode.nvim status notifications." // {default = true;};
        image_support = mkEnableOption "question description images using image.nvim (image-nvim must be enabled).";

        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 "leetcode.cn instead of leetcode.com";
          translator = mkEnableOption "translator" // {default = true;};
          translate_problems = mkEnableOption "translation for problem questions" // {default = true;};
        };

        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 "leetcode.nvim in a non-standalone mode";
        };
      };
    };
  };
}