add conform with yamlfmt
This commit is contained in:
parent
e35fea1f4e
commit
4653116fac
4 changed files with 107 additions and 66 deletions
26
lua/plugins/conform.lua
Normal file
26
lua/plugins/conform.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
return {
|
||||
-- This will provide type hinting with LuaLS
|
||||
---@module "conform"
|
||||
---@type conform.setupOpts
|
||||
opts = {
|
||||
-- Define your formatters
|
||||
formatters_by_ft = {
|
||||
yaml = { "yamlfmt" },
|
||||
--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 = {
|
||||
shfmt = {
|
||||
prepend_args = { "-i", "2" },
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue