aboutsummaryrefslogtreecommitdiffstats
path: root/doc/conform.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/conform.txt')
-rw-r--r--doc/conform.txt58
1 files changed, 29 insertions, 29 deletions
diff --git a/doc/conform.txt b/doc/conform.txt
index b7d2768..8463ac4 100644
--- a/doc/conform.txt
+++ b/doc/conform.txt
@@ -38,14 +38,14 @@ OPTIONS *conform-option
-- This can also be a function that returns the table.
format_on_save = {
-- I recommend these options. See :help conform.format for details.
- lsp_fallback = true,
+ lsp_format = "fallback",
timeout_ms = 500,
},
-- 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.
format_after_save = {
- lsp_fallback = true,
+ lsp_format = "fallback",
},
-- Set the log level. Use `:ConformInfo` to see the location of the log file.
log_level = vim.log.levels.ERROR,
@@ -142,32 +142,32 @@ format({opts}, {callback}): boolean *conform.forma
Parameters:
{opts} `nil|conform.FormatOpts`
- {timeout_ms} `nil|integer` Time in milliseconds to block for
- formatting. Defaults to 1000. No effect if async =
- true.
- {bufnr} `nil|integer` Format this buffer (default 0)
- {async} `nil|boolean` If true the method won't block. Defaults
- to false. If the buffer is modified before the
- formatter completes, the formatting will be discarded.
- {dry_run} `nil|boolean` If true don't apply formatting changes to
- the buffer
- {formatters} `nil|string[]` List of formatters to run. Defaults to
- all formatters for the buffer filetype.
- {lsp_fallback} `nil|boolean|"always"` Attempt LSP formatting if no
- formatters are available. Defaults to false. If
- "always", will attempt LSP formatting even if
- formatters are 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`
- and `end` keys with {row, col} tuples using (1,0)
- indexing. Defaults to current selection in visual mode
- {id} `nil|integer` Passed to |vim.lsp.buf.format| when
- lsp_fallback = true
- {name} `nil|string` Passed to |vim.lsp.buf.format| when
- lsp_fallback = true
- {filter} `nil|fun(client: table): boolean` Passed to
- |vim.lsp.buf.format| when lsp_fallback = true
+ {timeout_ms} `nil|integer` Time in milliseconds to block for
+ formatting. Defaults to 1000. No effect if async = true.
+ {bufnr} `nil|integer` Format this buffer (default 0)
+ {async} `nil|boolean` If true the method won't block. Defaults to
+ false. If the buffer is modified before the formatter
+ completes, the formatting will be discarded.
+ {dry_run} `nil|boolean` If true don't apply formatting changes to
+ 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.
+ {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`
+ and `end` keys with {row, col} tuples using (1,0)
+ indexing. Defaults to current selection in visual mode
+ {id} `nil|integer` Passed to |vim.lsp.buf.format| when using
+ LSP formatting
+ {name} `nil|string` Passed to |vim.lsp.buf.format| when using
+ LSP formatting
+ {filter} `nil|fun(client: table): boolean` Passed to
+ |vim.lsp.buf.format| when using LSP formatting
{callback} `nil|fun(err: nil|string, did_edit: nil|boolean)` Called once
formatting has completed
Returns:
@@ -191,7 +191,7 @@ get_formatter_info({formatter}, {bufnr}): conform.FormatterInfo *conform.get_for
{bufnr} `nil|integer`
will_fallback_lsp({options}): boolean *conform.will_fallback_lsp*
- Check if the buffer will use LSP formatting when lsp_fallback = true
+ Check if the buffer will use LSP formatting when lsp_format = "fallback"
Parameters:
{options} `nil|table` Options passed to |vim.lsp.buf.format|