init.lua/after/plugin/conform.lua

15 lines
292 B
Lua
Raw Normal View History

local conform = require("conform")
conform.setup({
formatters_by_ft = {
python = { "isort", "black" },
lua = { "stylua" },
},
})
vim.keymap.set({ "n", "v" }, "<leader>f", function()
conform.format({
lsp_fallback = true,
})
end, { desc = "Format file or range (in visual mode)" })