Auto install conform formatters and adjusted how formatters are configured

This commit is contained in:
2025-05-26 03:30:30 +02:00
parent fc435a934c
commit b92f5348cf
6 changed files with 29 additions and 184 deletions

View File

@@ -1,5 +1,4 @@
-- https://github.com/stevearc/conform.nvim
local slow_format_filetypes = {}
return {
"stevearc/conform.nvim",
@@ -20,7 +19,7 @@ return {
},
},
opts = {
formatters_by_ft = require("tools").formatters,
formatters_by_ft = require("tools.format"),
notify_on_error = false,
format_on_save = function(bufnr)
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then

View File

@@ -22,8 +22,6 @@ return {
return tool
end
end, tools.servers()))
ensure_installed =
vim.list_extend(ensure_installed, require("util.mason").process_formatters(tools.formatters))
ensure_installed = vim.list_extend(ensure_installed, tools.extra)
require("mason-tool-installer").setup({
@@ -32,4 +30,12 @@ return {
})
end,
},
{
"zapling/mason-conform.nvim",
opts = {},
dependencies = {
{ "mason-org/mason.nvim", opts = {} },
"stevearc/conform.nvim",
},
},
}