This are the installation instructions for tzachar/cmp-tabnine using Packer:
return require("packer").startup(
function(use)
use "hrsh7th/nvim-cmp" --completion
use {'tzachar/cmp-tabnine', run='./install.sh', requires = 'hrsh7th/nvim-cmp'}
end
)
And later, enable the plugin:
require'cmp'.setup {
sources = {
{ name = 'cmp_tabnine' },
},
}
There is also some setup.
This is the NvChad documentation for adding a plugin, and for overriding default plugin configuration.
This is what I've done:
-- NvChad/lua/custom/plugins/init.lua
return {
["tzachar/cmp-tabnine"] = {
after = "cmp-path",
config = function()
require "custom.plugins.tabnine"
end,
},
}
-- NvChad/lua/custom/plugins/tabnine.lua
require('cmp_tabnine.config').setup({
max_lines = 1000;
max_num_results = 20;
sort = true;
run_on_every_keystroke = true;
snippet_placeholder = '..';
ignored_file_types = { -- default is not to ignore
-- uncomment to ignore in lua:
-- lua = true
};
show_prediction_strength = false;
})
-- NvChad/lua/custom/chardrc.lua
M.plugins = {
override = {
["hrsh7th/nvim-cmp"] = {
sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "nvim_lua" },
{ name = "path" },
{ name = "cmp-tabnine" },
},
}
}
}
There must be something I'm doing wrong. When I do :PackerSync
nothing happens.
The developer of cmp-tabnine tzachar has said:
Never used NvChad. But one issue that comes to mind is that you need to run the install.sh script. No Idea how to do that in NvChad.
Here is an example configuration in NvChad.