Skip to content

Commit b7b6712

Browse files
saghenrexfordessilfie
authored andcommitted
feat: switch nvim-cmp for blink.cmp (nvim-lua#1426)
1 parent c239f52 commit b7b6712

File tree

2 files changed

+13
-26
lines changed

2 files changed

+13
-26
lines changed

init.lua

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,8 @@ require('lazy').setup({
482482
-- Useful status updates for LSP.
483483
{ 'j-hui/fidget.nvim', opts = {} },
484484

485-
-- Allows extra capabilities provided by nvim-cmp
486-
'hrsh7th/cmp-nvim-lsp',
485+
-- Allows extra capabilities provided by blink.cmp
486+
'saghen/blink.cmp',
487487
},
488488
config = function()
489489
-- Brief aside: **What is LSP?**
@@ -650,10 +650,9 @@ require('lazy').setup({
650650

651651
-- LSP servers and clients are able to communicate to each other what features they support.
652652
-- By default, Neovim doesn't support everything that is in the LSP specification.
653-
-- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities.
654-
-- So, we create new capabilities with nvim cmp, and then broadcast that to the servers.
655-
local capabilities = vim.lsp.protocol.make_client_capabilities()
656-
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
653+
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
654+
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
655+
local capabilities = require('blink.cmp').get_lsp_capabilities()
657656

658657
-- Enable the following language servers
659658
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
@@ -772,12 +771,14 @@ require('lazy').setup({
772771
},
773772

774773
{ -- Autocompletion
775-
'hrsh7th/nvim-cmp',
776-
event = 'InsertEnter',
774+
'saghen/blink.cmp',
775+
event = 'VimEnter',
776+
version = '1.*',
777777
dependencies = {
778-
-- Snippet Engine & its associated nvim-cmp source
778+
-- Snippet Engine
779779
{
780780
'L3MON4D3/LuaSnip',
781+
version = '2.*',
781782
build = (function()
782783
-- Build Step is needed for regex support in snippets.
783784
-- This step is not supported in many windows environments.
@@ -798,15 +799,9 @@ require('lazy').setup({
798799
-- end,
799800
-- },
800801
},
802+
opts = {},
801803
},
802-
'saadparwaiz1/cmp_luasnip',
803-
804-
-- Adds other completion capabilities.
805-
-- nvim-cmp does not ship with all sources by default. They are split
806-
-- into multiple repos for maintenance purposes.
807-
'hrsh7th/cmp-nvim-lsp',
808-
'hrsh7th/cmp-path',
809-
'hrsh7th/cmp-nvim-lsp-signature-help',
804+
'folke/lazydev.nvim',
810805
},
811806
},
812807

lua/kickstart/plugins/autopairs.lua

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,5 @@
44
return {
55
'windwp/nvim-autopairs',
66
event = 'InsertEnter',
7-
-- Optional dependency
8-
dependencies = { 'hrsh7th/nvim-cmp' },
9-
config = function()
10-
require('nvim-autopairs').setup {}
11-
-- If you want to automatically add `(` after selecting a function or method
12-
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
13-
local cmp = require 'cmp'
14-
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
15-
end,
7+
opts = {},
168
}

0 commit comments

Comments
 (0)