Open awonglk opened 4 weeks ago
I don't use nvchad, but I believe nvchad uses lazy.nvim and you need to utilize lazy's feature to merge options to set up cmp.
Not tested, but should be something like this:
That is, you fetch the option tables configured by nvchad previously, and then add cmp_ai
to it.
{"hrsh7th/nvim-cmp", opts = function(_, opts)
table.insert(opts.sources, 1, "cmp_ai")
-- you need to take a look at the nvchad's original configuration of nvim-cmp to
-- ensure you are using the correct location to insert "cmp_ai"
end,
dependencies = {
{ 'tzachar/cmp-ai', config = "your configuration here"}
}
}
Not an issue as such. Does anyone have a working configuration sample for cmp-ai plugin working with NVChad? I haven't been able to get this working, and would appreciate any "best practices".
I believe I need to:
Install and setup plugins in /lua/plugins/init.lua: {'tzachar/cmp-ai', dependencies = 'nvim-lua/plenary.nvim'},
This one-liner seems to work fine
A step to configure cmp-ai to use a specific external AI source (e.g. Codestral) in /lua/configs/cmp-ai.lua?
A step that involves nvm-cmp sources override? I assume also a file in /lua/configs/nvim-cmp.lua
Much appreciated!