nvf/modules/plugins/notes/todo-comments/config.nix

33 lines
932 B
Nix
Raw Permalink Normal View History

2023-03-01 10:26:58 +00:00
{
pkgs,
config,
lib,
...
}: let
2024-04-19 19:28:07 +00:00
inherit (lib.modules) mkMerge mkIf;
inherit (lib.nvim.binds) mkBinding;
2024-02-17 21:28:12 +00:00
inherit (lib.nvim.lua) toLuaObject;
2023-03-01 10:26:58 +00:00
cfg = config.vim.notes.todo-comments;
2024-02-17 21:28:12 +00:00
self = import ./todo-comments.nix {inherit pkgs lib;};
inherit (self.options.vim.notes.todo-comments) mappings;
2023-03-01 10:26:58 +00:00
in {
config = mkIf cfg.enable {
vim = {
startPlugins = [
"todo-comments"
];
2023-03-01 10:26:58 +00:00
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))
];
2023-03-01 10:26:58 +00:00
luaConfigRC.todo-comments = ''
2024-02-17 21:28:12 +00:00
require('todo-comments').setup(${toLuaObject cfg.setupOpts})
'';
};
2023-03-01 10:26:58 +00:00
};
}