replace cmp with blink-cmp
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
<<<<<<< HEAD
|
||||||
"LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" },
|
"LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" },
|
||||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||||
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||||
@@ -6,6 +7,10 @@
|
|||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
|
||||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||||
|
=======
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
||||||
|
"blink.cmp": { "branch": "main", "commit": "a8222cf1ccbf24818ae926f94779267659809ab0" },
|
||||||
|
>>>>>>> 9de81ef (replace cmp with blink-cmp)
|
||||||
"dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" },
|
"dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" },
|
||||||
"fidget.nvim": { "branch": "main", "commit": "9238947645ce17d96f30842e61ba81147185b657" },
|
"fidget.nvim": { "branch": "main", "commit": "9238947645ce17d96f30842e61ba81147185b657" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
||||||
@@ -21,8 +26,6 @@
|
|||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||||
"none-ls.nvim": { "branch": "main", "commit": "40dc2e983560acaea29d6312b33fafba37b0c272" },
|
"none-ls.nvim": { "branch": "main", "commit": "40dc2e983560acaea29d6312b33fafba37b0c272" },
|
||||||
"nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" },
|
|
||||||
"nvim-cmp": { "branch": "main", "commit": "98e8b9d593a5547c126a39212d6f5e954a2d85dd" },
|
|
||||||
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "056f569f71e4b726323b799b9cfacc53653bceb3" },
|
"nvim-lspconfig": { "branch": "master", "commit": "056f569f71e4b726323b799b9cfacc53653bceb3" },
|
||||||
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
|
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
|
||||||
@@ -45,3 +48,4 @@
|
|||||||
"vim-fugitive": { "branch": "master", "commit": "fcb4db52e7f65b95705aa58f0f2df1312c1f2df2" },
|
"vim-fugitive": { "branch": "master", "commit": "fcb4db52e7f65b95705aa58f0f2df1312c1f2df2" },
|
||||||
"vim-helm": { "branch": "master", "commit": "ae1ebc160d2b9b90108477ab10df7a4fc501e358" }
|
"vim-helm": { "branch": "master", "commit": "ae1ebc160d2b9b90108477ab10df7a4fc501e358" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
'windwp/nvim-autopairs',
|
-- 'windwp/nvim-autopairs',
|
||||||
event = "InsertEnter",
|
-- event = "InsertEnter",
|
||||||
config = true
|
-- config = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
39
lua/crentist/lazy/completion.lua
Normal file
39
lua/crentist/lazy/completion.lua
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
return {
|
||||||
|
'saghen/blink.cmp',
|
||||||
|
-- optional: provides snippets for the snippet source
|
||||||
|
dependencies = {
|
||||||
|
'rafamadriz/friendly-snippets',
|
||||||
|
{ 'L3MON4D3/LuaSnip', version = 'v2.*' }
|
||||||
|
},
|
||||||
|
-- use a release tag to download pre-built binaries
|
||||||
|
-- version = 'v0.*',
|
||||||
|
build = 'cargo build --release',
|
||||||
|
|
||||||
|
opts = {
|
||||||
|
snippets = {
|
||||||
|
expand = function(snippet) require('luasnip').lsp_expand(snippet) end,
|
||||||
|
active = function(filter)
|
||||||
|
if filter and filter.direction then
|
||||||
|
return require('luasnip').jumpable(filter.direction)
|
||||||
|
end
|
||||||
|
return require('luasnip').in_snippet()
|
||||||
|
end,
|
||||||
|
jump = function(direction) require('luasnip').jump(direction) end,
|
||||||
|
},
|
||||||
|
|
||||||
|
keymap = { preset = 'enter' },
|
||||||
|
|
||||||
|
appearance = {
|
||||||
|
use_nvim_cmp_as_default = true,
|
||||||
|
nerd_font_variant = 'mono'
|
||||||
|
},
|
||||||
|
|
||||||
|
sources = {
|
||||||
|
default = { 'lsp', 'luasnip', 'path', 'buffer' },
|
||||||
|
cmdline = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
signature = { enabled = true }
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
@@ -4,13 +4,7 @@ return {
|
|||||||
dependencies = {
|
dependencies = {
|
||||||
'williamboman/mason.nvim',
|
'williamboman/mason.nvim',
|
||||||
'williamboman/mason-lspconfig.nvim',
|
'williamboman/mason-lspconfig.nvim',
|
||||||
'hrsh7th/nvim-cmp',
|
'saghen/blink.cmp',
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
|
||||||
'hrsh7th/cmp-buffer',
|
|
||||||
'hrsh7th/cmp-path',
|
|
||||||
'SergioRibera/cmp-dotenv',
|
|
||||||
'hrsh7th/cmp-cmdline',
|
|
||||||
'saadparwaiz1/cmp_luasnip',
|
|
||||||
'L3MON4D3/LuaSnip',
|
'L3MON4D3/LuaSnip',
|
||||||
'j-hui/fidget.nvim',
|
'j-hui/fidget.nvim',
|
||||||
'rafamadriz/friendly-snippets',
|
'rafamadriz/friendly-snippets',
|
||||||
@@ -31,7 +25,6 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
local lspconfig = require('lspconfig')
|
local lspconfig = require('lspconfig')
|
||||||
|
|
||||||
local cmp = require('cmp')
|
|
||||||
local luasnip = require('luasnip')
|
local luasnip = require('luasnip')
|
||||||
|
|
||||||
-- load snippets from friendly-snippets
|
-- load snippets from friendly-snippets
|
||||||
@@ -56,69 +49,13 @@ return {
|
|||||||
},
|
},
|
||||||
handlers = {
|
handlers = {
|
||||||
function(server_name)
|
function(server_name)
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||||
require('lspconfig')[server_name].setup({
|
require('lspconfig')[server_name].setup({
|
||||||
capabilities = capabilities
|
capabilities = capabilities
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
cmp.setup({
|
|
||||||
sources = {
|
|
||||||
{ name = 'path' },
|
|
||||||
{ name = 'nvim_lsp' },
|
|
||||||
{ name = 'luasnip', keyword_length = 2 },
|
|
||||||
{ name = 'buffer', keyword_length = 3 },
|
|
||||||
},
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
-- `Enter` key to confirm completion
|
|
||||||
['<CR>'] = cmp.mapping({
|
|
||||||
i = function(fallback)
|
|
||||||
if cmp.visible() and cmp.get_active_entry() then
|
|
||||||
cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
s = cmp.mapping.confirm({ select = true }),
|
|
||||||
c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
|
|
||||||
}),
|
|
||||||
['<Tab>'] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item()
|
|
||||||
elseif luasnip.locally_jumpable(1) then
|
|
||||||
luasnip.jump(1)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { 'i', 's' }),
|
|
||||||
|
|
||||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item()
|
|
||||||
elseif luasnip.locally_jumpable(-1) then
|
|
||||||
luasnip.jump(-1)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { 'i', 's' }),
|
|
||||||
|
|
||||||
-- Ctrl+Space to trigger completion menu
|
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
|
||||||
|
|
||||||
-- Scroll up and down in the completion documentation
|
|
||||||
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
|
||||||
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
|
||||||
}),
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require('luasnip').lsp_expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
|
||||||
local pythonLineLength = 95
|
local pythonLineLength = 95
|
||||||
lspconfig.pylsp.setup {
|
lspconfig.pylsp.setup {
|
||||||
settings = {
|
settings = {
|
||||||
@@ -146,9 +83,7 @@ return {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lspconfig.yamlls.setup {
|
lspconfig.yamlls.setup { }
|
||||||
capabilities = capabilities,
|
|
||||||
}
|
|
||||||
|
|
||||||
lspconfig.terraformls.setup {
|
lspconfig.terraformls.setup {
|
||||||
filetypes = { 'terraform', 'terraform-vars', 'tf' }
|
filetypes = { 'terraform', 'terraform-vars', 'tf' }
|
||||||
|
|||||||
Reference in New Issue
Block a user