1
0
mirror of https://github.com/danbee/dotfiles-local synced 2025-03-04 08:49:07 +00:00

Add LSP config

This commit is contained in:
Daniel Barber 2023-07-18 17:22:42 -05:00
parent 1b3a57eaa6
commit 33796e6c8d
3 changed files with 33 additions and 0 deletions

View File

@ -3,3 +3,4 @@ vim.opt.termguicolors = true
require("config.keymaps")
require("config.lazy")
require("config.options")
require("config.lsp")

View File

@ -0,0 +1,31 @@
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]",
},
}),
},
})

View File

@ -5,6 +5,7 @@ return {
"hrsh7th/cmp-path",
"hrsh7th/cmp-vsnip",
"hrsh7th/vim-vsnip",
"onsails/lspkind-nvim",
"preservim/nerdcommenter",
"tpope/vim-bundler",
"tpope/vim-eunuch",