dot_files/.config/nvim/lua/plugins/lua-zero.lua
2024-05-18 23:46:28 +03:00

51 lines
1.6 KiB
Lua

return {
'VonHeikemen/lsp-zero.nvim',
branch = 'v1.x',
dependencies = {
-- LSP Support
{'neovim/nvim-lspconfig'}, -- Required
{'williamboman/mason.nvim'}, -- Optional
{'williamboman/mason-lspconfig.nvim'}, -- Optional
{'lvimuser/lsp-inlayhints.nvim'},
-- 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')
local ih = require('lsp-inlayhints')
ih.setup()
lsp_zero.on_attach(function(client, bufnr)
-- see :help lsp-zero-keybindings
-- to learn the available actions
lsp_zero.default_keymaps({buffer = bufnr})
-- ih.on_attach(client, bufnr)
end)
require('mason').setup({})
require('mason-lspconfig').setup({
ensure_installed = {},
handlers = {
function(server_name)
require('lspconfig')[server_name].setup({
on_attach = function(client, bufnr)
ih.on_attach(client, bufnr)
end,
})
end,
},
})
-- require('lspconfig').clangd.setup({})
end
};