autopairs/nvim-autopairs: lazy-load instead of always loading

This is suggested per the plugin's readme
This commit is contained in:
dish 2026-01-29 12:51:06 -05:00
commit a7718dd214
2 changed files with 8 additions and 8 deletions

View file

@ -4,17 +4,14 @@
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.autopairs.nvim-autopairs;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["nvim-autopairs"];
pluginRC.autopairs = entryAnywhere ''
require('nvim-autopairs').setup(${toLuaObject cfg.setupOpts})
'';
vim.lazy.plugins.nvim-autopairs = {
package = "nvim-autopairs";
setupModule = "nvim-autopairs";
setupOpts = cfg.setupOpts;
event = ["InsertEnter"];
};
};
}