Merge dca3a7f8b9
into 3cfccc01be
This commit is contained in:
commit
024493e6f4
1 changed files with 10 additions and 4 deletions
10
init.lua
10
init.lua
|
@ -608,10 +608,16 @@ require('lazy').setup({
|
||||||
'stevearc/conform.nvim',
|
'stevearc/conform.nvim',
|
||||||
opts = {
|
opts = {
|
||||||
notify_on_error = false,
|
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,
|
timeout_ms = 500,
|
||||||
lsp_fallback = true,
|
lsp_fallback = true,
|
||||||
},
|
}
|
||||||
|
end
|
||||||
|
end,
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { 'stylua' },
|
lua = { 'stylua' },
|
||||||
-- Conform can also run multiple formatters sequentially
|
-- Conform can also run multiple formatters sequentially
|
||||||
|
|
Loading…
Add table
Reference in a new issue