feat(lsp): add html-lsp + update conform config
This commit is contained in:
parent
5dafced30e
commit
6cb047320f
2 changed files with 15 additions and 3 deletions
11
lua/custom/lsp/config/html.lua
Normal file
11
lua/custom/lsp/config/html.lua
Normal file
|
|
@ -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
|
||||||
|
}
|
||||||
|
|
@ -3,8 +3,9 @@ return {
|
||||||
config = function()
|
config = function()
|
||||||
require("conform").setup({
|
require("conform").setup({
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
html = { "biome" },
|
html = { "biome", "html-lsp" },
|
||||||
yaml = { "biome" },
|
json = { "biome" },
|
||||||
|
yaml = { "yamlls" },
|
||||||
javascript = { "biome" },
|
javascript = { "biome" },
|
||||||
javascriptreact = { "biome" },
|
javascriptreact = { "biome" },
|
||||||
markdown = { "biome" },
|
markdown = { "biome" },
|
||||||
|
|
@ -19,7 +20,7 @@ return {
|
||||||
formatters = {
|
formatters = {
|
||||||
biome = {
|
biome = {
|
||||||
condition = function()
|
condition = function()
|
||||||
return vim.loop.fs_realpath("biome.json") ~= nil end,
|
return vim.uv.fs_realpath("biome.json") ~= nil end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue