return { { 'VonHeikemen/lsp-zero.nvim', branch = 'v3.x', dependencies = { 'neovim/nvim-lspconfig', 'williamboman/mason.nvim', 'williamboman/mason-lspconfig.nvim', 'hrsh7th/nvim-cmp', 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', }, config = function () local lsp_zero = require('lsp-zero') lsp_zero.on_attach(function (client, bufnr) lsp_zero.default_keymaps({ buffer = bufnr }) end) require('mason').setup({}) require('mason-lspconfig').setup({ ensure_installed = {}, handlers = { function (server_name) require('lspconfig')[server_name].setup({}) end, }, }) local cmp = require('cmp') cmp.setup({ sources = { {name = 'nvim_lsp'}, }, mapping = { [''] = cmp.mapping.confirm({select = false}), [''] = cmp.mapping.abort(), [''] = cmp.mapping.select_prev_item({behavior = 'select'}), [''] = cmp.mapping.select_next_item({behavior = 'select'}), [''] = cmp.mapping(function() if cmp.visible() then cmp.select_prev_item({behavior = 'insert'}) else cmp.complete() end end), [''] = cmp.mapping(function() if cmp.visible() then cmp.select_next_item({behavior = 'insert'}) else cmp.complete() end end), }, snippet = { expand = function(args) require('luasnip').lsp_expand(args.body) end, }, }) end }, }