File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -603,10 +603,19 @@ 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 "autoformat on save" for languages that don't have
608+ -- 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' , ' cpp' }
611+ if vim .tbl_contains (disable_filetypes , vim .bo [bufnr ].filetype ) then
612+ return
613+ end
614+ return {
615+ timeout_ms = 500 ,
616+ lsp_fallback = true ,
617+ }
618+ end ,
610619 formatters_by_ft = {
611620 lua = { ' stylua' },
612621 -- Conform can also run multiple formatters sequentially
You can’t perform that action at this time.
0 commit comments