mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
feat(extras.tabnine): tabnine blink.cmp integration
This commit is contained in:
parent
c6ae68259f
commit
55b7d01e44
1 changed files with 44 additions and 17 deletions
|
|
@ -1,15 +1,8 @@
|
||||||
return {
|
return {
|
||||||
-- Tabnine cmp source
|
-- Tabnine cmp source
|
||||||
{
|
|
||||||
"nvim-cmp",
|
|
||||||
optional = true,
|
|
||||||
dependencies = {
|
|
||||||
{
|
{
|
||||||
"tzachar/cmp-tabnine",
|
"tzachar/cmp-tabnine",
|
||||||
build = {
|
build = LazyVim.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
|
||||||
LazyVim.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
|
|
||||||
},
|
|
||||||
dependencies = "hrsh7th/nvim-cmp",
|
|
||||||
opts = {
|
opts = {
|
||||||
max_lines = 1000,
|
max_lines = 1000,
|
||||||
max_num_results = 3,
|
max_num_results = 3,
|
||||||
|
|
@ -19,7 +12,11 @@ return {
|
||||||
require("cmp_tabnine.config"):setup(opts)
|
require("cmp_tabnine.config"):setup(opts)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
|
||||||
|
{
|
||||||
|
"nvim-cmp",
|
||||||
|
optional = true,
|
||||||
|
dependencies = { "tzachar/cmp-tabnine" },
|
||||||
---@param opts cmp.ConfigSchema
|
---@param opts cmp.ConfigSchema
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
table.insert(opts.sources, 1, {
|
table.insert(opts.sources, 1, {
|
||||||
|
|
@ -36,6 +33,36 @@ return {
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"saghen/blink.cmp",
|
||||||
|
optional = true,
|
||||||
|
dependencies = { "tzachar/cmp-tabnine", "saghen/blink.compat" },
|
||||||
|
opts = {
|
||||||
|
sources = {
|
||||||
|
compat = { "cmp_tabnine" },
|
||||||
|
},
|
||||||
|
completion = {
|
||||||
|
menu = {
|
||||||
|
draw = {
|
||||||
|
components = {
|
||||||
|
kind = {
|
||||||
|
text = function(ctx)
|
||||||
|
return ctx.source_name == "cmp_tabnine" and "TabNine" or ctx.kind
|
||||||
|
end,
|
||||||
|
highlight = function(ctx)
|
||||||
|
return ctx.source_name == "cmp_tabnine" and "BlinkCmpKindTabNine"
|
||||||
|
or require("blink.cmp.completion.windows.render.tailwind").get_hl(ctx)
|
||||||
|
or ("BlinkCmpKind" .. ctx.kind)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
-- Show TabNine status in lualine
|
-- Show TabNine status in lualine
|
||||||
{
|
{
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue