We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3cfccc0 commit 3e7f2bbCopy full SHA for 3e7f2bb
init.lua
@@ -608,10 +608,16 @@ require('lazy').setup({
608
'stevearc/conform.nvim',
609
opts = {
610
notify_on_error = false,
611
- format_on_save = {
612
- timeout_ms = 500,
613
- lsp_fallback = true,
614
- },
+ 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
615
+ return {
616
+ timeout_ms = 500,
617
+ lsp_fallback = true,
618
+ }
619
+ end
620
+ end,
621
formatters_by_ft = {
622
lua = { 'stylua' },
623
-- Conform can also run multiple formatters sequentially
0 commit comments