diff options
| author | Polesznyák Márk <contact@pml68.dev> | 2025-09-28 21:16:48 +0200 |
|---|---|---|
| committer | Polesznyák Márk <contact@pml68.dev> | 2025-09-28 21:17:22 +0200 |
| commit | d0585ecf49f8eebc44cac7dae2a686d1ef33e141 (patch) | |
| tree | d864af6d053ae57ccdf18be2dc5a04f788e46875 | |
| parent | feat(markdown): add bindings for jumping between spelling errors (diff) | |
| download | nvim-d0585ecf49f8eebc44cac7dae2a686d1ef33e141.tar.gz | |
feat: replace nvim-cmp with blink.cmp
| -rw-r--r-- | lua/pml68/configs/cmp.lua | 35 | ||||
| -rw-r--r-- | lua/pml68/lazy.lua | 13 | ||||
| -rw-r--r-- | lua/pml68/lsp.lua | 3 | ||||
| -rw-r--r-- | lua/pml68/plugins/completion.lua | 54 | ||||
| -rw-r--r-- | lua/pml68/plugins/lang-specific.lua | 1 |
5 files changed, 45 insertions, 61 deletions
diff --git a/lua/pml68/configs/cmp.lua b/lua/pml68/configs/cmp.lua deleted file mode 100644 index 06d16cf..0000000 --- a/lua/pml68/configs/cmp.lua +++ /dev/null @@ -1,35 +0,0 @@ -local cmp = require("cmp") - -cmp.setup({ - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'path' }, - { name = 'vimtex' }, - { name = 'crates' }, - }, { - { name = 'buffer' }, - }), - snippet = { - expand = function(args) - vim.snippet.expand(args.body) - end, - }, - performance = { - throttle = 0, - }, - window = { - completion = { - border = "rounded", - scrollbar = false, - }, - documentation = { - border = "rounded", - scrollbar = false, - }, - }, - mapping = cmp.mapping.preset.insert({ - ['<CR>'] = cmp.mapping.confirm({ select = true }), - ['<S-Tab>'] = cmp.mapping.select_prev_item({ behavior = 'select' }), - ['<Tab>'] = cmp.mapping.select_next_item({ behavior = 'select' }), - }), -}) diff --git a/lua/pml68/lazy.lua b/lua/pml68/lazy.lua index bf0e87d..32500fa 100644 --- a/lua/pml68/lazy.lua +++ b/lua/pml68/lazy.lua @@ -1,6 +1,6 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", @@ -8,6 +8,15 @@ if not vim.loop.fs_stat(lazypath) then "--branch=stable", -- latest stable release lazypath, }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end end vim.opt.rtp:prepend(lazypath) diff --git a/lua/pml68/lsp.lua b/lua/pml68/lsp.lua index 08a6b00..6736e26 100644 --- a/lua/pml68/lsp.lua +++ b/lua/pml68/lsp.lua @@ -30,9 +30,6 @@ vim.api.nvim_create_autocmd({ "BufEnter" }, { }) vim.lsp.config('*', { - -- capabilities = vim.tbl_deep_extend("force", - -- vim.lsp.protocol.make_client_capabilities(), - -- require('cmp_nvim_lsp').default_capabilities()), on_attach = function(client, bufnr) require("workspace-diagnostics").populate_workspace_diagnostics(client, bufnr) end diff --git a/lua/pml68/plugins/completion.lua b/lua/pml68/plugins/completion.lua index 561ab22..94a5463 100644 --- a/lua/pml68/plugins/completion.lua +++ b/lua/pml68/plugins/completion.lua @@ -1,25 +1,39 @@ return { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - { - "windwp/nvim-autopairs", - opts = { - fast_wrap = {}, - disable_filetype = { "TelescopePrompt", "vim" }, + { + "saghen/blink.compat", + version = "2.*", + opts = {} + }, + { + "saghen/blink.cmp", + lazy = false, + version = "1.*", + opts = { + keymap = { preset = "default" }, + appearance = { + nerd_font_variant = "normal", + }, + completion = { + documentation = { + auto_show = true, + auto_show_delay_ms = 150, + }, + }, + sources = { + default = { "lsp", "path", "vimtex", "crates", "buffer" }, + providers = { + vimtex = { + name = "vimtex", + module = "blink.compat.source", + }, + crates = { + name = "crates", + module = "blink.compat.source", + }, + }, }, - config = function(_, opts) - require("nvim-autopairs").setup(opts) - - local cmp_autopairs = require "nvim-autopairs.completion.cmp" - require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done()) - end, + cmdline = { enabled = false }, + signature = { enabled = true }, }, - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", }, - config = function() - require("pml68.configs.cmp") - end, } diff --git a/lua/pml68/plugins/lang-specific.lua b/lua/pml68/plugins/lang-specific.lua index 4895f9e..079c90e 100644 --- a/lua/pml68/plugins/lang-specific.lua +++ b/lua/pml68/plugins/lang-specific.lua @@ -28,7 +28,6 @@ return { { "saecki/crates.nvim", tag = "stable", - dependencies = "hrsh7th/nvim-cmp", event = { "BufRead Cargo.toml", "BufWrite Cargo.toml" }, config = function() local crates = require("crates") |
