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:
parent
1b3a57eaa6
commit
33796e6c8d
@ -3,3 +3,4 @@ vim.opt.termguicolors = true
|
|||||||
require("config.keymaps")
|
require("config.keymaps")
|
||||||
require("config.lazy")
|
require("config.lazy")
|
||||||
require("config.options")
|
require("config.options")
|
||||||
|
require("config.lsp")
|
||||||
|
|||||||
31
config/nvim/lua/config/lsp.lua
Normal file
31
config/nvim/lua/config/lsp.lua
Normal 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]",
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
})
|
||||||
@ -5,6 +5,7 @@ return {
|
|||||||
"hrsh7th/cmp-path",
|
"hrsh7th/cmp-path",
|
||||||
"hrsh7th/cmp-vsnip",
|
"hrsh7th/cmp-vsnip",
|
||||||
"hrsh7th/vim-vsnip",
|
"hrsh7th/vim-vsnip",
|
||||||
|
"onsails/lspkind-nvim",
|
||||||
"preservim/nerdcommenter",
|
"preservim/nerdcommenter",
|
||||||
"tpope/vim-bundler",
|
"tpope/vim-bundler",
|
||||||
"tpope/vim-eunuch",
|
"tpope/vim-eunuch",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user