From 0517522fc5cabb6f36f4029c7e77797ef99dbbd9 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Mon, 29 Sep 2025 22:37:51 -0500 Subject: replace nvim-cmp for blink.cmp and enable lsp by default --- lua/tjk/plugins/cmp.lua | 37 ++++++++++--------------------------- lua/tjk/plugins/lsp.lua | 4 ++-- 2 files changed, 12 insertions(+), 29 deletions(-) (limited to 'lua/tjk') diff --git a/lua/tjk/plugins/cmp.lua b/lua/tjk/plugins/cmp.lua index 346e006..3ea4026 100644 --- a/lua/tjk/plugins/cmp.lua +++ b/lua/tjk/plugins/cmp.lua @@ -1,30 +1,13 @@ return { - "hrsh7th/nvim-cmp", - dependencies = { - "hrsh7th/cmp-path", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "ray-x/cmp-treesitter", + "saghen/blink.cmp", + opts = { + keymap = { + preset = "super-tab", + + [""] = { "select_prev", "fallback" }, + [""] = { "select_next", "fallback" }, + }, + + cmdline = { enabled = false }, }, - config = function() - local cmp = require("cmp") - cmp.setup { - sources = { - { name = "path" }, - { name = "lsp" }, - { name = "buffer" }, - { name = "treesitter" }, - }, - mapping = cmp.mapping.preset.insert { - --[''] = cmp.mapping.scroll_docs(-4), - --[''] = cmp.mapping.scroll_docs(4), - --[''] = cmp.mapping.complete(), - --[''] = cmp.mapping.abort(), - --[''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert }, - [""] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert }, - [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - }, - } - end } diff --git a/lua/tjk/plugins/lsp.lua b/lua/tjk/plugins/lsp.lua index a23f7ef..5a73721 100644 --- a/lua/tjk/plugins/lsp.lua +++ b/lua/tjk/plugins/lsp.lua @@ -1,9 +1,9 @@ return { "neovim/nvim-lspconfig", - enabled = false, dependencies = { "williamboman/mason.nvim", -- install lsp's "williamboman/mason-lspconfig.nvim", + "saghen/blink.cmp", -- to ensure lspconfig can get completion capabilities }, config = function() require("mason").setup() @@ -11,7 +11,7 @@ return { local lspconfig = require("lspconfig") lspconfig.pylsp.setup { autostart = false, - capabilities = require("cmp_nvim_lsp").default_capabilities() + capabilities = require("blink.cmp").get_lsp_capabilities() } end } -- cgit v1.2.3