Added "Conform" formatter plugin

This commit is contained in:
2025-07-10 00:20:04 +09:00
parent 90782ff7e9
commit 17327e35f4
+16
View File
@@ -0,0 +1,16 @@
return {
"stevearc/conform.nvim",
config = function ()
vim.api.nvim_create_user_command("Format", function (args)
local range = nil
if args.count ~= -1 then
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
range = {
start = { args.line1, 0},
["end"] = { args.line2, end_line:len() },
}
end
require("conform").format({ async = true, lsp_format = "fallback", range = range })
end, {range = true })
end
}