nvim/lua/plugins/conform.lua

29 lines
871 B
Lua
Raw Permalink Normal View History

2024-12-17 15:10:37 +00:00
return {
-- This will provide type hinting with LuaLS
---@module "conform"
---@type conform.setupOpts
opts = {
-- Define your formatters
formatters_by_ft = {
yaml = { "yamlfmt" },
2024-12-17 19:37:16 +00:00
markdown = { "mdformat" },
bash = { "shfmt" },
2024-12-17 15:10:37 +00:00
--lua = { "stylua" },
--python = { "isort", "black" },
--javascript = { "prettierd", "prettier", stop_after_first = true },
},
-- Set default options
default_format_opts = {
lsp_format = "fallback",
},
-- Set up format-on-save
--format_on_save = { timeout_ms = 500 },
-- Customize formatters
formatters = {
2024-12-17 19:37:16 +00:00
yamlfmt = {
prepend_args = { "-formatter", "retain_line_breaks=true,indentless_arrays=true" },
2024-12-17 15:10:37 +00:00
},
},
}
}