diff options
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 = { |