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 b83b2b0 commit dca3a7fCopy full SHA for dca3a7f
init.lua
@@ -607,10 +607,16 @@ require('lazy').setup {
607
'stevearc/conform.nvim',
608
opts = {
609
notify_on_error = false,
610
- format_on_save = {
611
- timeout_ms = 500,
612
- lsp_fallback = true,
613
- },
+ 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
614
+ return {
615
+ timeout_ms = 500,
616
+ lsp_fallback = true,
617
+ }
618
+ end
619
+ end,
620
formatters_by_ft = {
621
lua = { 'stylua' },
622
-- Conform can also run multiple formatters sequentially
0 commit comments