Closed Abraxas-365 closed 1 year ago
Did you configure it correctly?
Hi , this is my relevant config
`local source_mapping = { buffer = "[Buffer]", nvim_lsp = "[LSP]", nvim_lua = "[Lua]", cmp_tabnine = "[T9]", path = "[Path]", luasnip = "[SNP]", } -- load vs-code like snippets from plugins (e.g. friendly-snippets) require("luasnip/loaders/from_vscode").lazy_load() vim.opt.completeopt = "menu,menuone,noselect"
cmp.setup({ snippet = { expand = function(args) luasnip.lsp_expand(args.body) end, },
-- sources for autocompletion sources = cmp.config.sources({ { name = "cmp_tabnine" }, { name = "nvim_lsp", max_item_count = 20 }, -- lsp { name = "luasnip", max_item_count = 10 }, -- snippets { name = "buffer", max_item_count = 10 }, -- text within current buffer { name = "path" }, -- file system paths }), -- -- configure lspkind for vs-code like icons formatting = { format = function(entry, vim_item) -- if you have lspkind installed, you can use it like -- in the following line: vim_item.kind = lspkind.symbolic(vim_item.kind, { mode = "symbol" }) vim_item.menu = source_mapping[entry.source.name] if entry.source.name == "cmp_tabnine" then local detail = (entry.completion_item.data or {}).detail vim_item.kind = "" if detail and detail:find(".%%.") then vim_item.kind = vim_item.kind .. " " .. detail end end local maxwidth = 50 vim_item.abbr = string.sub(vim_item.abbr, 1, maxwidth) return vim_item end, }, window = { completion = { pumheight = 5 }, }, }) local tabnine = require("cmp_tabnine.config")
tabnine:setup({ max_lines = 1000, max_num_results = 20, sort = true, priority = 5000, show_prediction_strength = true, run_on_every_keystroke = true, }) `
I think it means the after/plugin/cmp-tabnine.lua
file is not executed for some reason.
Check if everything works if you do:
:lua require('cmp_tabnine').setup()
Which plugin manager are you using?
Im using packer
When I run :lua require('cmp_tabnine').setup() cmp get another tabnine source
TabNine
`return packer.startup(function(use)
use("hrsh7th/nvim-cmp") --completion use("hrsh7th/cmp-buffer") -- source for text in buffer use("hrsh7th/cmp-path") -- source for file system paths use({ "tabnine/cmp-tabnine", run = "./install.sh", requires = "hrsh7th/nvim-cmp", })
if packer_bootstrap then require("packer").sync() end end) `
Why do yu have TabNine 3 times in cmpStatus? Other than that, everything looks like it should work.
Because when I run the command :lua require('cmp_tabnine').setup()
it spawn a new instance, but normally it is only one.
Also y have this error message when trying to run :CmpTabnineHub
: "Not an editor command"
This makes no sense.
The command should be registered from the plugin's after
folder.
I finally make it work, I commented all my init.lua except for cmp and tabnine , run nvim , and it work then uncomment all and it works , maybe it was a weird bug of my nvim or my mac
I almost forgot , the :CmpTabnineHub
still not working but at least the completion yes , its so weird
Hi Im trying to use tabnine on Mac M1, after installing the plugin and and enabling the plugin on cmp , nothing shows , also I have not available :CmpTabnineHub