mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-15 00:21:02 +00:00
cmp: actually lazy load source
This commit is contained in:
parent
f107cc45eb
commit
4b703964e1
4 changed files with 43 additions and 0 deletions
|
|
@ -21,6 +21,17 @@ in {
|
|||
vim = {
|
||||
startPlugins = ["nvim-treesitter"] ++ optional usingNvimCmp "cmp-treesitter";
|
||||
|
||||
lazy.plugins = {
|
||||
cmp-treesitter = mkIf usingNvimCmp {
|
||||
package = "cmp-treesitter";
|
||||
after = ''
|
||||
local path = vim.fn.globpath(vim.o.packpath, 'pack/*/opt/cmp-treesitter')
|
||||
require("rtp_nvim").source_after_plugin_dir(path)
|
||||
'';
|
||||
};
|
||||
nvim-cmp.after = mkIf cfg.cmp.enable "require('lz.n').trigger_load('cmp-treesitter')";
|
||||
};
|
||||
|
||||
autocomplete.nvim-cmp.sources = {treesitter = "[Treesitter]";};
|
||||
treesitter.grammars = optionals cfg.addDefaultGrammars cfg.defaultGrammars;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue