From 2317cba854a9bdeb1c864b068ed9fb9da4fb29b9 Mon Sep 17 00:00:00 2001 From: Devin Droddy Date: Fri, 4 Jul 2025 22:19:50 -0400 Subject: [PATCH] supermaven-nvim: add option closes #970 --- modules/plugins/assistant/default.nix | 1 + .../plugins/assistant/supermaven/config.nix | 17 ++++ .../plugins/assistant/supermaven/default.nix | 6 ++ .../assistant/supermaven/supermaven.nix | 82 +++++++++++++++++++ npins/sources.json | 13 +++ 5 files changed, 119 insertions(+) create mode 100644 modules/plugins/assistant/supermaven/config.nix create mode 100644 modules/plugins/assistant/supermaven/default.nix create mode 100644 modules/plugins/assistant/supermaven/supermaven.nix diff --git a/modules/plugins/assistant/default.nix b/modules/plugins/assistant/default.nix index ab50ea4f..7329753a 100644 --- a/modules/plugins/assistant/default.nix +++ b/modules/plugins/assistant/default.nix @@ -3,6 +3,7 @@ ./chatgpt ./copilot ./codecompanion + ./supermaven ./avante ]; } diff --git a/modules/plugins/assistant/supermaven/config.nix b/modules/plugins/assistant/supermaven/config.nix new file mode 100644 index 00000000..f2c13ba6 --- /dev/null +++ b/modules/plugins/assistant/supermaven/config.nix @@ -0,0 +1,17 @@ +{ + config, + lib, + ... +}: let + cfg = config.vim.assistant.supermaven; +in { + config = lib.mkIf cfg.enable { + vim.plugins = { + supermaven-nvim = { + package = "supermaven-nvim"; + setupModule = "supermaven-nvim"; + inherit (cfg) setupOpts; + }; + }; + }; +} diff --git a/modules/plugins/assistant/supermaven/default.nix b/modules/plugins/assistant/supermaven/default.nix new file mode 100644 index 00000000..a1de45d5 --- /dev/null +++ b/modules/plugins/assistant/supermaven/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./supermaven.nix + ./config.nix + ]; +} diff --git a/modules/plugins/assistant/supermaven/supermaven.nix b/modules/plugins/assistant/supermaven/supermaven.nix new file mode 100644 index 00000000..2a7060b3 --- /dev/null +++ b/modules/plugins/assistant/supermaven/supermaven.nix @@ -0,0 +1,82 @@ +{lib, ...}: let + inherit (lib) mkOption mkEnableOption types; +in { + options.vim.assistant.supermaven = { + enable = mkEnableOption "Supermaven AI assistant"; + + setupOpts = lib.nvim.types.mkPluginSetupOption "Supermaven" { + keymaps = { + accept_suggestion = mkOption { + type = types.nullOr lib.types.str; + default = null; + example = ""; + description = "The key to accept a suggestion"; + }; + clear_suggestion = mkOption { + type = types.nullOr lib.types.str; + default = null; + example = ""; + description = "The key to clear a suggestion"; + }; + accept_word = mkOption { + type = types.nullOr lib.types.str; + default = null; + example = ""; + description = "The key to accept a word"; + }; + }; + ignore_filetypes = mkOption { + type = types.nullOr (types.attrsOf types.bool); + default = null; + example = { + markdown = true; + }; + description = "List of filetypes to ignore"; + }; + color = { + suggestion_color = mkOption { + type = types.nullOr types.str; + default = null; + example = "#ffffff"; + description = "The hex color of the suggestion"; + }; + cterm = mkOption { + type = types.nullOr types.ints.u8; + default = null; + example = 244; + description = "The cterm color of the suggestion"; + }; + }; + log_level = mkOption { + type = types.nullOr ( + types.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 = types.nullOr types.bool; + default = null; + description = "Disable inline completion for use with cmp"; + }; + disable_keymaps = mkOption { + type = types.nullOr types.bool; + default = null; + description = "Disable built-in keymaps for more manual control"; + }; + condition = mkOption { + type = types.nullOr lib.nvim.types.luaInline; + default = null; + description = "Condition function to check for stopping supermaven. A returned `true` means to stop supermaven"; + }; + }; + }; +} diff --git a/npins/sources.json b/npins/sources.json index 6b51ae44..5a962940 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -2335,6 +2335,19 @@ "url": "https://github.com/nanotee/sqls.nvim/archive/d1bc5421ef3e8edc5101e37edbb7de6639207a09.tar.gz", "hash": "1j4n5c8h1iriqzsjxr0wvz70g9lf6d4lm3nyxlpwy9dqmbj8w0kd" }, + "supermaven-nvim": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "supermaven-inc", + "repo": "supermaven-nvim" + }, + "branch": "main", + "submodules": false, + "revision": "07d20fce48a5629686aefb0a7cd4b25e33947d50", + "url": "https://github.com/supermaven-inc/supermaven-nvim/archive/07d20fce48a5629686aefb0a7cd4b25e33947d50.tar.gz", + "hash": "1h9h98wsnfhkfdmdxjvr2d4idhrvp4i56pp4q6l0m4d2i0ldcgfp" + }, "tabular": { "type": "Git", "repository": {