Files
dotfiles/nvim/lua/plugins/conform.lua
markus.dieckmann 7dd6bd1675 null-ls and session
2025-10-17 15:23:13 +02:00

34 lines
964 B
Lua

return {
"stevearc/conform.nvim",
keys = {
{
"<leader>cf",
function()
require("conform").format({ lsp_format = "fallback" })
end,
desc = "[C]ode [F]ormat",
},
},
opts = {
async = true,
format = {
timeout_ms = 5000,
},
formatters_by_ft = {
lua = { "stylua" },
-- Conform will run multiple formatters sequentially
python = { "isort", "black" },
-- You can customize some of the format options for the filetype (:help conform.format)
rust = { "rustfmt" },
-- Conform will run the first available formatter
javascript = { "eslint_d", "prettierd", "prettier", stop_after_first = true },
typescript = { "eslint_d", "prettierd", "prettier", stop_after_first = true },
prisma = { "null-ls", lsp_format = false },
format_on_save = {
-- These options will be passed to conform.format()
timeout_ms = 5000,
},
},
},
}