File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -603,10 +603,16 @@ require('lazy').setup({
603603 ' stevearc/conform.nvim' ,
604604 opts = {
605605 notify_on_error = false ,
606- format_on_save = {
607- timeout_ms = 500 ,
608- lsp_fallback = true ,
609- },
606+ format_on_save = function (bufnr )
607+ -- Disable "format_on_save lsp_fallback" for languages that don't
608+ -- have a well standardized coding style. You can add additional
609+ -- languages here or re-enable it for the disabled ones.
610+ local disable_filetypes = { c = true , cpp = true }
611+ return {
612+ timeout_ms = 500 ,
613+ lsp_fallback = not disable_filetypes [vim .bo [bufnr ].filetype ],
614+ }
615+ end ,
610616 formatters_by_ft = {
611617 lua = { ' stylua' },
612618 -- Conform can also run multiple formatters sequentially
You can’t perform that action at this time.
0 commit comments