mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-09 12:06:11 +00:00
Merge 3860063606 into d6746a7510
This commit is contained in:
commit
b6b8b90e97
52 changed files with 485 additions and 623 deletions
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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-]>";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue