This commit is contained in:
Damjan 9000 2024-03-09 13:35:36 -08:00 committed by GitHub
commit 024493e6f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -608,10 +608,16 @@ require('lazy').setup({
'stevearc/conform.nvim',
opts = {
notify_on_error = false,
format_on_save = {
format_on_save = function(bufnr)
-- Enable format on save for specified filetypes
local enable_filetypes = { 'lua' }
if vim.tbl_contains(enable_filetypes, vim.bo[bufnr].filetype) then
return {
timeout_ms = 500,
lsp_fallback = true,
},
}
end
end,
formatters_by_ft = {
lua = { 'stylua' },
-- Conform can also run multiple formatters sequentially