mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-13 16:25:04 +00:00
treewide: migrate to vim.keymaps
This commit is contained in:
parent
caef79e398
commit
55a96f83b4
13 changed files with 218 additions and 162 deletions
|
|
@ -5,31 +5,27 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetBinding;
|
||||
inherit (lib.nvim.binds) mkKeymap;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.git.git-conflict;
|
||||
|
||||
gcMappingDefinitions = options.vim.git.git-conflict.mappings;
|
||||
|
||||
gcMappings = addDescriptionsToMappings cfg.mappings gcMappingDefinitions;
|
||||
inherit (options.vim.git.git-conflict) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
vim = {
|
||||
startPlugins = ["git-conflict-nvim"];
|
||||
|
||||
maps = {
|
||||
normal = mkMerge [
|
||||
(mkSetBinding gcMappings.ours "<Plug>(git-conflict-ours)")
|
||||
(mkSetBinding gcMappings.theirs "<Plug>(git-conflict-theirs)")
|
||||
(mkSetBinding gcMappings.both "<Plug>(git-conflict-both)")
|
||||
(mkSetBinding gcMappings.none "<Plug>(git-conflict-none)")
|
||||
(mkSetBinding gcMappings.prevConflict "<Plug>(git-conflict-prev-conflict)")
|
||||
(mkSetBinding gcMappings.nextConflict "<Plug>(git-conflict-next-conflict)")
|
||||
];
|
||||
};
|
||||
keymaps = [
|
||||
(mkKeymap "n" cfg.mappings.ours "<Plug>(git-conflict-ours)" {desc = mappings.ours.description;})
|
||||
(mkKeymap "n" cfg.mappings.theirs "<Plug>(git-conflict-theirs)" {desc = mappings.theirs.description;})
|
||||
(mkKeymap "n" cfg.mappings.both "<Plug>(git-conflict-both)" {desc = mappings.both.description;})
|
||||
(mkKeymap "n" cfg.mappings.none "<Plug>(git-conflict-none)" {desc = mappings.none.description;})
|
||||
(mkKeymap "n" cfg.mappings.prevConflict "<Plug>(git-conflict-prev-conflict)" {desc = mappings.prevConflict.description;})
|
||||
(mkKeymap "n" cfg.mappings.nextConflict "<Plug>(git-conflict-next-conflict)" {desc = mappings.nextConflict.description;})
|
||||
];
|
||||
|
||||
pluginRC.git-conflict = entryAnywhere ''
|
||||
require('git-conflict').setup(${toLuaObject ({default_mappings = false;} // cfg.setupOpts)})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue