How do I unregister null-ls as a formatter for certain filetypes to avoid prompts? #117
-
When multiple formatters are available, NeoVim prompts you to choose one. This is annoying if automatic formatting is enabled. How do I unregister |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
I had my |
Beta Was this translation helpful? Give feedback.
-
I do have that issue. here is the video video-210902-1600-56.mp4 |
Beta Was this translation helpful? Give feedback.
-
Thank you 😊. Have a nice day 👍
…On Thu, 2 Sep 2021, 4:57 pm Jose Alvarez, ***@***.***> wrote:
This is a separate issue, and it's happening because both the HTML
language server and null-ls are registered as formatting providers, so
Neovim will ask you which one you want to choose. If you don't want to use
the HTML language server for formatting, you can disable its formatting
capabilities in its on_attach callback:
require("lspconfig").html.setup({
on_attach = function(client)
client.resolved_capabilities.document_formatting = false
end,
})
This will make Neovim default to null-ls formatting.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#117 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AT6BKBGHV42ZI42DYREITMTT75NTBANCNFSM5CHVWU7A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
I had my
formatter.with
filetypes configured wrong. Proper configuration prevents the prompt.