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

33 lines
924 B
Nix
Raw Normal View History

2023-03-01 11:26:58 +01:00
{
pkgs,
config,
lib,
...
}: let
inherit (lib) mkMerge mkIf;
inherit (lib.nvim.binds) mkBinding;
2024-02-17 22:28:12 +01:00
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
};
}