diff --git a/lua/plugins/formatter.lua b/lua/plugins/formatter.lua new file mode 100644 index 0000000..835fa9f --- /dev/null +++ b/lua/plugins/formatter.lua @@ -0,0 +1,23 @@ +return { + "stevearc/conform.nvim", + opts = {}, + config = function() + require("conform").setup({ + 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", lsp_format = "fallback" }, + -- Conform will run the first available formatter + -- javascript = { "prettierd", "prettier", stop_after_first = true }, + yaml = { "yamlfmt", stop_after_first = true }, + }, + format_on_save = { + -- These options will be passed to conform.format() + timeout_ms = 500, + lsp_format = "fallback", + }, + }) + end, +}