feat: disable conflicting auto-formatters

main
mandlm 2022-02-22 11:18:59 +01:00
parent b5489face8
commit b20b0afb88
Signed by: mandlm
GPG Key ID: 4AA25D647AA54CC7
1 changed files with 5 additions and 0 deletions

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