This commit is contained in:
Alfarel 2026-04-08 00:20:10 +02:00 committed by GitHub
commit b6b8b90e97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 485 additions and 623 deletions

View file

@ -1,7 +1,11 @@
{lib, ...}: let
{
config,
lib,
...
}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.binds) mkMappingOption;
inherit (lib.nvim.types) mkPluginSetupOption;
inherit (config.vim.lib) mkMappingOption;
in {
options.vim.assistant.chatgpt = {
enable = mkEnableOption "ChatGPT AI assistant. Requires the environment variable OPENAI_API_KEY to be set";

View file

@ -21,11 +21,11 @@
'';
mkLuaKeymap = mode: key: action: desc: opts:
opts
// {
inherit mode key action desc;
lua = true;
};
mkIf (key != null) (opts
// {
inherit mode key action desc;
lua = true;
});
in {
config = mkIf cfg.enable {
vim = {

View file

@ -8,6 +8,7 @@
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) nullOr str enum float;
inherit (lib.nvim.types) mkPluginSetupOption;
inherit (config.vim.lib) mkMappingOption;
cfg = config.vim.assistant.copilot;
in {
@ -59,72 +60,19 @@ in {
mappings = {
panel = {
jumpPrev = mkOption {
type = nullOr str;
default = "[[";
description = "Jump to previous suggestion";
};
jumpNext = mkOption {
type = nullOr str;
default = "]]";
description = "Jump to next suggestion";
};
accept = mkOption {
type = nullOr str;
default = "<CR>";
description = "Accept suggestion";
};
refresh = mkOption {
type = nullOr str;
default = "gr";
description = "Refresh suggestions";
};
open = mkOption {
type = nullOr str;
default = "<M-CR>";
description = "Open suggestions";
};
jumpPrev = mkMappingOption "Jump to previous suggestion" "[[";
jumpNext = mkMappingOption "Jump to next suggestion" "]]";
accept = mkMappingOption "Accept suggestion" "<CR>";
refresh = mkMappingOption "Refresh suggestions" "gr";
open = mkMappingOption "Open suggestions" "<M-CR>";
};
suggestion = {
accept = mkOption {
type = nullOr str;
default = "<M-l>";
description = "Accept suggestion";
};
acceptWord = mkOption {
type = nullOr str;
default = null;
description = "Accept next word";
};
acceptLine = mkOption {
type = nullOr str;
default = null;
description = "Accept next line";
};
prev = mkOption {
type = nullOr str;
default = "<M-[>";
description = "Previous suggestion";
};
next = mkOption {
type = nullOr str;
default = "<M-]>";
description = "Next suggestion";
};
dismiss = mkOption {
type = nullOr str;
default = "<C-]>";
description = "Dismiss suggestion";
};
accept = mkMappingOption "Accept suggestion" "<M-l>";
acceptWord = mkMappingOption "Accept next word" null;
acceptLine = mkMappingOption "Accept next line" null;
prev = mkMappingOption "Previous suggestion" "<M-[>";
next = mkMappingOption "Next suggestion" "<M-]>";
dismiss = mkMappingOption "Dismiss suggestion" "<C-]>";
};
};
};

View file

@ -1,4 +1,8 @@
{lib, ...}: let
{
config,
lib,
...
}: let
inherit
(lib.types)
nullOr
@ -11,7 +15,7 @@
;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
inherit (lib.nvim.binds) mkMappingOption;
inherit (config.vim.lib) mkMappingOption;
in {
options.vim.assistant.neocodeium = {
enable = mkEnableOption "NeoCodeium AI completion";

View file

@ -1,4 +1,8 @@
{lib, ...}: let
{
config,
lib,
...
}: let
inherit
(lib.types)
nullOr
@ -10,30 +14,16 @@
;
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 = mkOption {
type = nullOr str;
default = null;
example = "<Tab>";
description = "The key to accept a suggestion";
};
clear_suggestion = mkOption {
type = nullOr str;
default = null;
example = "<C-]>";
description = "The key to clear a suggestion";
};
accept_word = mkOption {
type = nullOr str;
default = null;
example = "<C-j>";
description = "The key to accept a word";
};
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);