diff options
Diffstat (limited to 'doc/conform.txt')
-rw-r--r-- | doc/conform.txt | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/doc/conform.txt b/doc/conform.txt index 2048692..4271e95 100644 --- a/doc/conform.txt +++ b/doc/conform.txt @@ -51,7 +51,7 @@ OPTIONS *conform-option log_level = vim.log.levels.ERROR, -- Conform will notify you when a formatter errors notify_on_error = true, - -- Custom formatters and changes to built-in formatters + -- Custom formatters and overrides for built-in formatters formatters = { my_formatter = { -- This can be a string or a function that returns a string. @@ -109,6 +109,30 @@ OPTIONS *conform-option -------------------------------------------------------------------------------- API *conform-api* +setup({opts}) *conform.setup* + + Parameters: + {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): conform.FormatOpts` I + f 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): conform.FormatOpts` I + f 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. + {log_level} `nil|integer` Set the log level (e.g. + `vim.log.levels.DEBUG`). Use `:ConformInfo` to see + 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. + format({opts}, {callback}): boolean *conform.format* Format a buffer |