mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2025-01-08 09:47:36 +00:00
Add luasnip and lsp snippit support
This commit is contained in:
parent
38a0919865
commit
9778c8c5fa
@ -163,6 +163,8 @@ return require('packer').startup(function()
|
|||||||
"hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
"hrsh7th/cmp-buffer",
|
"hrsh7th/cmp-buffer",
|
||||||
"f3fora/cmp-spell",
|
"f3fora/cmp-spell",
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
"saadparwaiz1/cmp_luasnip",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,8 +8,12 @@ function M.config_cmp()
|
|||||||
completeopt = "menuone,noinsert,noselect",
|
completeopt = "menuone,noinsert,noselect",
|
||||||
autocomplete = false,
|
autocomplete = false,
|
||||||
},
|
},
|
||||||
|
expand = function(args)
|
||||||
|
require("luasnip").lsp_expand(args.body)
|
||||||
|
end,
|
||||||
sources = {
|
sources = {
|
||||||
{name = "nvim_lsp"},
|
{name = "nvim_lsp"},
|
||||||
|
{name = "luasnip"},
|
||||||
{name = "buffer"},
|
{name = "buffer"},
|
||||||
{name = "spell"},
|
{name = "spell"},
|
||||||
},
|
},
|
||||||
|
@ -81,8 +81,7 @@ local function config_lsp()
|
|||||||
-- Maybe update capabilities
|
-- Maybe update capabilities
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
if utils.is_plugin_loaded("cmp-nvim-lsp") then
|
if utils.is_plugin_loaded("cmp-nvim-lsp") then
|
||||||
capabilities = require("cmp_nvim_lsp").update_capabilities(
|
capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities)
|
||||||
capabilities, {snippetSupport = false})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, ls in ipairs(language_servers) do
|
for _, ls in ipairs(language_servers) do
|
||||||
|
Loading…
Reference in New Issue
Block a user