diff options
Diffstat (limited to 'doc/conform.txt')
-rw-r--r-- | doc/conform.txt | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/doc/conform.txt b/doc/conform.txt index a3d3c2e..4d2c0b6 100644 --- a/doc/conform.txt +++ b/doc/conform.txt @@ -119,12 +119,12 @@ setup({opts}) *conform.setu {opts} `nil|conform.setupOpts` {formatters_by_ft} `nil|table<string, conform.FiletypeFormatter>` Map of filetype to formatters - {format_on_save} `nil|conform.FormatOpts|fun(bufnr: integer): nil|conform.FormatOpts` I - f this is set, Conform will run the formatter on + {format_on_save} `nil|conform.FormatOpts|fun(bufnr: integer): nil|conform.FormatOpts` + 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. - {format_after_save} `nil|conform.FormatOpts|fun(bufnr: integer): nil|conform.FormatOpts` I - f this is set, Conform will run the formatter + {format_after_save} `nil|conform.FormatOpts|fun(bufnr: integer): nil|conform.FormatOpts` + If this is set, Conform will run the formatter asynchronously after save. It will pass the table to conform.format(). This can also be a function that returns the table. @@ -133,8 +133,8 @@ setup({opts}) *conform.setu the location of the log file. {notify_on_error} `nil|boolean` Conform will notify you when a formatter errors (default true). - {formatters} `nil|table<string, conform.FormatterConfigOverride|fun(bufnr: integer): nil|conform.FormatterConfigOverride>` C - ustom formatters and overrides for built-in + {formatters} `nil|table<string, conform.FormatterConfigOverride|fun(bufnr: integer): nil|conform.FormatterConfigOverride>` + Custom formatters and overrides for built-in formatters. format({opts}, {callback}): boolean *conform.format* @@ -152,11 +152,16 @@ format({opts}, {callback}): boolean *conform.forma the buffer {formatters} `nil|string[]` List of formatters to run. Defaults to all formatters for the buffer filetype. - {lsp_format} `nil|"never"|"fallback"|"prefer"|"first"|"last"` "fallbac - k" LSP formatting when no other formatters are available, - "prefer" only LSP formatting when available, "first" LSP - formatting then other formatters, "last" other formatters - then LSP. + {lsp_format} `nil|conform.LspFormatOpts` Configure if and when LSP + should be used for formatting. Defaults to "never". + `"never"` never use the LSP for formatting (default) + `"fallback"` LSP formatting is used when no other formatters are + available + `"prefer"` use only LSP formatting when available + `"first"` LSP formatting is used when available and then other + formatters + `"last"` other formatters are used then LSP formatting when + available {quiet} `nil|boolean` Don't show any notifications for warnings or failures. Defaults to false. {range} `nil|table` Range to format. Table must contain `start` |