mirror of
https://git.sr.ht/~danbarber/dotfiles
synced 2025-03-04 08:59:18 +00:00
32 lines
842 B
Lua
32 lines
842 B
Lua
local lspconfig = require("lspconfig")
|
|
|
|
-- Neovim doesn't support snippets out of the box, so we need to mutate the
|
|
-- capabilities we send to the language server to let them know we want snippets.
|
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
|
|
|
-- Setup our autocompletion. These configuration options are the default ones
|
|
-- copied out of the documentation.
|
|
local cmp = require("cmp")
|
|
|
|
cmp.setup({
|
|
snippet = {
|
|
expand = function(args)
|
|
-- For `vsnip` user.
|
|
vim.fn["vsnip#anonymous"](args.body)
|
|
end,
|
|
},
|
|
sources = {
|
|
{ name = "nvim_lsp" },
|
|
{ name = "vsnip" },
|
|
},
|
|
formatting = {
|
|
format = require("lspkind").cmp_format({
|
|
with_text = true,
|
|
menu = {
|
|
nvim_lsp = "[LSP]",
|
|
},
|
|
}),
|
|
},
|
|
})
|