diff options
author | Steven Arcangeli <stevearc@stevearc.com> | 2024-07-13 14:39:46 -0700 |
---|---|---|
committer | Steven Arcangeli <stevearc@stevearc.com> | 2024-07-19 08:41:31 -0700 |
commit | 9f111be14818c91832db8f320c4a4aa68de0e00b (patch) | |
tree | 924758fb05e01fbea8ddcc578ac2efa48d3964d6 /doc | |
parent | 0b3d25969e2da2f5de90cc02ccd6446aa68dd895 (diff) |
refactor: deprecate formatter alternation syntax
Diffstat (limited to 'doc')
-rw-r--r-- | doc/conform.txt | 2 | ||||
-rw-r--r-- | doc/recipes.md | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/doc/conform.txt b/doc/conform.txt index 589289b..89b5468 100644 --- a/doc/conform.txt +++ b/doc/conform.txt @@ -17,8 +17,6 @@ OPTIONS *conform-option lua = { "stylua" }, -- Conform will run multiple formatters sequentially go = { "goimports", "gofmt" }, - -- Use a sub-list to run only the first available formatter - javascript = { { "prettierd", "prettier" } }, -- You can also customize some of the format options for the filetype rust = { "rustfmt", lsp_format = "fallback" }, -- You can use a function here to determine the formatters dynamically diff --git a/doc/recipes.md b/doc/recipes.md index 45c1e07..97c3cdc 100644 --- a/doc/recipes.md +++ b/doc/recipes.md @@ -149,7 +149,7 @@ return { -- Customize or remove this keymap to your liking "<leader>f", function() - require("conform").format({ async = true, lsp_format = "fallback" }) + require("conform").format({ async = true }) end, mode = "", desc = "Format buffer", @@ -163,10 +163,14 @@ return { formatters_by_ft = { lua = { "stylua" }, python = { "isort", "black" }, - javascript = { { "prettierd", "prettier" } }, + 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, lsp_format = "fallback" }, + format_on_save = { timeout_ms = 500 }, -- Customize formatters formatters = { shfmt = { |