neovim-flake/modules/plugins/notes/todo-comments/config.nix
diniamo a0197fe1bb treewide: migrate to pluginRC for correct DAG order
The "new" DAG order is as follows:
- (luaConfigPre)
- globalsScript
- basic
- theme
- pluginConfigs
- extraPluginConfigs
- mappings
- (luaConfigPost)
2024-07-18 10:25:58 +02:00

32 lines
929 B
Nix

{
pkgs,
config,
lib,
...
}: let
inherit (lib.modules) mkMerge mkIf;
inherit (lib.nvim.binds) mkBinding;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.notes.todo-comments;
self = import ./todo-comments.nix {inherit pkgs lib;};
inherit (self.options.vim.notes.todo-comments) mappings;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = [
"todo-comments"
];
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))
];
pluginRC.todo-comments = ''
require('todo-comments').setup(${toLuaObject cfg.setupOpts})
'';
};
};
}