mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-29 12:10:12 +02:00
feat(extras): added conform.nvim
extra you can use instead of null-ls/none-ls
This commit is contained in:
parent
6b05ed7dcd
commit
f61a243d1a
6 changed files with 115 additions and 0 deletions
|
@ -5,6 +5,11 @@ local M = {}
|
|||
---@type PluginLspOpts
|
||||
M.opts = nil
|
||||
|
||||
-- Allow plugins to set a custom formatter for a buffer.
|
||||
-- See the conform extra for an example.
|
||||
---@type fun(bufnr:number):boolean
|
||||
M.custom_format = nil
|
||||
|
||||
function M.enabled()
|
||||
return M.opts.autoformat
|
||||
end
|
||||
|
@ -30,6 +35,10 @@ function M.format(opts)
|
|||
return
|
||||
end
|
||||
|
||||
if M.custom_format and M.custom_format(buf) then
|
||||
return
|
||||
end
|
||||
|
||||
local formatters = M.get_formatters(buf)
|
||||
local client_ids = vim.tbl_map(function(client)
|
||||
return client.id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue