return {
	"neovim/nvim-lspconfig",
	event = { "BufReadPre", "BufNewFile" },
	dependencies = {
		"hrsh7th/cmp-nvim-lsp",
		{ "folke/neodev.nvim", opts = {} },
	},
	config = function()
		local on_attach = function(client, bufnr)
			if client.server_capabilities.documentFormattingProvider then
				vim.api.nvim_create_autocmd("BufWritePre", {
					group = vim.api.nvim_create_augroup("Format", { clear = true }),
					buffer = bufnr,
					callback = function()
						vim.lsp.buf.format()
					end,
				})
			end
		end

		local capabilities = require("cmp_nvim_lsp").default_capabilities()

		local servers = {
			"ts_ls",
			"bashls",
			"cssls",
			"eslint",
			"html",
			"jsonls",
			"pyright",
			"lua_ls",
			"yamlls",
			"marksman",
		}

		for _, server in ipairs(servers) do
			require("lspconfig")[server].setup({
				on_attach = on_attach,
				capabilities = capabilities,
			})
		end
	end,
}

-- return {
-- 	"neovim/nvim-lspconfig",
-- 	event = { "BufReadPre", "BufNewFile" },
-- 	dependencies = {
-- 		"hrsh7th/cmp-nvim-lsp",
-- 		{ "folke/neodev.nvim", opts = {} },
-- 	},
-- 	config = function()
-- 		local mason_lspconfig = require("mason-lspconfig")

-- 		local on_attach = function(client, bufnr)
-- 			-- Format on save
-- 			if client.server_capabilities.documentFormattingProvider then
-- 				vim.api.nvim_create_autocmd("BufWritePre", {
-- 					group = vim.api.nvim_create_augroup("Format", { clear = true }),
-- 					buffer = bufnr,
-- 					callback = function()
-- 						vim.lsp.buf.format()
-- 					end,
-- 				})
-- 			end
-- 		end

-- 		local capabilities = require("cmp_nvim_lsp").default_capabilities()

-- 		-- Setup all installed servers
-- 		for _, server in ipairs(mason_lspconfig.get_installed_servers()) do
-- 			require("lspconfig")[server].setup({
-- 				on_attach = on_attach,
-- 				capabilities = capabilities,
-- 			})
-- 		end
-- 	end,
-- }
