You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

39 lines
1.2 KiB

return {
"stevearc/conform.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
local conform = require("conform")
conform.setup({
formatters_by_ft = {
lua = { "stylua" },
go = { "goimports", "gofmt" },
javascript = { "prettierd" },
typescript = { "prettierd" },
vue = { "prettierd" },
css = { "prettierd" },
html = { "prettierd" },
markdown = { "prettierd" },
json = { "fixjson" },
rust = { "rustfmt" },
shell = { "shfmt", "shellcheck" },
python = { "isort", "black" },
php = { "phpcbf" },
},
log_level = vim.log.levels.WARN,
notify_on_error = false,
})
vim.keymap.set({ "n", "v" }, "<leader>F", function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = 500,
})
end)
conform.formatters.phpcbf = {
prepend_args = { "--standard=~/.config/phpcs.xml" },
}
end,
}