init.lua/after/plugin/conform.lua

17 lines
334 B
Lua
Raw Normal View History

local conform = require("conform")
conform.setup({
formatters_by_ft = {
python = { "isort", "black" },
lua = { "stylua" },
2023-12-24 20:54:49 +01:00
sh = { "shfmt" },
bash = { "shfmt" },
},
})
vim.keymap.set({ "n", "v" }, "<leader>f", function()
conform.format({
lsp_fallback = true,
})
end, { desc = "Format file or range (in visual mode)" })