modules/nvim-cmp: add perFiletype settings

This commit is contained in:
Dmitriy Pleshevskiy 2025-04-02 13:57:36 +03:00
parent 94549da249
commit d7afdf14ea
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2

View file

@ -16,6 +16,11 @@ in
type = types.attrs;
default = { };
};
perFiletype = mkOption {
type = types.attrsOf types.attrs;
default = {};
};
};
@ -96,6 +101,10 @@ in
cfg.settings
{ snippet.expand = config.fn.nvim-cmp-snippet-expand.lambda; }
];
afterSetup = (lib.mapAttrsToList
(ft: ftSettings: pipe1 varName (call "setup.filetype" [ft ftSettings]))
cfg.perFiletype
);
};
}