2023-02-27 14:53:34 +00:00
|
|
|
{
|
|
|
|
config,
|
2024-02-26 05:05:23 +00:00
|
|
|
lib,
|
2023-02-27 14:53:34 +00:00
|
|
|
...
|
2023-11-07 00:50:27 +00:00
|
|
|
}: let
|
2024-02-26 05:05:23 +00:00
|
|
|
inherit (lib.modules) mkIf;
|
2024-02-17 13:13:52 +00:00
|
|
|
inherit (lib.nvim.dag) entryAnywhere;
|
|
|
|
inherit (lib.nvim.lua) toLuaObject;
|
2023-11-07 00:50:27 +00:00
|
|
|
|
2023-02-27 14:53:34 +00:00
|
|
|
cfg = config.vim.autopairs;
|
|
|
|
in {
|
2024-02-26 05:05:23 +00:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
vim.startPlugins = ["nvim-autopairs"];
|
2023-02-27 14:53:34 +00:00
|
|
|
|
2024-02-26 05:05:23 +00:00
|
|
|
vim.luaConfigRC.autopairs = entryAnywhere ''
|
2024-06-25 07:23:35 +00:00
|
|
|
require("nvim-autopairs").setup({ map_cr = ${toLuaObject (!config.vim.autocomplete.enable)} })
|
2024-02-26 05:05:23 +00:00
|
|
|
'';
|
|
|
|
};
|
2023-02-27 14:53:34 +00:00
|
|
|
}
|