mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-16 07:13:53 +00:00
Merge pull request #1450 from alfarelcynthesis/no-default-mappings-option
treewide: allow disabling nvf mappings
This commit is contained in:
parent
63d5d8b2d4
commit
3ab2d5d876
52 changed files with 489 additions and 622 deletions
|
|
@ -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-]>";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue