diff options
author | Steven Arcangeli <506791+stevearc@users.noreply.github.com> | 2024-07-19 08:46:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-19 08:46:46 -0700 |
commit | d60d41c34c9eacf8131685f28532e72f12f21482 (patch) | |
tree | 76a0820ccbae7c112ca4dab39882f135b4b0c64a /scripts | |
parent | ae213f5169d5d0c6abbe76e1438d932772fc1657 (diff) | |
parent | 54ea60d1591486e7e56183addf1f45b03244386d (diff) |
Merge pull request #491 from stevearc/stevearc-config-refactor
feat!: large rework of configuration logic
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/options_doc.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/options_doc.lua b/scripts/options_doc.lua index 193b462..561751d 100644 --- a/scripts/options_doc.lua +++ b/scripts/options_doc.lua @@ -4,8 +4,8 @@ require("conform").setup({ 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 python = function(bufnr) if require("conform").get_formatter_info("ruff_format", bufnr).available then @@ -20,6 +20,11 @@ require("conform").setup({ -- have other formatters configured. ["_"] = { "trim_whitespace" }, }, + -- Set this to change the default values when calling conform.format() + -- This will also affect the default values for format_on_save/format_after_save + default_format_opts = { + lsp_format = "fallback", + }, -- If this is set, Conform will run the formatter on save. -- It will pass the table to conform.format(). -- This can also be a function that returns the table. @@ -38,6 +43,8 @@ require("conform").setup({ log_level = vim.log.levels.ERROR, -- Conform will notify you when a formatter errors notify_on_error = true, + -- Conform will notify you when no formatters are available for the buffer + notify_no_formatters = true, -- Custom formatters and overrides for built-in formatters formatters = { my_formatter = { @@ -74,7 +81,6 @@ require("conform").setup({ -- Set to false to disable merging the config with the base definition inherit = true, -- When inherit = true, add these additional arguments to the beginning of the command. - -- When inherit = true, add these additional arguments to the command. -- This can also be a function, like args prepend_args = { "--use-tabs" }, -- When inherit = true, add these additional arguments to the end of the command. |