kickstart.nvim/lua/plugins/conform.lua

28 lines
641 B
Lua

return { -- Autoformat
'stevearc/conform.nvim',
lazy = false,
keys = {
{
'<leader>f',
function()
require('conform').format { async = true }
end,
mode = '',
desc = '[F]ormat buffer',
},
},
opts = {
formatters_by_ft = {
lua = { 'stylua' },
c = { 'clang-format' },
cpp = { 'clang-format' },
-- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" },
--
-- You can use a sub-list to tell conform to run *until* a formatter
-- is found.
-- javascript = { { "prettierd", "prettier" } },
},
},
}