From f5ac9bce3e704d6292fb715bac5a5306ba9b67ee Mon Sep 17 00:00:00 2001 From: liph Date: Fri, 6 Feb 2026 14:24:34 +0100 Subject: [PATCH] deleted the cmp-tabnine --- nvim/.config/nvim/lua/plugins/completions.lua | 88 +++++-------------- 1 file changed, 20 insertions(+), 68 deletions(-) diff --git a/nvim/.config/nvim/lua/plugins/completions.lua b/nvim/.config/nvim/lua/plugins/completions.lua index 1dd1f00..4da8884 100644 --- a/nvim/.config/nvim/lua/plugins/completions.lua +++ b/nvim/.config/nvim/lua/plugins/completions.lua @@ -1,6 +1,5 @@ -- completions.lua: Provides intelligent code completion via LSP or snippet engines. - --- completion.lua (nvim-cmp + LuaSnip + TabNine – no unzip required) +-- completion.lua (nvim-cmp + LuaSnip) return { ------------------------------------------------------------------ -- 1. Snippet engine & pre-made snippets @@ -9,11 +8,10 @@ return { "L3MON4D3/LuaSnip", version = "v2.*", build = "make install_jsregexp", - dependencies = { "rafamadriz/friendly-snippets" } + dependencies = { "rafamadriz/friendly-snippets" }, }, - ------------------------------------------------------------------ - -- 2. Core completion engine + all standard sources + -- 2. Core completion engine + standard sources ------------------------------------------------------------------ { "hrsh7th/nvim-cmp", @@ -23,55 +21,17 @@ return { "hrsh7th/cmp-path", "hrsh7th/cmp-cmdline", "hrsh7th/cmp-nvim-lua", - - ------------------------------------------------------------------ - -- 3. TabNine (AI) source – install without unzip - ------------------------------------------------------------------ - { - "tzachar/cmp-tabnine", - -- download & unpack with curl + tar (gzip) only - build = function() - local api = vim.fn - local version = api.systemlist('curl -sS https://update.tabnine.com/bundles/version')[1] - local platform = (function() - local os = api.substitute(api.system('uname -s'), '\n', '', '') - local arch = api.substitute(api.system('uname -m'), '\n', '', '') - return arch .. - '-unknown-' .. (os == 'Linux' and 'linux-musl' or os == 'Darwin' and 'apple-darwin' or 'linux-musl') - end)() - local root = api.stdpath('data') .. '/lazy/cmp-tabnine' - local target = root .. '/binaries/' .. version .. '/' .. platform - api.mkdir(target, 'p') - api.system(string.format( - 'curl -L https://update.tabnine.com/bundles/%s/%s/TabNine.zip | gzip -dc | tar -C %s -xf -', - version, platform, target)) - api.system('chmod +x ' .. target .. '/TabNine') - vim.g.cmp_tabnine_binary = target .. '/TabNine' - end, - opts = { - max_lines = 1000, - max_num_results = 20, - sort = true, - run_on_every_keystroke = true, - show_prediction_strength = false, - }, - config = function(_, opts) - require('cmp_tabnine.config'):setup(opts) - end, - }, }, - ------------------------------------------------------------------ - -- 4. nvim-cmp setup + -- 3. nvim-cmp setup ------------------------------------------------------------------ config = function() - local cmp = require('cmp') - require('luasnip.loaders.from_vscode').lazy_load() - + local cmp = require("cmp") + require("luasnip.loaders.from_vscode").lazy_load() cmp.setup({ snippet = { expand = function(args) - require('luasnip').lsp_expand(args.body) + require("luasnip").lsp_expand(args.body) end, }, window = { @@ -79,33 +39,25 @@ return { documentation = cmp.config.window.bordered(), }, mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), - [''] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), - [''] = cmp.mapping.confirm({ select = true }), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), }), sources = cmp.config.sources({ - { name = 'cmp_tabnine', priority = 100 }, - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'nvim_lua' }, + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "nvim_lua" }, }, { - { name = 'buffer' }, - { name = 'path' }, + { name = "buffer" }, + { name = "path" }, }), - formatting = { - format = function(entry, item) - if entry.source.name == 'cmp_tabnine' then item.menu = '' end - return item - end, - }, }) - -- cmd-line completion - cmp.setup.cmdline({ '/', '?' }, { sources = { { name = 'buffer' } } }) - cmp.setup.cmdline(':', { sources = cmp.config.sources({ { name = 'path' } }, { { name = 'cmdline' } }) }) + cmp.setup.cmdline({ "/", "?" }, { sources = { { name = "buffer" } } }) + cmp.setup.cmdline(":", { sources = cmp.config.sources({ { name = "path" } }, { { name = "cmdline" } }) }) end, }, }