summaryrefslogtreecommitdiffstats
path: root/modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix
blob: 353468559d18e3b79283b323ba44e57d6ef9b9c8 (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
75
76
77
78
79
80
81
82
83
84
{
  config,
  lib,
  ...
}: let
  inherit
    (lib.types)
    nullOr
    str
    bool
    attrsOf
    ints
    enum
    ;
  inherit (lib.options) mkOption mkEnableOption;
  inherit (lib.nvim.types) mkPluginSetupOption luaInline;
  inherit (config.vim.lib) mkMappingOption;
in {
  options.vim.assistant.supermaven-nvim = {
    enable = mkEnableOption "Supermaven AI assistant";

    setupOpts = mkPluginSetupOption "Supermaven" {
      keymaps = {
        accept_suggestion = mkMappingOption "The key to accept a suggestion" null // {example = "<Tab>";};
        clear_suggestion = mkMappingOption "The key to clear a suggestion" null // {example = "<C-]>";};
        accept_word = mkMappingOption "The key to accept a word" null // {example = "<C-j>";};
      };
      ignore_file = mkOption {
        type = nullOr (attrsOf bool);
        default = null;
        example = {
          markdown = true;
        };
        description = "List of fileto ignore";
      };
      color = {
        suggestion_color = mkOption {
          type = nullOr str;
          default = null;
          example = "#ffffff";
          description = "The hex color of the suggestion";
        };
        cterm = mkOption {
          type = nullOr ints.u8;
          default = null;
          example = 244;
          description = "The cterm color of the suggestion";
        };
      };
      log_level = mkOption {
        type = nullOr (enum [
          "off"
          "trace"
          "debug"
          "info"
          "warn"
          "error"
        ]);
        default = null;
        example = "info";
        description = "The log level. Set to `\"off\"` to disable completely";
      };
      disable_inline_completion = mkOption {
        type = nullOr bool;
        default = null;
        description = "Disable inline completion for use with cmp";
      };
      disable_keymaps = mkOption {
        type = nullOr bool;
        default = null;
        description = "Disable built-in keymaps for more manual control";
      };
      condition = mkOption {
        type = nullOr luaInline;
        default = null;
        description = ''
          Condition function to check for stopping supermaven.

          A returned `true` means to stop supermaven
        '';
      };
    };
  };
}