From dec72a02aad22f56d39f6590cce3ba5bed138666 Mon Sep 17 00:00:00 2001 From: zymon Date: Fri, 28 Mar 2025 21:14:51 +0100 Subject: [PATCH] cmp -> blink --- lua/znvim/plugins/blink.lua | 18 +++++++++ lua/znvim/plugins/cmp.lua | 77 ------------------------------------- 2 files changed, 18 insertions(+), 77 deletions(-) create mode 100644 lua/znvim/plugins/blink.lua delete mode 100644 lua/znvim/plugins/cmp.lua diff --git a/lua/znvim/plugins/blink.lua b/lua/znvim/plugins/blink.lua new file mode 100644 index 0000000..52779ba --- /dev/null +++ b/lua/znvim/plugins/blink.lua @@ -0,0 +1,18 @@ +return { + "https://github.com/saghen/blink.cmp", + version = '1.*', + + ---@module 'blink.cmp' + ---@type blink.cmp.Config + opts = { + keymap = { preset = 'default' }, + appearance = { + nerd_font_variant = 'mono' + }, + completion = { documentation = { auto_show = false } }, + sources = { + default = { 'lsp', 'path', 'snippets', 'buffer' }, + }, + }, + opts_extend = { "sources.default" } +} diff --git a/lua/znvim/plugins/cmp.lua b/lua/znvim/plugins/cmp.lua deleted file mode 100644 index fd1d85f..0000000 --- a/lua/znvim/plugins/cmp.lua +++ /dev/null @@ -1,77 +0,0 @@ -return { - - { - "https://github.com/hrsh7th/nvim-cmp", - dependencies = { - "https://github.com/hrsh7th/cmp-buffer", - "https://github.com/hrsh7th/cmp-path", - "https://github.com/hrsh7th/cmp-cmdline", - "https://github.com/hrsh7th/cmp-nvim-lsp", - "https://github.com/hrsh7th/cmp-nvim-lsp-signature-help", - -- "https://github.com/hrsh7th/cmp-nvim-lua", - -- "https://github.com/saadparwaiz1/cmp_luasnip", - }, - event = { "InsertEnter", "CmdlineEnter", "BufReadPost" }, - config = function() - local cmp = require("cmp") - cmp.setup({ - preselect = cmp.PreselectMode.None, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.confirm({ select = false }), - [""] = cmp.mapping.abort(), - }), - sources = cmp.config.sources({ - { name = "buffer", option = { keyword_length = 3 }, }, - { name = "path" }, - { name = "nvim_lsp" }, - { name = 'nvim_lsp_signature_help' }, - -- { name = "nvim_lua" }, - -- { name = "luasnip" }, - { name = "lazydev" }, - { name = "neorg" }, - }), - -- snippet = { - -- expand = function(args) - -- require("luasnip").lsp_expand(args.body) - -- end, - -- }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - formatting = { - fields = { "kind", "abbr", "menu" }, - format = function(entry, item) - item.kind = item.kind - item.menu = ({ - buffer = "[buf]", - path = "[path]", - cmdline = "[cmd]", - nvim_lsp = "[LSP]", - -- luasnip = "[snip]", - })[entry.source.name] or entry.source.name - return item - end, - }, - }) - - cmp.setup.cmdline('/', { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' } - } - }) - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' }, - { name = 'cmdline' } - }) - }) - end - }, - -}