.dotfiles/global/.config/nvim/lua/plugins/conform.lua
2024-09-22 20:53:22 +02:00

44 lines
947 B
Lua

return {
"stevearc/conform.nvim",
opts = {
log_level = vim.log.levels.DEBUG,
formatters = {
prettier_markdown = {
command = "prettier",
args = {
"--stdin-filepath",
"$FILENAME",
"--config",
os.getenv("HOME") .. "/.prettierrc.yaml",
"--parser",
"markdown",
},
-- stdin = true,
-- options = {
-- ext_parsers = {
-- jrnl = { "markdown" },
-- },
-- },
},
},
icon = "", --'▎',
formatters_by_ft = {
lua = { "stylua" },
python = { "ruff_format", "ruff_fix", "isort" },
javascript = { "biome" },
typescript = { "biome" },
javascriptreact = { "biome" },
typescriptreact = { "biome" },
json = { "biome" },
sh = { "shfmt" },
markdown = { "prettier_markdown" },
jrnl = { "prettier_markdown" },
["*"] = { "trim_whitespace", "codespell" },
},
format_on_save = {
timeout_ms = 1000,
lsp_fallback = true,
},
},
lazy = false,
}