Public Access
42 lines
1.1 KiB
Lua
42 lines
1.1 KiB
Lua
vim.pack.add({
|
|
{
|
|
src = "https://github.com/stevearc/conform.nvim",
|
|
name = "conform.nvim",
|
|
},
|
|
})
|
|
|
|
local dart = require("romanzy.custom.dart")
|
|
|
|
require("conform").setup({
|
|
formatters_by_ft = {
|
|
dart = { "dart_format" },
|
|
javascript = { "prettier" },
|
|
javascriptreact = { "prettier" },
|
|
typescript = { "prettier" },
|
|
typescriptreact = { "prettier" },
|
|
markdown = { "prettier" },
|
|
c = { filter = function() return false end },
|
|
cpp = { filter = function() return false end },
|
|
h = { filter = function() return false end }
|
|
},
|
|
formatters = {
|
|
prettier = {
|
|
prepend_args = function(_, ctx)
|
|
if vim.bo[ctx.buf].filetype == "markdown" then
|
|
return { "--prose-wrap=always", "--print-width=80" }
|
|
end
|
|
return {}
|
|
end,
|
|
},
|
|
dart_format = {
|
|
command = function(_, ctx)
|
|
return dart.executable(ctx.filename)
|
|
end,
|
|
},
|
|
},
|
|
format_on_save = {
|
|
lsp_format = "fallback",
|
|
timeout_ms = 2000,
|
|
},
|
|
})
|