aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorSteven Arcangeli <stevearc@stevearc.com>2024-07-13 14:28:18 -0700
committerSteven Arcangeli <stevearc@stevearc.com>2024-07-19 08:41:31 -0700
commit0b3d25969e2da2f5de90cc02ccd6446aa68dd895 (patch)
treeed78bf0fae463a6f7bb1be08757a6ea5a5b6c3d7 /doc
parent3a0e9b44076514ffba6c81ca28685107928b55f7 (diff)
feat: format parameter to only run the first available formatter
Diffstat (limited to 'doc')
-rw-r--r--doc/conform.txt73
1 files changed, 41 insertions, 32 deletions
diff --git a/doc/conform.txt b/doc/conform.txt
index 002e46c..589289b 100644
--- a/doc/conform.txt
+++ b/doc/conform.txt
@@ -132,11 +132,12 @@ setup({opts}) *conform.setu
This can also be a function that returns the table.
{default_format_opts} `nil|conform.DefaultFormatOpts` The default
options to use when calling conform.format()
- {timeout_ms} `nil|integer` Time in milliseconds to block for
- formatting. Defaults to 1000. No effect if async =
- true.
- {lsp_format} `nil|conform.LspFormatOpts` Configure if and when LSP
- should be used for formatting. Defaults to "never".
+ {timeout_ms} `nil|integer` Time in milliseconds to block for
+ formatting. Defaults to 1000. No effect if
+ async = true.
+ {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
@@ -145,8 +146,10 @@ setup({opts}) *conform.setu
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.
+ {quiet} `nil|boolean` Don't show any notifications for
+ warnings or failures. Defaults to false.
+ {stop_after_first} `nil|boolean` Only run the first available
+ formatter in the list. Defaults to false.
{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
@@ -166,20 +169,23 @@ 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
- {undojoin} `nil|boolean` Use undojoin to merge formatting changes
- with previous edit (default false)
- {formatters} `nil|string[]` List of formatters to run. Defaults to all
- formatters for the buffer filetype.
- {lsp_format} `nil|conform.LspFormatOpts` Configure if and when LSP
- should be used for formatting. Defaults to "never".
+ {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
+ {undojoin} `nil|boolean` Use undojoin to merge formatting
+ changes with previous edit (default false)
+ {formatters} `nil|string[]` List of formatters to run. Defaults
+ to all formatters for the buffer filetype.
+ {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
@@ -188,19 +194,22 @@ format({opts}, {callback}): boolean *conform.forma
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|conform.Range` 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
+ {stop_after_first} `nil|boolean` Only run the first available
+ formatter in the list. Defaults to false.
+ {quiet} `nil|boolean` Don't show any notifications for
+ warnings or failures. Defaults to false.
+ {range} `nil|conform.Range` 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
{start} `integer[]`
{end} `integer[]`
- {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
+ {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.ls
+ p.buf.format| when using LSP formatting
{callback} `nil|fun(err: nil|string, did_edit: nil|boolean)` Called once
formatting has completed
Returns: