Skip to content

Conversation

rollf
Copy link

@rollf rollf commented Sep 8, 2025

This PR attempts to fix #91. This is done by renaming the user-defined conform.nvim functions FormatEnable/Disable/Toggle to ConformFormatEnable/Disable/Toggle. Doing so allows to access other functions named Format... which are provided in the global name space by lsp-format.nvim. The function names where the same.

In a second step, new functions are added, namely AllFormatEnable/Disable/Toggle which invoke the corresponding functions for both plugins. Thus, a single command can be used to change the behavior of both plugins.

lsp-format.nvim does not (yet?) allow disabling on a per-buffer basis. The All... functions do not differentiate between all or current buffer neither.

Renaming the functions is a breaking change. Anyone having mapped those function will now invoke the "wrong" ones (previously, the conform.nvim functionality was accessed, now it would be the one from lsp-format.nvim)

bang = true,
})
vim.api.nvim_create_user_command("AllFormatDisable", function()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather have this block somewhere else. Technically, it does neither belong to the convirm nor the lsp-format plugin. I did not see an obvious candidate for this extra config lua section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disabling autoformat doesn't work
1 participant