init.lua/after/plugin/conform.lua
2023-12-24 20:54:49 +01:00

17 lines
334 B
Lua

local conform = require("conform")
conform.setup({
formatters_by_ft = {
python = { "isort", "black" },
lua = { "stylua" },
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)" })