From 6cb047320f087e4b8f64d35b2c56d3b1eff9e1da Mon Sep 17 00:00:00 2001 From: Simon Lasbrugnas Date: Sun, 27 Jul 2025 03:58:18 +0200 Subject: [PATCH] feat(lsp): add html-lsp + update conform config --- lua/custom/lsp/config/html.lua | 11 +++++++++++ lua/custom/plugins/conform.lua | 7 ++++--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 lua/custom/lsp/config/html.lua 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, }, }, })