disable predefined Format command

This commit is contained in:
Thomas Ruoff
2023-03-27 23:14:22 +02:00
parent db54008bfc
commit e6213210ee

View File

@@ -396,9 +396,9 @@ local on_attach = function(_, bufnr)
end, '[W]orkspace [L]ist Folders')
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
vim.lsp.buf.format()
end, { desc = 'Format current buffer with LSP' })
-- vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
-- vim.lsp.buf.format()
-- end, { desc = 'Format current buffer with LSP' })
end
-- Enable the following language servers
@@ -422,7 +422,9 @@ local servers = {
},
},
},
stylelint_lsp = {},
stylelint_lsp = {
filetypes = { 'css' },
},
lua_ls = {
Lua = {
workspace = { checkThirdParty = false },
@@ -450,11 +452,16 @@ mason_lspconfig.setup {
mason_lspconfig.setup_handlers {
function(server_name)
require('lspconfig')[server_name].setup {
local settings = servers[server_name]
local config = {
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
settings = settings,
}
if settings ~= nil and settings['filetypes'] ~= nil then
config.filetypes = settings.filetypes
end
require('lspconfig')[server_name].setup(config)
end,
}
@@ -498,6 +505,7 @@ cmp.setup {
end, { 'i', 's' }),
},
sources = {
{ name = 'neorg' },
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
},