refactor + fmt

This commit is contained in:
2026-04-26 18:06:10 +02:00
parent 56243dacb3
commit 5acc1a8804
31 changed files with 546 additions and 933 deletions
+35
View File
@@ -0,0 +1,35 @@
---@module 'lazy'
---@type LazySpec
return {
'stevearc/conform.nvim',
event = { 'BufWritePre' },
cmd = { 'ConformInfo' },
keys = {
{
'<leader>f',
function() require('conform').format { async = true } end,
mode = '',
desc = '[F]ormat buffer',
},
},
---@module 'conform'
---@type conform.setupOpts
opts = {
notify_on_error = false,
format_on_save = function(bufnr)
local enabled_filetypes = {
-- lua = true,
-- python = true,
}
if enabled_filetypes[vim.bo[bufnr].filetype] then return { timeout_ms = 500 } end
return nil
end,
default_format_opts = {
lsp_format = 'fallback',
},
formatters_by_ft = {
-- rust = { 'rustfmt' },
-- python = { "isort", "black" },
},
},
}