dot_files/.config/nvim/lua/plugins/lua-zero.lua

51 lines
1.6 KiB
Lua
Raw Normal View History

2024-03-18 10:51:30 +00:00
return {
'VonHeikemen/lsp-zero.nvim',
branch = 'v1.x',
dependencies = {
-- LSP Support
{'neovim/nvim-lspconfig'}, -- Required
{'williamboman/mason.nvim'}, -- Optional
{'williamboman/mason-lspconfig.nvim'}, -- Optional
2024-05-18 20:46:28 +00:00
{'lvimuser/lsp-inlayhints.nvim'},
2024-03-18 10:51:30 +00:00
-- Autocompletion
{'hrsh7th/nvim-cmp'}, -- Required
{'hrsh7th/cmp-nvim-lsp'}, -- Required
{'hrsh7th/cmp-buffer'}, -- Optional
{'hrsh7th/cmp-path'}, -- Optional
{'saadparwaiz1/cmp_luasnip'}, -- Optional
{'hrsh7th/cmp-nvim-lua'}, -- Optional
-- Snippets
{'L3MON4D3/LuaSnip'}, -- Required
{'rafamadriz/friendly-snippets'}, -- Optional
},
init = function()
local lsp_zero = require('lsp-zero')
2024-05-18 20:46:28 +00:00
local ih = require('lsp-inlayhints')
ih.setup()
2024-03-18 10:51:30 +00:00
lsp_zero.on_attach(function(client, bufnr)
2024-05-18 20:46:28 +00:00
-- see :help lsp-zero-keybindings
-- to learn the available actions
lsp_zero.default_keymaps({buffer = bufnr})
-- ih.on_attach(client, bufnr)
2024-03-18 10:51:30 +00:00
end)
require('mason').setup({})
require('mason-lspconfig').setup({
2024-05-18 20:46:28 +00:00
ensure_installed = {},
handlers = {
function(server_name)
require('lspconfig')[server_name].setup({
on_attach = function(client, bufnr)
ih.on_attach(client, bufnr)
end,
})
end,
},
2024-03-18 10:51:30 +00:00
})
2024-05-18 20:46:28 +00:00
-- require('lspconfig').clangd.setup({})
2024-03-18 10:51:30 +00:00
end
};