Closed azdanov closed 5 months ago
Looks good to me.
You don't even have to create the command on lsp-zero's configuration. You can create an autocommand in the conform.nvim file.
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(event)
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
require("conform").format({ async = true, lsp_fallback = true })
end, { desc = "Format current buffer" })
vim.keymap.set("n", "<leader>cf", "<cmd>Format<CR>", { buffer = bufnr, desc = "Format" })
end,
})
Got it. Thank you.
I guess the issue can be closed now? 😄
Hello. I'm wondering if there is a better way to use conform.nvim alongside lsp-zero.
At the moment I have this setup:
Would be cool to hear any improvements.
Edit after closing: I'm using recipe from https://github.com/stevearc/conform.nvim/blob/master/doc/recipes.md#lazy-loading-with-lazynvim