You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- Disable "format_on_save lsp_fallback" for languages that don't
486
-
-- have a well standardized coding style. You can add additional
487
-
-- languages here or re-enable it for the disabled ones.
488
-
localdisable_filetypes= { c=true, cpp=true }
489
-
ifdisable_filetypes[vim.bo[bufnr].filetype] then
490
-
returnnil
490
+
-- You can specify filetypes to autoformat on save here:
491
+
localenabled_filetypes= {
492
+
lua=true,
493
+
python=true,
494
+
}
495
+
ifenabled_filetypes[vim.bo[bufnr].filetype] then
496
+
return { timeout_ms=500 }
491
497
else
492
-
return {
493
-
timeout_ms=500,
494
-
lsp_format='fallback',
495
-
}
498
+
returnnil
496
499
end
497
500
end,
501
+
default_format_opts= {
502
+
lsp_format='fallback', -- Use external formatters if configured below, otherwise use LSP formatting. Set to `false` to disable LSP formatting entirely.
503
+
},
504
+
-- You can also specify external formatters in here.
498
505
formatters_by_ft= {
499
-
lua= { 'stylua' },
506
+
-- rust = { 'rustfmt' },
500
507
sh= { 'shfmt' },
501
508
-- Conform can also run multiple formatters sequentially
0 commit comments