mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-17 09:21:19 +00:00
modules/completion: rewrite
This commit is contained in:
parent
7a8b95cf7c
commit
130f64d1ee
20 changed files with 331 additions and 362 deletions
|
|
@ -3,11 +3,28 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
|
||||
cfg = config.vim.snippets.vsnip;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = ["vim-vsnip"];
|
||||
};
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
vim.startPlugins = ["vim-vsnip"];
|
||||
}
|
||||
|
||||
(mkIf config.vim.autocomplete.nvim-cmp.enable {
|
||||
vim = {
|
||||
startPlugins = ["cmp-vsnip"];
|
||||
autocomplete.nvim-cmp = {
|
||||
sources = {"vsnip" = "[VSnip]";};
|
||||
setupOpts.snippet.expand = mkLuaInline ''
|
||||
function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue