treewide: migrate to vim.keymaps

This commit is contained in:
Ching Pei Yang 2026-06-12 14:44:46 +02:00 committed by Ching Pei Yang
commit 55a96f83b4
13 changed files with 218 additions and 162 deletions

View file

@ -4,8 +4,9 @@
options,
...
}: let
inherit (lib.modules) mkMerge mkIf;
inherit (lib.nvim.binds) mkBinding;
inherit (lib.modules) mkIf;
inherit (lib.lists) optional;
inherit (lib.nvim.binds) mkKeymap;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.notes.todo-comments;
@ -17,11 +18,18 @@ in {
"todo-comments-nvim"
];
maps.normal = mkMerge [
(mkBinding cfg.mappings.quickFix ":TodoQuickFix<CR>" mappings.quickFix.description)
(mkIf config.vim.telescope.enable (mkBinding cfg.mappings.telescope ":TodoTelescope<CR>" mappings.telescope.description))
(mkIf config.vim.lsp.trouble.enable (mkBinding cfg.mappings.trouble ":TodoTrouble<CR>" mappings.trouble.description))
];
keymaps =
[
(mkKeymap "n" cfg.mappings.quickFix ":TodoQuickFix<CR>" {desc = mappings.quickFix.description;})
]
++ (
optional config.vim.telescope.enable
(mkKeymap "n" cfg.mappings.telescope ":TodoTelescope<CR>" {desc = mappings.telescope.description;})
)
++ (
optional config.vim.lsp.trouble.enable
(mkKeymap "n" cfg.mappings.trouble ":TodoTrouble<CR>" {desc = mappings.trouble.description;})
);
pluginRC.todo-comments = ''
require('todo-comments').setup(${toLuaObject cfg.setupOpts})