dotfiles/nvim/lua/plugins/conform.lua

23 lines
723 B
Lua
Raw Normal View History

2025-02-18 21:28:13 +00:00
return {
'stevearc/conform.nvim',
event = { "BufWritePre" },
cmd = { "ConformInfo" },
opts = {
formatters_by_ft = {
javascript = { "prettierd", stop_after_first = true },
typescript = { "prettierd", stop_after_first = true },
typescriptreact = { "prettierd", stop_after_first = true },
svelte = { "prettierd", stop_after_first = true },
php = { "pint" }
},
format_on_save = {
-- These options will be passed to conform.format()
timeout_ms = 500,
lsp_format = "fallback",
},
},
init = function()
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
end,
}