Comments (11)
author of nvchad here. i'd suggest using this as it doesnt load the plugin at startup.
@ansidev
{
"hrsh7th/nvim-cmp",
opts = {
sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "nvim_lua" },
{ name = "path" },
{ name = "cmp_tabnine" },
},
},
dependencies = {
{
"tzachar/cmp-tabnine",
build = "./install.sh",
config = function()
local tabnine = require "cmp_tabnine.config"
tabnine:setup {} -- put your options here
end,
},
},
},
from cmp-tabnine.
FWIW. This is how I got TabNine working in NvChad
custom/plugins/init.lua
return {
["tzachar/cmp-tabnine"] = {
after = "nvim-cmp",
run = "./install.sh",
config = function()
require "custom.plugins.configs.tabnine"
end,
},
}
custom/plugins/configs/tabnine.lua
local present, cmp = pcall(require, "cmp")
if not present then
return
end
local sources = {
{ name = 'cmp_tabnine' },
}
cmp.setup {
sources = sources,
}
from cmp-tabnine.
My config for NvChad v2.0
File: lua/custom/plugins.lua
{
"tzachar/cmp-tabnine",
lazy = false,
dependencies = "hrsh7th/nvim-cmp",
build = "./install.sh",
config = function()
require("cmp").setup {
sources = {
{ name = 'cmp_tabnine' },
},
}
require('cmp_tabnine.config').setup {
max_lines = 1000,
max_num_results = 20,
sort = true,
run_on_every_keystroke = true,
snippet_placeholder = '..',
show_prediction_strength = false
}
end,
},
from cmp-tabnine.
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.
You can also call the install.sh script by hand once, which will solve the issue.
from cmp-tabnine.
My setup appears to not be able to hook into tabnine at all.
When I run: :CmpStatus I can see that it's ready
I can see it's installed properly.
Does anyone know how I can get cmp to load my tab nine data?
Even my Tabnine hub seems to be picking up my sources and everything
from cmp-tabnine.
Did you add cmp_tabnine to cmp's sources list?
from cmp-tabnine.
I believe so, I assume that's why it's available in my first screen shot when I run :CmpStatus ๐ค
It almost feels like it gets picked up by cmp but not wired up to the lsp client itself.
The one language client that seems to get picked up by my LSP client is:
lspconfig.sumneko_lua.setup {
on_attach = M.on_attach,
capabilities = M.capabilities,
settings = {
Lua = {
diagnostics = {
globals = { "vim" },
},
workspace = {
library = {
[vim.fn.expand "$VIMRUNTIME/lua"] = true,
[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
},
maxPreload = 100000,
preloadFileSize = 10000,
},
},
},
}
because if have this config. I'm trying to figure out how to do the same for:
lspconfig.cmp_tabnine.setup {
on_attach = M.on_attach,
capabilities = M.capabilities,
}
This is my compiled packer file:
["cmp-tabnine"] = {
after_files = { "/Users/jasondorn/.local/share/nvim/site/pack/packer/opt/cmp-tabnine/after/plugin/cmp-tabnine.lua" },
config = { "\27LJ\2\ni\0\0\1\0\1\0\0025\0\0\0L\0\2\0\1\0\5\29show_prediction_strength\1\27run_on_every_keystroke\2\20max_num_results\3\5\14max_lines\3รจ\a\tsort\2\0" },
load_after = {
["nvim-cmp"] = true
},
loaded = false,
needs_bufread = false,
path = "/Users/jasondorn/.local/share/nvim/site/pack/packer/opt/cmp-tabnine",
url = "https://github.com/tzachar/cmp-tabnine"
},
Seems to load everything properly?
New Error:
from cmp-tabnine.
I don't know why you keep bringing up LSP. TabNine does not interface into any LSP, but operates on its own.
This plugin only plugs TabNine into cmp.
You need to remove all LSP config which references tabnine.
Anyway, I was asking if you added cmp_tabnine
as a source for cmp
from cmp-tabnine.
Sorry, newer to these configs, trying to make sense of it all.
I did!
sources = {
{ name = "luasnip" },
{ name = "nvim_lsp" },
{ name = "buffer" },
{ name = "nvim_lua" },
{ name = "path" },
{ name = "cmp_tabnine"}
},
Running :CmpStatus
yields:
So I believe it's ready to be used? My issue is probably less with your work and why my nvim-lsp isn't picking up on my cmp configs
from cmp-tabnine.
Again, nvim lsp is not connected to cmp. Its the other way around.
cmp will use nvim_lsp to get completion from the running lsp.
from cmp-tabnine.
You should call setup
with a :
require('cmp_tabnine.config'):setup
from cmp-tabnine.
Related Issues (20)
- Stop tabnine with a command? HOT 1
- Integrate with official TabNine plugin HOT 1
- Overlapping completion sources HOT 2
- Missing multiple features on clean install HOT 3
- cmp-tabnine: Cannot find installed TabNine. Please run install.sh HOT 2
- Auto-imports on Tabnine completions HOT 1
- Tabnine completion being very flaky after special characters (randomly not appearing) HOT 8
- Termux build HOT 1
- Latest TabNine binary doesnt have executable permissions HOT 2
- Tabnine sorting HOT 2
- Problem with multi-line completion preview not receiving all lines or cutting it off HOT 5
- entry.completion_item.data.detail always returns empty value HOT 2
- Cannot do the initial setup with Lazy.nvim HOT 1
- Lazy plugin manager HOT 5
- Tabnine completion items move to the right in nvim-cmp HOT 1
- Issue on startup HOT 2
- Lazynvim error HOT 2
- Insert value into documentation HOT 3
- contains byte that does not start any UTF-8 character HOT 4
- Error cmp-tabnine with Lazy.nvim HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmp-tabnine.