From 2317cba854a9bdeb1c864b068ed9fb9da4fb29b9 Mon Sep 17 00:00:00 2001 From: Devin Droddy Date: Fri, 4 Jul 2025 22:19:50 -0400 Subject: [PATCH 1/7] 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": { From b86e7d157d392a63c867fa36f5098ab459254b7f Mon Sep 17 00:00:00 2001 From: Devin Droddy Date: Sat, 5 Jul 2025 11:08:15 -0400 Subject: [PATCH 2/7] supermaven-nvim: fixes --- modules/plugins/assistant/default.nix | 2 +- .../{supermaven => supermaven-nvim}/config.nix | 4 ++-- .../{supermaven => supermaven-nvim}/default.nix | 0 .../supermaven-nvim.nix} | 11 ++++++++--- 4 files changed, 11 insertions(+), 6 deletions(-) rename modules/plugins/assistant/{supermaven => supermaven-nvim}/config.nix (76%) rename modules/plugins/assistant/{supermaven => supermaven-nvim}/default.nix (100%) rename modules/plugins/assistant/{supermaven/supermaven.nix => supermaven-nvim/supermaven-nvim.nix} (89%) diff --git a/modules/plugins/assistant/default.nix b/modules/plugins/assistant/default.nix index 7329753a..a4da583a 100644 --- a/modules/plugins/assistant/default.nix +++ b/modules/plugins/assistant/default.nix @@ -3,7 +3,7 @@ ./chatgpt ./copilot ./codecompanion - ./supermaven + ./supermaven-nvim ./avante ]; } diff --git a/modules/plugins/assistant/supermaven/config.nix b/modules/plugins/assistant/supermaven-nvim/config.nix similarity index 76% rename from modules/plugins/assistant/supermaven/config.nix rename to modules/plugins/assistant/supermaven-nvim/config.nix index f2c13ba6..55d401a5 100644 --- a/modules/plugins/assistant/supermaven/config.nix +++ b/modules/plugins/assistant/supermaven-nvim/config.nix @@ -3,10 +3,10 @@ lib, ... }: let - cfg = config.vim.assistant.supermaven; + cfg = config.vim.assistant.supermaven-nvim; in { config = lib.mkIf cfg.enable { - vim.plugins = { + vim.lazy.plugins = { supermaven-nvim = { package = "supermaven-nvim"; setupModule = "supermaven-nvim"; diff --git a/modules/plugins/assistant/supermaven/default.nix b/modules/plugins/assistant/supermaven-nvim/default.nix similarity index 100% rename from modules/plugins/assistant/supermaven/default.nix rename to modules/plugins/assistant/supermaven-nvim/default.nix diff --git a/modules/plugins/assistant/supermaven/supermaven.nix b/modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix similarity index 89% rename from modules/plugins/assistant/supermaven/supermaven.nix rename to modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix index 2a7060b3..651dfdf6 100644 --- a/modules/plugins/assistant/supermaven/supermaven.nix +++ b/modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix @@ -1,7 +1,8 @@ {lib, ...}: let - inherit (lib) mkOption mkEnableOption types; + inherit (lib) types; + inherit (lib.options) mkOption mkEnableOption; in { - options.vim.assistant.supermaven = { + options.vim.assistant.supermaven-nvim = { enable = mkEnableOption "Supermaven AI assistant"; setupOpts = lib.nvim.types.mkPluginSetupOption "Supermaven" { @@ -75,7 +76,11 @@ in { 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"; + description = '' + Condition function to check for stopping supermaven. + + A returned `true` means to stop supermaven + ''; }; }; }; From 53c85ca262c40c53087f91c81281c16864849a92 Mon Sep 17 00:00:00 2001 From: Devin Droddy Date: Sat, 5 Jul 2025 11:15:37 -0400 Subject: [PATCH 3/7] assistant/supermaven-nvim: explicit type imports --- .../supermaven-nvim/supermaven-nvim.nix | 52 +++++++++++-------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix b/modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix index 651dfdf6..4f1acb66 100644 --- a/modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix +++ b/modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix @@ -1,80 +1,86 @@ {lib, ...}: let - inherit (lib) types; + inherit + (lib.types) + nullOr + str + bool + attrsOf + ints + enum + ; inherit (lib.options) mkOption mkEnableOption; in { options.vim.assistant.supermaven-nvim = { enable = mkEnableOption "Supermaven AI assistant"; - setupOpts = lib.nvim.types.mkPluginSetupOption "Supermaven" { + setupOpts = lib.nvim.mkPluginSetupOption "Supermaven" { keymaps = { accept_suggestion = mkOption { - type = types.nullOr lib.types.str; + type = nullOr str; default = null; example = ""; description = "The key to accept a suggestion"; }; clear_suggestion = mkOption { - type = types.nullOr lib.types.str; + type = nullOr str; default = null; example = ""; description = "The key to clear a suggestion"; }; accept_word = mkOption { - type = types.nullOr lib.types.str; + type = nullOr str; default = null; example = ""; description = "The key to accept a word"; }; }; - ignore_filetypes = mkOption { - type = types.nullOr (types.attrsOf types.bool); + ignore_file = mkOption { + type = nullOr (attrsOf bool); default = null; example = { markdown = true; }; - description = "List of filetypes to ignore"; + description = "List of fileto ignore"; }; color = { suggestion_color = mkOption { - type = types.nullOr types.str; + type = nullOr str; default = null; example = "#ffffff"; description = "The hex color of the suggestion"; }; cterm = mkOption { - type = types.nullOr types.ints.u8; + type = nullOr 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" - ] - ); + 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 = types.nullOr types.bool; + type = nullOr bool; default = null; description = "Disable inline completion for use with cmp"; }; disable_keymaps = mkOption { - type = types.nullOr types.bool; + type = nullOr bool; default = null; description = "Disable built-in keymaps for more manual control"; }; condition = mkOption { - type = types.nullOr lib.nvim.types.luaInline; + type = nullOr lib.nvim.luaInline; default = null; description = '' Condition function to check for stopping supermaven. From 6dcca0e96e7109cf3f3835fe89f8b5e960c9af34 Mon Sep 17 00:00:00 2001 From: Devin Droddy Date: Sat, 5 Jul 2025 11:23:15 -0400 Subject: [PATCH 4/7] docs/release-notes: add entry for supermaven-nvim --- docs/release-notes/rl-0.8.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index a03ab9fe..fa24d0c9 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -445,3 +445,9 @@ - Restore vim-dirtytalk plugin and fix ordering with spellcheck in generated config. - Fix lualine separator options - Add [neogit], an interactive and powerful Git interface for Neovim, inspired by Magit +[justDeeevin](https://github.com/justDeeevin): + +[supermaven-nvim]: https://github.com/supermaven-inc/supermaven-nvim + +- Add [supermaven-nvim] plugin in `vim.assistant.supermaven-nvim` with `enable` and + `setupOpts` From c86a8a7ddb28e2ae32e5f73468e4e46de1b6c08c Mon Sep 17 00:00:00 2001 From: Devin Droddy Date: Tue, 8 Jul 2025 11:29:23 -0400 Subject: [PATCH 5/7] assistant/supermaven-nvim: fix bad file reference whoops --- modules/plugins/assistant/supermaven-nvim/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/plugins/assistant/supermaven-nvim/default.nix b/modules/plugins/assistant/supermaven-nvim/default.nix index a1de45d5..0da957cb 100644 --- a/modules/plugins/assistant/supermaven-nvim/default.nix +++ b/modules/plugins/assistant/supermaven-nvim/default.nix @@ -1,6 +1,6 @@ { imports = [ - ./supermaven.nix + ./supermaven-nvim.nix ./config.nix ]; } From 0bd9f1f0ec01ec56be38b3525a1d27d0bf67b6ac Mon Sep 17 00:00:00 2001 From: Devin Droddy Date: Wed, 9 Jul 2025 17:36:11 -0400 Subject: [PATCH 6/7] assistant/supermaven-nvim: import improvement --- modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix b/modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix index 4f1acb66..80a27e47 100644 --- a/modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix +++ b/modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix @@ -9,11 +9,12 @@ enum ; inherit (lib.options) mkOption mkEnableOption; + inherit (lib.nvim.types) mkPluginSetupOption; in { options.vim.assistant.supermaven-nvim = { enable = mkEnableOption "Supermaven AI assistant"; - setupOpts = lib.nvim.mkPluginSetupOption "Supermaven" { + setupOpts = mkPluginSetupOption "Supermaven" { keymaps = { accept_suggestion = mkOption { type = nullOr str; From e78d4bb3c97a6faabc3b32bc9e62b8a3de8b4566 Mon Sep 17 00:00:00 2001 From: Devin Droddy Date: Thu, 10 Jul 2025 21:09:17 -0400 Subject: [PATCH 7/7] assistant/supermaven-nvim: fix usage of luaInline type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 😭 --- modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix b/modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix index 80a27e47..0d1efd19 100644 --- a/modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix +++ b/modules/plugins/assistant/supermaven-nvim/supermaven-nvim.nix @@ -9,7 +9,7 @@ enum ; inherit (lib.options) mkOption mkEnableOption; - inherit (lib.nvim.types) mkPluginSetupOption; + inherit (lib.nvim.types) mkPluginSetupOption luaInline; in { options.vim.assistant.supermaven-nvim = { enable = mkEnableOption "Supermaven AI assistant"; @@ -81,7 +81,7 @@ in { description = "Disable built-in keymaps for more manual control"; }; condition = mkOption { - type = nullOr lib.nvim.luaInline; + type = nullOr luaInline; default = null; description = '' Condition function to check for stopping supermaven.