From 27b9098b1376fb3f0d3d83b5b07a560f679b910e Mon Sep 17 00:00:00 2001 From: Lorran David Date: Sat, 5 Oct 2024 06:59:35 -0300 Subject: [PATCH] disable auto format on save --- init.lua | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/init.lua b/init.lua index 89a6bb40..2e546b00 100644 --- a/init.lua +++ b/init.lua @@ -699,22 +699,22 @@ require('lazy').setup({ }, opts = { notify_on_error = false, - format_on_save = function(bufnr) - -- Disable "format_on_save lsp_fallback" for languages that don't - -- have a well standardized coding style. You can add additional - -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } - local lsp_format_opt - if disable_filetypes[vim.bo[bufnr].filetype] then - lsp_format_opt = 'never' - else - lsp_format_opt = 'fallback' - end - return { - timeout_ms = 500, - lsp_format = lsp_format_opt, - } - end, + -- format_on_save = function(bufnr) + -- -- Disable "format_on_save lsp_fallback" for languages that don't + -- -- have a well standardized coding style. You can add additional + -- -- languages here or re-enable it for the disabled ones. + -- local disable_filetypes = { c = true, cpp = true } + -- local lsp_format_opt + -- if disable_filetypes[vim.bo[bufnr].filetype] then + -- lsp_format_opt = 'never' + -- else + -- lsp_format_opt = 'fallback' + -- end + -- return { + -- timeout_ms = 500, + -- lsp_format = lsp_format_opt, + -- } + -- end, formatters_by_ft = { lua = { 'stylua' }, -- Conform can also run multiple formatters sequentially