nvim/lua/plugins/conform.lua
2025-04-17 21:58:34 +02:00

27 lines
580 B
Lua

return {
'stevearc/conform.nvim',
cmd = { 'ConformInfo' },
opts = {
default_format_opts = {
lsp_format = 'fallback',
},
log_level = vim.log.levels.ERROR,
formatters_by_ft = {
lua = { 'stylua' },
python = { 'ruff_format' },
yaml = { 'prettier', timeout_ms = 5000 },
cmake = { 'gersemi' },
markdown = { 'prettier' },
json = { 'fixjson' },
},
},
keys = {
{
'<space>f',
mode = { 'n', 'x', 'v' },
function() require('conform').format() end,
desc = 'Format with Conform',
},
},
}