neovim-flake/modules/notes/todo-comments/config.nix

32 lines
896 B
Nix
Raw Normal View History

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