1
0
Fork 0
mirror of https://github.com/NotAShelf/neovim-flake.git synced 2024-12-29 09:09:47 +01:00
neovim-flake/modules/autopairs/nvim-autopairs/config.nix

28 lines
669 B
Nix
Raw Normal View History

{
pkgs,
lib,
config,
...
}:
with lib;
with builtins; let
cfg = config.vim.autopairs;
in {
config =
mkIf (cfg.enable)
{
vim.startPlugins = ["nvim-autopairs"];
vim.luaConfigRC.autopairs = nvim.dag.entryAnywhere ''
require("nvim-autopairs").setup{}
${optionalString (config.vim.autocomplete.type == "nvim-compe") ''
require('nvim-autopairs.completion.compe').setup({
map_cr = ${boolToString cfg.nvim-compe.map_cr},
map_complete = ${boolToString cfg.nvim-compe.map_complete},
auto_select = ${boolToString cfg.nvim-compe.auto_select},
})
''}
'';
};
}