From 5b0ea054fa156cc35d07efa028d209fb02ff088b Mon Sep 17 00:00:00 2001 From: 409 Date: Wed, 8 Jan 2025 16:49:51 +0100 Subject: [PATCH] chore(completion): remove commented `nvim-cmp` code --- lua/409/plugins/completion.lua | 109 --------------------------------- 1 file changed, 109 deletions(-) diff --git a/lua/409/plugins/completion.lua b/lua/409/plugins/completion.lua index 257442b..8d6869a 100644 --- a/lua/409/plugins/completion.lua +++ b/lua/409/plugins/completion.lua @@ -150,113 +150,4 @@ return { vim.api.nvim_set_hl(0, "BlinkCmpKindEnum", { link = "@variable.member" }) end, }, - --[[ { - "hrsh7th/nvim-cmp", - dependencies = { - "onsails/lspkind.nvim", - "VonHeikemen/lsp-zero.nvim", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-nvim-lsp-signature-help", - "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "L3MON4D3/LuaSnip", - }, - opts = function() - local cmp = require("cmp") - local lspkind = require("lspkind") - - local cmp_select = { behavior = cmp.SelectBehavior.Select } - local winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None" - - vim.api.nvim_set_hl(0, "CmpPmenuBorder", { link = "FloatBorder" }) - - -- cmp.event:on("confirm_done", require("nvim-autopairs.completion.cmp").on_confirm_done()) - - return { - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - sources = { - { name = "nvim_lsp" }, - { name = "nvim_lsp_signature_help" }, - { name = "nvim_lua" }, - { name = "vim-dadbod-completion" }, - { name = "luasnip", keyword_length = 2 }, - -- { name = "buffer", keyword_length = 3 }, - }, - view = { - entries = "custom", - }, - completion = { - completeopt = "menu,menuone,noselect,preview", - docs_initially_visible = true, - }, - window = { - documentation = { - border = "single", - winhighlight = winhighlight, - }, - completion = { - border = "single", - winhighlight = winhighlight, - }, - }, - formatting = { - fields = { "kind", "abbr", "menu" }, - format = function(entry, vim_item) - local kind = lspkind.cmp_format({ mode = "symbol_text", maxwidth = 70 })(entry, vim_item) - local strings = vim.split(kind.kind, "%s", { trimempty = true }) - kind.kind = " " .. (strings[1] or "") .. " " - kind.menu = " (" .. (strings[2] or "") .. ")" - if entry.source.name == "vim-dadbod-completion" then - kind.kind = "  " - kind.menu = "[DB]" - end - - vim_item.dup = ({ - vsnip = 0, - nvim_lsp = 0, - nvim_lua = 0, - buffer = 0, - })[entry.source.name] or 0 - - return kind - end, - }, - mapping = cmp.mapping.preset.insert({ - [""] = function() - if not cmp.visible() then - cmp.complete() - end - cmp.select_prev_item(cmp_select) - end, - [""] = function() - if not cmp.visible() then - cmp.complete() - end - cmp.select_next_item(cmp_select) - end, - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping.complete(), - [""] = nil, - [""] = nil, - }), - sorting = { - comparators = { - cmp.config.compare.offset, - cmp.config.compare.exact, - cmp.config.compare.score, - cmp.config.compare.recently_used, - cmp.config.compare.kind, - }, - }, - } - end, - }, ]] }