diff --git a/lua/custom/lsp/config/html.lua b/lua/custom/lsp/config/html.lua new file mode 100644 index 0000000..c82d78d --- /dev/null +++ b/lua/custom/lsp/config/html.lua @@ -0,0 +1,11 @@ +return { + on_attach = function(_, bufnr) + -- Format document on save + vim.api.nvim_create_autocmd("BufWritePre", { + buffer = bufnr, + callback = function() + vim.lsp.buf.format() + end, + }) + end +} diff --git a/lua/custom/plugins/conform.lua b/lua/custom/plugins/conform.lua index fcea89c..440b991 100644 --- a/lua/custom/plugins/conform.lua +++ b/lua/custom/plugins/conform.lua @@ -3,8 +3,9 @@ return { config = function() require("conform").setup({ formatters_by_ft = { - html = { "biome" }, - yaml = { "biome" }, + html = { "biome", "html-lsp" }, + json = { "biome" }, + yaml = { "yamlls" }, javascript = { "biome" }, javascriptreact = { "biome" }, markdown = { "biome" }, @@ -19,7 +20,7 @@ return { formatters = { biome = { condition = function() - return vim.loop.fs_realpath("biome.json") ~= nil end, + return vim.uv.fs_realpath("biome.json") ~= nil end, }, }, })