feat: disable conflicting auto-formatters

This commit is contained in:
mandlm 2022-02-22 11:18:59 +01:00
parent b5489face8
commit b20b0afb88
Signed by: mandlm
GPG Key ID: 4AA25D647AA54CC7

View File

@ -80,6 +80,11 @@ local function custom_on_attach(client, buffer_nr)
-- Open all project diagnostics in quickfix list
bufnnoremap("<leader><C-d>", "<Cmd>lua vim.diagnostic.setqflist()<CR>")
-- disable conflicting formatters
if client.name == "tsserver" or client.name == "html" then
client.resolved_capabilities.document_formatting = false
end
if client.resolved_capabilities.document_formatting then
vim.cmd("autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()")
end