Auto install conform formatters and adjusted how formatters are configured
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user