mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2024-12-23 09:37:59 +00:00
28 lines
637 B
Lua
28 lines
637 B
Lua
require("conform").setup({
|
|
formatters_by_ft = {
|
|
go = { "goimports", "gofumpt" },
|
|
javascript = { "prettier" },
|
|
json = { "prettier" },
|
|
lua = { "stylua" },
|
|
markdown = { "prettier" },
|
|
python = { "isort", "black" },
|
|
typescript = { "prettier" },
|
|
yaml = { "prettier" },
|
|
hcl = { "terraform_fmt" },
|
|
},
|
|
formatters = {
|
|
{
|
|
command = "black",
|
|
args = { "--line-length", "100" },
|
|
},
|
|
},
|
|
format_on_save = function(bufnr)
|
|
local filetypes = { "go", "typescript", "lua", "hcl" }
|
|
if not vim.tbl_contains(filetypes, vim.bo[bufnr].filetype) then
|
|
return
|
|
end
|
|
|
|
return { timeout_ms = 500, lsp_fallback = false }
|
|
end,
|
|
})
|